Files
odoo_source/addons/l10n_pt/models/chart_template.py
T
Ricardo Gomes Rodrigues (rigr) 581da8ca32 [IMP] l10n_pt: refactor Portuguese localization
This commit completely refactors and updates the Portuguese localization to include the:
- Chart of Accounts (the accounts as well as the account groups)
- Fiscal positions
- Taxes (including the ones from the islands of Madeira and Azores)
- Tax groups
- Tax report according to the Governement template
- Translations files to have the official translations of the accounts, the tax report, ...

Links:
CoA: https://www.occ.pt/fotos/editor2/taxonomiasplanocontas_fev2019.pdf
EU reverse charge: https://europa.eu/youreurope/business/taxation/vat/cross-border-vat/index_en.htm
Tax report template: https://info.portaldasfinancas.gov.pt/pt/apoio_contribuinte/modelos_formularios/iva/Documents/declaracao_periodica_IVA.pdf
Information on how to complete the tax report: https://www.occ.pt/news/_manual/ColecaoIVA2019.pdf

Task id 2755518

closes odoo/odoo#87572

Signed-off-by: Laurent Smet <las@odoo.com>
2022-11-29 09:32:43 +01:00

21 lines
887 B
Python

from odoo import models
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
def _get_account_vals(self, company, account_template, code_acc, tax_template_ref):
vals = super()._get_account_vals(company, account_template, code_acc, tax_template_ref)
vals['l10n_pt_taxonomy_code'] = account_template.l10n_pt_taxonomy_code
return vals
def _create_bank_journals(self, company, acc_template_ref):
journals = super()._create_bank_journals(company, acc_template_ref)
if company.account_fiscal_country_id.code == 'PT':
for journal in journals:
if journal.type == 'cash':
journal.default_account_id.l10n_pt_taxonomy_code = 1
elif journal.type == 'bank':
journal.default_account_id.l10n_pt_taxonomy_code = 2
return journals