Files
Odoo-18.0-20251222/account_invoice_constraint_chronology/model/account_journal.py
tocmo0nlord adbe430761
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled
Initial commit: Odoo 18.0-20251222 extra-addons
2026-03-13 20:43:25 +00:00

19 lines
559 B
Python
Executable File

# Copyright 2015-2019 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2021 CorporateHub (https://corporatehub.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class AccountJournal(models.Model):
_inherit = "account.journal"
check_chronology = fields.Boolean()
@api.onchange("type")
def _onchange_type_for_alias(self):
res = super()._onchange_type_for_alias()
if self.type not in ["sale", "purchase"]:
self.check_chronology = False
return res