Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
18
account_invoice_constraint_chronology/model/account_journal.py
Executable file
18
account_invoice_constraint_chronology/model/account_journal.py
Executable file
@@ -0,0 +1,18 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user