From cf59d1bb97ec5e22a7e312f01652abc621cfd7e9 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Fri, 17 Jan 2014 14:32:36 +0100 Subject: [PATCH] handle refunds the same way than invoices for the references --- account_invoice_reference/account_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_invoice_reference/account_move.py b/account_invoice_reference/account_move.py index 5d3ef4c6..8dd22c89 100644 --- a/account_invoice_reference/account_move.py +++ b/account_invoice_reference/account_move.py @@ -26,9 +26,9 @@ class account_move(orm.Model): _inherit = 'account.move' def _ref_from_invoice(self, cr, uid, invoice, context=None): - if invoice.type == 'out_invoice': + if invoice.type in ('out_invoice', 'out_refund'): return invoice.origin or invoice.name - elif invoice.type == 'in_invoice': + elif invoice.type == ('in_invoice', 'in_refund'): # the supplier invoice number is now mandatory, but # if historical invoices should not have one, we fallback # to the name of the invoice