Files
odoo_source/addons/l10n_dk/models/account_journal.py
T
Dylan Kiss (dyki) 0b1b4c8d05 [REV] l10n_dk: force lock of sales and purchase entries
We don't want to force anything and make clear that we have 3 solutions
the user can choose: hash, lock date and audit trail.

This reverts commit 3a5fc92c34.

closes odoo/odoo#136625

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-27 21:24:19 +00:00

22 lines
769 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class AccountJournal(models.Model):
_inherit = 'account.journal'
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
# OVERRIDE
account_vals = super()._prepare_liquidity_account_vals(company, code, vals)
if company.account_fiscal_country_id.code == 'DK':
# Ensure the newly liquidity accounts have the right account tag in order to be part
# of the Danish financial reports.
account_vals.setdefault('tag_ids', [])
account_vals['tag_ids'].append((4, self.env.ref('l10n_dk.account_tag_liquidity').id))
return account_vals