Issue 8244

Title
Add warning when an supplier with same reference already exists
Priority
feature
Status
testing
Nosy list
ced, lukio, pokoli, reviewbot
Assigned to
pokoli
Keywords
review

Created on 2019-04-01.18:09:15 by pokoli, last changed 3 months ago by pokoli.

Messages

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-06-10.09:17:19

We can not assume that all supplier invoices encoded will have a reference.

Why not? I think it is a good practices to set the supplier number as reference on the supplier invoices to encode the invoices. When receiving an invoice from a supplier you will always have a number as this is a mandatory field to have an invoice.

Do you have any example where the invoice should not have any number?

For me a better solution needs to be found.

I'm open to any other ideas if there is other.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-07-24.17:09:05
On 2020-07-24 16:34, Sergi Almacellas Abellana wrote:
> > * Supplier invoices are assembled from purchase so already you cannot
>   use twice the same line.
> 
> But there are some invoices that do not come for any purchase. I.E: Internet, Phone, Water, Electricity, etc. 

That's not a reason to disqualifies all other points.

> > * User will stop filling the reference field to avoid the warning.
> 
> Then we can should make it required to avoid the user skiping the warning. 

That's not possible. We can not assume that all supplier invoices
encoded will have a reference. And this is against Tryton principal to
not add constraint which are not required by the process.

For me a better solution needs to be found.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2020-07-24.16:34:09
> * Supplier invoices are assembled from purchase so already you cannot
  use twice the same line.

But there are some invoices that do not come for any purchase. I.E: Internet, Phone, Water, Electricity, etc. 

> * User will stop filling the reference field to avoid the warning.

Then we can should make it required to avoid the user skiping the warning. 

As far as each customer invoice should have a number, each supplier invoice should have the external reference set. 

But if we make the field required I'm wondering if we should make the feature an optin so it may be deactivated when the validation is not desired.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-04-02.09:15:06
On 2019-04-02 09:04, Sergi Almacellas Abellana wrote:
> > Cédric Krier added the comment:
> > 
> > I do not think a warning is the right way because it prevents automatic creation of document.
> I've added a context flag that allows to skip the test. This can be set on automatic processes to skip the warning and create the documents.

This is not a good solution. We have seen that such design is broken
with the access right. Because it leads to have to set *everywhere* this
context if we want to be modular.

> > But here as the data is not controlled by Tryton, we can not guess that the reference will be unique per party.
> That's why I set it as warning so the system allows to include duplicated references but warns the user before doing so. 

I doubt it adds real value for some reasons:

* Tools will never fix human workflow errors.
* Supplier invoices are assembled from purchase so already you cannot
  use twice the same line.
* User will stop filling the reference field to avoid the warning.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-04-02.09:04:01
> Cédric Krier added the comment:
> 
> I do not think a warning is the right way because it prevents automatic creation of document.
I've added a context flag that allows to skip the test. This can be set on automatic processes to skip the warning and create the documents.

> But here as the data is not controlled by Tryton, we can not guess that the reference will be unique per party.
That's why I set it as warning so the system allows to include duplicated references but warns the user before doing so. 

> On 1/4/19 18:49, Luciano Rossi wrote:
> Instead of check the duplicate on party.id, could we validate on tax identifier? We could add to the system two party, but with the same tax identifier.

Good point! I've just modified the review to test the party_tax_identifier if set, otherwise we fallback to testing the same party. 

I've also used a property to define the domain used to search duplicated invoices, so third party modules can customize the behavior if needed.
Author: [hidden] (lukio)
Date: 2019-04-01.18:49:54
Hi pokoli!

Instead of check the duplicate on party.id, could we validate on tax identifier? We could add to the system two party, but with the same tax identifier.

Cheers!
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-04-01.18:41:39
I do not think a warning is the right way because it prevents automatic creation of document. But here as the data is not controlled by Tryton, we can not guess that the reference will be unique per party.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-04-01.18:09:14
As the reference field is used to indicate the number of the supplier invoice, it can be used to determine if the invoice is already entered in the system. 

It will be great if we can show a warning message when trying to post the same supplier invoice multiple times (an invoice from the same supplier with the same reference)
History
Date User Action Args
2021-06-10 09:17:19pokolisetmessages: + msg68181
2020-07-24 17:09:06cedsetmessages: + msg59474
2020-07-24 16:34:10pokolisetmessages: + msg59473
2019-04-02 09:16:58reviewbotsetmessages: + msg48308
2019-04-02 09:15:07cedsetmessages: + msg48307
2019-04-02 09:04:02pokolisetmessages: + msg48306
2019-04-01 18:49:55lukiosetnosy: + lukio
messages: + msg48301
2019-04-01 18:41:39cedsetnosy: + ced
messages: + msg48300
2019-04-01 18:14:32reviewbotsetnosy: + reviewbot
messages: + msg48299
2019-04-01 18:14:00pokolisetreviews: 265201002
keyword: + review

Showing 10 items. Show all history (warning: this could be VERY long)