From cd31e82689c52c7001d209304f22e671bc36f16b Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 8 Nov 2017 19:22:14 +0100 Subject: [PATCH] [FIX] account: Allow to duplicate supplier invoices As there's a check for unique supplier reference numbers, you can't duplicate them as the field is copied on the duplicated record. This patch removes the copy for emptying the error. @Tecnativa --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 967bcc485c5..93951e68904 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -213,7 +213,7 @@ class AccountInvoice(models.Model): move_name = fields.Char(string='Journal Entry Name', readonly=False, default=False, copy=False, help="Technical field holding the number given to the invoice, automatically set when the invoice is validated then stored to set the same number again if the invoice is cancelled, set to draft and re-validated.") - reference = fields.Char(string='Vendor Reference', + reference = fields.Char(string='Vendor Reference', copy=False, help="The partner reference of this invoice.", readonly=True, states={'draft': [('readonly', False)]}) reference_type = fields.Selection('_get_reference_type', string='Payment Reference', required=True, readonly=True, states={'draft': [('readonly', False)]},