From 3033b053495a6603607d240fd16fd1aa517c44fd Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 4 Jan 2016 15:47:53 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=C2=A0stock=5Faccount:=20Product=20descrip?= =?UTF-8?q?tion=20on=20invoices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The system showed different Description for product in invoice when you generate invoices based on delivery orders compared with based on the sales order lines. But the invoice is in the two cases attached with the SO. Then the description of the product must be the description linked to the SO line. opw:660723 --- addons/stock_account/stock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/stock.py b/addons/stock_account/stock.py index 554412b350b..7218ccd900a 100644 --- a/addons/stock_account/stock.py +++ b/addons/stock_account/stock.py @@ -135,10 +135,13 @@ class stock_move(osv.osv): fp_obj = self.pool.get('account.fiscal.position') # Get account_id fp = fp_obj.browse(cr, uid, context.get('fp_id')) if context.get('fp_id') else False + name = False if inv_type in ('out_invoice', 'out_refund'): account_id = move.product_id.property_account_income.id if not account_id: account_id = move.product_id.categ_id.property_account_income_categ.id + if move.procurement_id and move.procurement_id.sale_line_id: + name = move.procurement_id.sale_line_id.name else: account_id = move.product_id.property_account_expense.id if not account_id: @@ -156,7 +159,7 @@ class stock_move(osv.osv): taxes_ids = self._get_taxes(cr, uid, move, context=context) return { - 'name': move.name, + 'name': name or move.name, 'account_id': account_id, 'product_id': move.product_id.id, 'uos_id': uos_id,