dlv_account_move_copy_ref
Overview
In core Odoo the reference of an invoice (account.move.ref, label
Customer Reference on customer documents) is not copied when the invoice is
duplicated. This addon makes it copy, and warns the user afterwards.
How it works
- Python (
models/account_move.py):refgetscopy=True.copy_data()removes it again for every move that is notout_invoice/out_refund, so vendor bills and journal entries keep the core behaviour. An explicitrefin thedefaultdict always wins (credit note reversal sets its own). - JS (
static/src/js/duplicate_warning.js): patchesFormController.duplicateRecord. After the duplicate, if the new record is anaccount.movecustomer invoice/credit note with a non-emptyref, a modal alert dialog (OK button) warning is shown: "'Customer Reference' was also copied, check whether it is still relevant or should be removed." (nl: "'Referentie klant' werd ook gekopieerd, kijk na of dit relevant is of dient verwijderd te worden.")
Scope
- Only the Duplicate action in the form view shows the warning. Server-side
copy()calls (e.g. recurring entries) copy the reference silently. - No warning when
refis empty.
Compatibility
- Odoo 16.0 (Community and Enterprise)
- Depends on:
account
Credits
bv Domus La Vila — https://domuslavila.eu
License: LGPL-3