[FIX] sale, sale_layout: sale_layout_cat_id field

The field 'sale_layout_cat_id' is installed  by the sale_layout module.
Introduced by bde7f4dad1

opw:656981
Closes #9157
This commit is contained in:
Goffin Simon
2015-11-24 14:27:38 +01:00
parent bde7f4dad1
commit 131e12b773
2 changed files with 13 additions and 1 deletions
-1
View File
@@ -675,7 +675,6 @@ class SaleOrderLine(models.Model):
'product_id': self.product_id.id or False,
'invoice_line_tax_ids': [(6, 0, self.tax_id.ids)],
'account_analytic_id': self.order_id.project_id.id,
'sale_layout_cat_id': self.sale_layout_cat_id.id,
}
return res
+13
View File
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api
from openerp.osv import osv, fields
from itertools import groupby
@@ -113,3 +114,15 @@ class SaleOrderLine(osv.Model):
if line.categ_sequence:
invoice_vals['categ_sequence'] = line.categ_sequence
return invoice_vals
@api.multi
def _prepare_invoice_line(self, qty):
"""
Prepare the dict of values to create the new invoice line for a sales order line.
:param qty: float quantity to invoice
"""
res = super(SaleOrderLine, self)._prepare_invoice_line(qty)
if self.sale_layout_cat_id:
res['sale_layout_cat_id'] = self.sale_layout_cat_id.id
return res