Before, account_fiscal_country_id was only use for tax operations; and country_id was used for all the other accounting stuff. Now, with the new ability to use foreign tax reports (with foreign VAT fiscal positions), we can generalize the fiscal country, sot that it is the one that needs to be used for the whole accounting. Since foreign tax reports were not supported before, account_fiscal_country_id is already set on existing database as the country for the "main" accounting, so the impact of this change is small. closes odoo/odoo#68349 Related: odoo/upgrade#2322 Related: odoo/enterprise#17299 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
21 lines
726 B
Python
21 lines
726 B
Python
# -*- 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)
|
|
if company.account_fiscal_country_id.code != 'FR':
|
|
return journal_data
|
|
|
|
for journal in journal_data:
|
|
if journal['type'] in ('sale', 'purchase'):
|
|
journal.update({'refund_sequence': True})
|
|
return journal_data
|