[IMP] l10n_ro: Minor changes for l10n_ro_saft

For the l10n_ro_saft module that generates the D.406 declaration, we
needed to:
- create a new export tax specifically for services (which should be
  reported separately from goods); and
- make sure the Bank, Outstanding Receipts and Outstanding Payments
  accounts are created with codes 5121xx, and the Cash account with code
  5311xx, because codes 5120 and 5130 are not available in the official
  CoA and were therefore causing validation errors in the SAF-T export.
- because the CUI number (found in the company_registry field) for
  partners is required for the SAF-T export, and it is substantially
  the same as the VAT number, re-use logic from l10n_be to automatically
  fill in the company_registry if the VAT exists.

closes odoo/odoo#132269

Task-id: 3172198
X-original-commit: 74be0779164f8cd65c399977d5f3e058c213318d
Related: odoo/enterprise#45939
Related: odoo/documentation#5532
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
This commit is contained in:
Antoine Dupuis (andu)
2023-08-21 19:57:11 +02:00
parent 1bceb01ff4
commit bfaccfcdae
4 changed files with 24 additions and 7 deletions
@@ -117,10 +117,10 @@
"","","","","","","","tvac_05","tvati_extra",""
"","","","","","","","tvac_09","tvati_extra",""
"","","","","","","","tvac_19","tvati_extra",""
"","","","","","","","tvac_00_s","tvati_extra",""
"","","","","","","","tvac_05_s","tvati_extra",""
"","","","","","","","tvac_09_s","tvati_extra",""
"","","","","","","","tvac_19_s","tvati_extra",""
"","","","","","","","tvac_00_s","tvati_extras",""
"","","","","","","","tvac_05_s","tvati_extras",""
"","","","","","","","tvac_09_s","tvati_extras",""
"","","","","","","","tvac_19_s","tvati_extras",""
"","","","","","","","tvad_00","tvati_extrap0b",""
"","","","","","","","tvad_05","tvati_extrap0b",""
"","","","","","","","tvad_09","tvati_extrap0b",""
1 id name country_id auto_apply vat_required sequence country_group_id tax_ids/tax_src_id tax_ids/tax_dest_id name@ro
117 tvac_05 tvati_extra
118 tvac_09 tvati_extra
119 tvac_19 tvati_extra
120 tvac_00_s tvati_extra tvati_extras
121 tvac_05_s tvati_extra tvati_extras
122 tvac_09_s tvati_extra tvati_extras
123 tvac_19_s tvati_extra tvati_extras
124 tvad_00 tvati_extrap0b
125 tvad_05 tvati_extrap0b
126 tvad_09 tvati_extrap0b
@@ -153,7 +153,11 @@
"","","","","","","","","","","","tax","invoice","","","",""
"","","","","","","","","","","","base","refund","-03 - TAX BASE","","",""
"","","","","","","","","","","","tax","refund","","","",""
"tvati_extra","35","VAT Exportation","","0% EX","0.0","percent","sale","tax_group_tva_scutit","","","base","invoice","+14 - TAX BASE","","","TVA Export"
"tvati_extra","35","VAT Exportation Goods","","0% EX G","0.0","percent","sale","tax_group_tva_scutit","","","base","invoice","+14 - TAX BASE","","","TVA Export Bunuri"
"","","","","","","","","","","","tax","invoice","","","",""
"","","","","","","","","","","","base","refund","-14 - TAX BASE","","",""
"","","","","","","","","","","","tax","refund","","","",""
"tvati_extras","35","VAT Exportation Services","","0% EX S","0.0","percent","sale","tax_group_tva_scutit","","","base","invoice","+14 - TAX BASE","","","TVA Export Servicii"
"","","","","","","","","","","","tax","invoice","","","",""
"","","","","","","","","","","","base","refund","-14 - TAX BASE","","",""
"","","","","","","","","","","","tax","refund","","","",""
1 id sequence description invoice_label name amount amount_type type_tax_use tax_group_id tax_exigibility cash_basis_transition_account_id repartition_line_ids/repartition_type repartition_line_ids/document_type repartition_line_ids/tag_ids repartition_line_ids/account_id repartition_line_ids/factor_percent description@ro
153 tax invoice
154 base refund -03 - TAX BASE
155 tax refund
156 tvati_extra 35 VAT Exportation VAT Exportation Goods 0% EX 0% EX G 0.0 percent sale tax_group_tva_scutit base invoice +14 - TAX BASE TVA Export TVA Export Bunuri
157 tax invoice
158 base refund -14 - TAX BASE
159 tax refund
160 tvati_extras 35 VAT Exportation Services 0% EX S 0.0 percent sale tax_group_tva_scutit base invoice +14 - TAX BASE TVA Export Servicii
161 tax invoice
162 base refund -14 - TAX BASE
163 tax refund
+13
View File
@@ -18,3 +18,16 @@ class ResPartner(models.Model):
return super(ResPartner, self)._commercial_fields() + ['nrc']
nrc = fields.Char(string='NRC', help='Registration number at the Registry of Commerce')
@api.depends('vat', 'country_id')
def _compute_company_registry(self):
# OVERRIDE
# In Romania, if you have a VAT number, it's also your company registry (CUI) number
super()._compute_company_registry()
for partner in self.filtered(lambda p: p.country_id.code == 'RO' and p.vat):
vat_country, vat_number = self._split_vat(partner.vat)
if vat_country.isnumeric():
vat_country = 'ro'
vat_number = partner.vat
if vat_country == 'ro' and self.simple_vat_check(vat_country, vat_number):
partner.company_registry = vat_number
+2 -2
View File
@@ -22,8 +22,8 @@ class AccountChartTemplate(models.AbstractModel):
return {
self.env.company.id: {
'account_fiscal_country_id': 'base.ro',
'bank_account_code_prefix': '512',
'cash_account_code_prefix': '531',
'bank_account_code_prefix': '5121',
'cash_account_code_prefix': '5311',
'transfer_account_code_prefix': '581',
'account_default_pos_receivable_account_id': 'ro_pcg_recv',
'income_currency_exchange_account_id': 'pcg_7651',