From 75f0c7df4dc016b5e0ace4db5b6487fc5a21632a Mon Sep 17 00:00:00 2001 From: nachosalvador Date: Sat, 28 Mar 2015 20:51:58 +0100 Subject: [PATCH] [FIX] account: fetch name from first line only invoice_line is a one2many, causes expected singleton error if the invoice has more than one line. --- 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 d7f4b53d134..2486d70c9e8 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1142,7 +1142,7 @@ class account_invoice(models.Model): else: ref = self.number partner = self.partner_id._find_accounting_partner(self.partner_id) - name = name or self.invoice_line.name or self.number + name = name or self.invoice_line[0].name or self.number # Pay attention to the sign for both debit/credit AND amount_currency l1 = { 'name': name,