From 223c92f3c0b7d3385abeceb4641ee4b0e9ff41ee Mon Sep 17 00:00:00 2001 From: rmu-odoo Date: Tue, 20 Jan 2015 13:13:41 +0530 Subject: [PATCH] [FIX] account: prioritize supplier number over reference on invoice When generating the accounting entries, to compute the name, the invoice reference (e.g. origin purchase order name) was first used before the supplier invoice number. To facilate reconciliation of bank statements, the supplier invoice number makes more sense. Fixes #3839, opw 618765 --- addons/account/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index f6ae7995d0f..cb7fb9a8cfe 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -841,7 +841,7 @@ class account_invoice(models.Model): # create one move line for the total and possibly adjust the other lines amount total, total_currency, iml = inv.with_context(ctx).compute_invoice_totals(company_currency, ref, iml) - name = inv.name or inv.supplier_invoice_number or '/' + name = inv.supplier_invoice_number or inv.name or '/' totlines = [] if inv.payment_term: totlines = inv.with_context(ctx).payment_term.compute(total, date_invoice)[0]