2014-08-07 12:58:07 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2017-03-13 14:18:36 +01:00
|
|
|
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
|
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
2014-08-07 12:58:07 +02:00
|
|
|
|
2017-03-13 14:18:36 +01:00
|
|
|
from odoo import models, fields, api
|
2014-08-07 12:58:07 +02:00
|
|
|
|
|
|
|
|
2017-03-14 19:09:03 +01:00
|
|
|
class AccountJournal(models.Model):
|
2014-08-14 09:52:19 +02:00
|
|
|
_inherit = ['account.journal']
|
2014-08-07 12:58:07 +02:00
|
|
|
|
2014-08-14 09:52:19 +02:00
|
|
|
check_chronology = fields.Boolean(string='Check Chronology', default=False)
|
|
|
|
|
2017-03-14 19:09:03 +01:00
|
|
|
@api.multi
|
2014-08-18 11:06:23 +02:00
|
|
|
@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
|