2019-01-30 14:27:00 +01:00
|
|
|
# Copyright 2015-2019 ACSONE SA/NV (<http://acsone.eu>)
|
2021-04-05 16:27:30 +02:00
|
|
|
# Copyright 2021 CorporateHub (https://corporatehub.eu)
|
2017-12-19 17:28:44 +01:00
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
2014-08-07 12:58:07 +02:00
|
|
|
|
2021-04-05 16:26:59 +02:00
|
|
|
from odoo import api, fields, models
|
2014-08-07 12:58:07 +02:00
|
|
|
|
|
|
|
|
2017-03-14 19:09:03 +01:00
|
|
|
class AccountJournal(models.Model):
|
2021-04-05 16:27:30 +02:00
|
|
|
_inherit = "account.journal"
|
2014-08-07 12:58:07 +02:00
|
|
|
|
2021-04-05 16:27:30 +02:00
|
|
|
check_chronology = fields.Boolean()
|
2014-08-14 09:52:19 +02:00
|
|
|
|
2021-04-05 16:26:59 +02:00
|
|
|
@api.onchange("type")
|
2017-05-29 13:21:20 +02:00
|
|
|
def _onchange_type(self):
|
2022-03-22 16:31:02 +01:00
|
|
|
res = super()._onchange_type()
|
2021-04-05 16:26:59 +02:00
|
|
|
if self.type not in ["sale", "purchase"]:
|
2017-05-29 13:21:20 +02:00
|
|
|
self.check_chronology = False
|
2022-03-22 16:31:02 +01:00
|
|
|
return res
|