2
0
account-financial-tools/account_invoice_constraint_chronology/model/account.py

20 lines
560 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
2017-03-14 19:09:03 +01:00
class AccountJournal(models.Model):
_inherit = ['account.journal']
check_chronology = fields.Boolean(string='Check Chronology', default=False)
2017-03-14 19:09:03 +01:00
@api.multi
@api.onchange('type')
def on_change_type(self):
2017-03-14 19:09:03 +01:00
for rec in self:
if rec.type not in ['sale', 'purchase']:
rec.check_chronology = False
return True