[FIX] sale_layout: set 0 as default value for categ_sequence
Otherwise, in some cases, the categ_sequence can be set to null, which is not ordered the same way than 0, and you won't be able to sort lines with null and 0 as categ_sequence between each others
This commit is contained in:
parent
fde2046d5e
commit
2b0a8363d9
|
@ -84,6 +84,9 @@ 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):
|
||||
|
@ -113,6 +116,11 @@ class SaleOrderLine(osv.Model):
|
|||
string='Layout Sequence', store=True)
|
||||
# Store is intentionally set in order to keep the "historic" order.
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'categ_sequence': 0
|
||||
}
|
||||
|
||||
_order = 'order_id, categ_sequence, sequence, id'
|
||||
|
||||
def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):
|
||||
|
|
Loading…
Reference in New Issue