[FIX] sale_layout: remove `categ_sequence` default value.

`categ_sequence` are stored related fields, to `sale_layout_cat_id.sequence`.
Setting a default value for them has as side effect to rewrite
the value on the related field.

To reproduce the issue:
 - Create a sale layout category, with 10 as sequence
 - Create an invoice with one line, with this sale layout category
 - Come back to the sale layout category,
   notice that the sequence has been changed to 0.

Besides, as the sequence was rewritten on the sale layout category,
the sequence was rewritten on all sale order lines and invoice lines
having this sale layout category.
If you have a bunch of them, this could take a while.

The `categ_sequence` default value is supposed
to come from the sale layout category.

opw-651937
This commit is contained in:
Denis Ledoux 2015-11-26 11:06:58 +01:00
parent 78ea8eb058
commit adf6d0e557
1 changed files with 0 additions and 8 deletions

View File

@ -84,10 +84,6 @@ class AccountInvoiceLine(osv.Model):
sale_layout_cat_id = openerp.fields.Many2one('sale_layout.category', string='Section')
categ_sequence = openerp.fields.Integer(related='sale_layout_cat_id.sequence',
string='Layout Sequence', store=True)
_defaults = {
'categ_sequence': 0
}
class SaleOrder(osv.Model):
_inherit = 'sale.order'
@ -117,10 +113,6 @@ class SaleOrderLine(osv.Model):
# Store is intentionally set in order to keep the "historic" order.
}
_defaults = {
'categ_sequence': 0
}
_order = 'order_id, categ_sequence, sale_layout_cat_id, sequence, id'
def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):