Invoices Reference
account_invoice_reference · OCA/account-reconcile
-
Security25/25No findings
-
Activity0/25Last human commit 102 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 4 Odoo series since 7.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
AccountInvoice— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (2 methods) migration-api-multi-one · sourceAccountMove— Class 'AccountMove' still inherits from the old-style `orm.Model` API: rewrite it against `models.Model`/`models.TransientModel`/`models.AbstractModel` - the old `osv`/`orm` API was removed entirely in modern Odoo. migration-old-api-base · sourceinvoice_supplier_form— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · source- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE account_move SET ref=%s WHERE id=%s AND (ref is null OR ref = '')` - re-check the table/column names still match after upgrading. (3 occurrences in this file) migration-raw-sql-write · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp.osv`) migration-openerp-import · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Invoices Reference
Aims to simplify the "references" fields on the invoices.
We observed difficulties for the users to file the references (name, origin, free reference) and above all, to understand which field will be copied in the reference field of the move and move lines.
The approach here is to state simple rules with one concern: consistency. The reference of the move lines must be the number of the document at their very origin (number of a sales order, of an external document like a supplier invoice, ...). The goal is for the accountant to be able to trace to the source document from a ledger). The description of a line should always be... well, a description. Not a number or a cryptic reference.
It particularly fits with other modules of the bank-statement-reconcile series as account_advanced_reconcile_transaction_ref.
Fields
Enumerating the information we need in an invoice, we find that the mandatory fields are:
- Invoice Number
- Description
- Internal Reference ("our reference")
- External Reference ("customer or supplier reference")
- Optionally, a technical transaction reference (credit card payment gateways, SEPA, ...)
Now, on the move lines:
- Name
- Reference
- Optionally, a technical transaction reference (added by the module
base_transaction_id)
Let's see how the information will be organized with this module.
Customers Invoices / Refunds
+-----------------+-----------------+------------------------------+
| Information | Invoice field | Instead of (in base modules) |
+=================+=================+==============================+
| Invoice number | Invoice number | Invoice number |
+-----------------+-----------------+------------------------------+
| Description | Name | -- |
+-----------------+-----------------+------------------------------+
| Internal Ref | Origin | Origin |
+-----------------+-----------------+------------------------------+
| External Ref | Reference | Name |
+-----------------+-----------------+------------------------------+
Information propagated to the move lines:
+-----------------+------------------------------------+
| Move line field | Invoice field |
+=================+====================================+
| Description | Name |
+-----------------+------------------------------------+
| Reference | Origin, or Invoice number if empty |
+-----------------+------------------------------------+
Supplier Invoices / Refunds
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supplier invoices have an additional field `supplier_invoice_number`
that we consider as redundant with the reference field. This field is kept
and even set as mandatory, while the reference field is hidden.
+-----------------+-----------------+------------------------------+
| Information | Invoice field | Instead of (in base modules) |
+=================+=================+==============================+
| Invoice number | Invoice number | Invoice number |
+-----------------+-----------------+------------------------------+
| Description | Name | -- |
+-----------------+-----------------+------------------------------+
| Internal Ref | Origin | Origin |
+-----------------+-----------------+------------------------------+
| External Ref | Supplier number | Supplier number |
+-----------------+-----------------+------------------------------+
The reference field is hidden when the reference type is "free reference",
because it is already filed in the Supplier invoice number.
Information propagated to the move lines:
+-----------------+---------------------------------------------+
| Move line field | Invoice field |
+=================+=============================================+
| Description | Name |
+-----------------+---------------------------------------------+
| Reference | Supplier number, or Invoice number if empty |
+-----------------+---------------------------------------------+
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 2
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
invoice_form |
account.invoice.form | account.invoice | form | Inherits account.invoice_form |
invoice_supplier_form |
account.invoice.supplier.form | account.invoice | form | Inherits account.invoice_supplier_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 2
No new fields.
Public methods (3)-
action_number(self)@api.multi -
create(self, vals)@api.model@api.returns('self', <expr>) -
write(self, vals)@api.multi
No new fields.
Public methods (1)-
create(self, cr, uid, vals, context=None)
Loading…
Loading…
Loading…