From f27bb59189f3549ad7b4c1bc34dff789c7af1828 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Tue, 18 Nov 2014 17:34:01 +0100 Subject: [PATCH] [IMP] account: add a sequence to account journals to allow reordering. This is used to re-order the point of sale's payment methods Conflicts: addons/account/account.py --- addons/account/account.py | 4 +++- addons/account/account_view.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 555d54c3ece..d2edea00d17 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -752,6 +752,7 @@ class account_journal(osv.osv): 'internal_account_id' : fields.many2one('account.account', 'Internal Transfers Account', select=1), 'cash_control' : fields.boolean('Cash Control', help='If you want the journal should be control at opening/closing, check this option'), 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"), + 'sequence': fields.integer('Sequence',help='Used to order Journals'), } _defaults = { @@ -759,13 +760,14 @@ class account_journal(osv.osv): 'with_last_closing_balance' : True, 'user_id': lambda self, cr, uid, context: uid, 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, + 'sequence': 1, } _sql_constraints = [ ('code_company_uniq', 'unique (code, company_id)', 'The code of the journal must be unique per company !'), ('name_company_uniq', 'unique (name, company_id)', 'The name of the journal must be unique per company !'), ] - _order = 'code' + _order = 'sequence,code' def _check_currency(self, cr, uid, ids, context=None): for journal in self.browse(cr, uid, ids, context=context): diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 3a766a0d781..1ec4c8ce1cf 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -360,6 +360,7 @@ account.journal +