Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to account_invoice_supplier_ref_unique v14 without adding a field on account.move #1484

Open
alexis-via opened this issue Jun 12, 2023 · 6 comments
Milestone

Comments

@alexis-via
Copy link
Contributor

In v14, Odoo doesn't display any warning nor any error message when you enter 2 supplier invoices for the same supplier with the same "Bill Reference". In v16, there is a warning banner on the vendor bill when this happens.

In v14, the OCA module account_invoice_supplier_ref_unique raises an error when you enter a second supplier invoice for the same supplier with the same number. But this module adds a field "supplier_invoice_number" on account.move, cf:

https://github.com/OCA/account-invoicing/blob/14.0/account_invoice_supplier_ref_unique/models/account_move.py#L11

I think it's a bad design to add a field on account.move that already exists in the native odoo datamodel. Do we have a solution in OCA to have the same feature without adding a field on account.move ?

Otherwise, I think I'll develop one (maybe it will be a backport of the native feature of v16... I don't know yet).

@rafaelbn rafaelbn added this to the 14.0 milestone Jun 12, 2023
@sbidoul
Copy link
Member

sbidoul commented Jun 12, 2023

I remember that at some point Odoo was conflating supplier invoice number and payment reference. I think that was the main reason a new field was introduced.

If that is resolved a new field may not be necessary anymore.

@rafaelbn
Copy link
Member

@alexis-via , are you sure? 😄

imagen

@etobella
Copy link
Member

@rafaelbn The issue with that, is that if we somehow choose a similar date, the error will not be raised

@rousseldenis
Copy link
Sponsor Contributor

In v14, Odoo doesn't display any warning nor any error message when you enter 2 supplier invoices for the same supplier with the same "Bill Reference". In v16, there is a warning banner on the vendor bill when this happens.

In v14, the OCA module account_invoice_supplier_ref_unique raises an error when you enter a second supplier invoice for the same supplier with the same number. But this module adds a field "supplier_invoice_number" on account.move, cf:

https://github.com/OCA/account-invoicing/blob/14.0/account_invoice_supplier_ref_unique/models/account_move.py#L11

I think it's a bad design to add a field on account.move that already exists in the native odoo datamodel. Do we have a solution in OCA to have the same feature without adding a field on account.move ?

Otherwise, I think I'll develop one (maybe it will be a backport of the native feature of v16... I don't know yet).

@alexis-via The fact is Odoo core is using the 'ref' field as payment reference. The aim with supplier_invoice_number is to add a reference that is for instance the invoice number at the supplier level that could be (and usually) different from the payment reference.

@rafaelbn
Copy link
Member

@Shide MT-3840 @moduon

@sbidoul
Copy link
Member

sbidoul commented Dec 29, 2023

The fact is Odoo core is using the 'ref' field as payment reference.

@rousseldenis I'm confused by your statement.
There is a payment_reference field on invoices (it exists since 14 at least).
Is it not used by Odoo for that purpose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants