[FIX] Keep the layout between sale order and invoice

bzr revid: sle@openerp.com-20140404155148-l8btjfhp640r0gew
This commit is contained in:
Simon Lejeune
2014-04-04 17:51:48 +02:00
parent f0fe7aa177
commit 97ffe7a5b9
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -135,3 +135,12 @@ class SaleOrderLine(osv.Model):
# Store is intentionally set in order to keep the "historic" order.
}
_order = 'order_id, categ_sequence, sequence, id'
def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):
"""Save the layout when converting to an invoice line."""
invoice_vals = super(SaleOrderLine, self)._prepare_order_line_invoice_line(cr, uid, line, account_id=account_id, context=context)
if line.sale_layout_cat_id:
invoice_vals['sale_layout_cat_id'] = line.sale_layout_cat_id.id
if line.categ_sequence:
invoice_vals['categ_sequence'] = line.categ_sequence
return invoice_vals
@@ -5,7 +5,7 @@
<!-- Category name -->
<t t-if="p['category']">
<tr>
<td colspan="100" class="active" style="font-weight: bold; border-bottom: 1px solid black;">&gt;
<td colspan="100" class="active" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
<t t-if="p['category'].name">
<t t-esc="p['category'].name"></t>
</t>