[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
This commit is contained in:
Frederic van der Essen
2014-11-26 12:18:46 +01:00
committed by Frédéric van der Essen
parent 5130f5b9ed
commit f27bb59189
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -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):
+1
View File
@@ -360,6 +360,7 @@
<field name="model">account.journal</field>
<field name="arch" type="xml">
<tree string="Account Journal">
<field name='sequence' widget='handle'/>
<field name="code"/>
<field name="name"/>
<field name="type"/>