Merge branch 'master-pos-wms-fva'
[odoo/odoo.git] / addons / account / account.py
index 555d54c..d2edea0 100644 (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):