From 2ceb475c80fc2bc6cb132f076b01ba6c94f06dd6 Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Thu, 14 Aug 2014 09:52:19 +0200 Subject: [PATCH] [IMP] Use new API on account_invoice_constraint_chronology for account.py --- .../model/account.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/account_invoice_constraint_chronology/model/account.py b/account_invoice_constraint_chronology/model/account.py index 07cc781c..5a03f336 100644 --- a/account_invoice_constraint_chronology/model/account.py +++ b/account_invoice_constraint_chronology/model/account.py @@ -27,19 +27,16 @@ # # -from openerp.osv import orm, fields +from openerp import models, fields, api -class account_jounrnal(orm.Model): - _inherit = "account.journal" - _columns = { - 'check_chronology': fields.boolean('Check Chronology'), - } - _defaults = { - 'check_chronology': False, - } +class account_jounrnal(models.Model): + _inherit = ['account.journal'] - def on_change_type(self, cr, uid, ids, type_journal, context=None): + check_chronology = fields.Boolean(string='Check Chronology', default=False) + + @api.multi + def on_change_type(self, type_journal, context=None): value = {} if type_journal not in ['sale', 'purchase', 'sale_refund', 'purchase_refund']: