This commit is contained in:
2026-11-08 17:43:44 +08:00
parent 974a1fb10b
commit 3b5af1e3a6
483 changed files with 590466 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from odoo import api, models
class AccountJournal(models.Model):
_inherit = 'account.journal'
@api.model_create_multi
def create(self, vals_list):
journals = super().create(vals_list)
# Creating a journal might invalidate snapshots if journal groups are in use (the default group might need it, it will have to be in the options)
if self.env['account.journal.group'].search([], limit=1):
self.env.ref('account_reports.ir_cron_create_snapshots')._trigger()
return journals
def write(self, vals):
rslt = super().write(vals)
if 'journal_group_id' in vals:
# Might change the content of the default journal group ; snapshots need refresh
self.env.ref('account_reports.ir_cron_create_snapshots')._trigger()
return rslt