From 9530012d09d6040c2c8b72ef69fd5e3a0dd5f688 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 3 Sep 2013 18:01:08 +0200 Subject: [PATCH] [IMP] account: set default value on account invoice line and fallback on id for ordering if no sequence is available bzr revid: mat@openerp.com-20130903160108-gc7hnhdmzx7rg6tm --- addons/account/account_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 2b8ff770a61..5284b1e5322 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1407,7 +1407,7 @@ class account_invoice_line(osv.osv): _name = "account.invoice.line" _description = "Invoice Line" - _order = "invoice_id,sequence" + _order = "invoice_id,sequence,id" _columns = { 'name': fields.text('Description', required=True), 'origin': fields.char('Source Document', size=256, help="Reference of the document that produced this invoice."), @@ -1444,6 +1444,7 @@ class account_invoice_line(osv.osv): 'discount': 0.0, 'price_unit': _price_unit_default, 'account_id': _default_account_id, + 'sequence': 10, } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):