From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/l10n_lu/models/__init__.py | 4 ++++ addons/l10n_lu/models/account_chart_template.py | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/l10n_lu/models/__init__.py create mode 100644 addons/l10n_lu/models/account_chart_template.py (limited to 'addons/l10n_lu/models') diff --git a/addons/l10n_lu/models/__init__.py b/addons/l10n_lu/models/__init__.py new file mode 100644 index 00000000..e811019f --- /dev/null +++ b/addons/l10n_lu/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import account_chart_template \ No newline at end of file diff --git a/addons/l10n_lu/models/account_chart_template.py b/addons/l10n_lu/models/account_chart_template.py new file mode 100644 index 00000000..2d9b3f4c --- /dev/null +++ b/addons/l10n_lu/models/account_chart_template.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, models, fields + + +class AccountChartTemplate(models.Model): + _inherit = 'account.chart.template' + + @api.model + def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None): + journal_data = super(AccountChartTemplate, self)._prepare_all_journals( + acc_template_ref, company, journals_dict) + for journal in journal_data: + if journal['type'] in ('sale', 'purchase') and company.country_id.code == "LU": + journal.update({'refund_sequence': True}) + return journal_data -- cgit v1.2.3