Daily updates from Odoo
Friday, March 15, 2024
2 changes
Resolved issues and error corrections
This update fixes critical issues when importing Mexican invoices (CFDI) with unknown customers. The system now correctly identifies whether customers are domestic or foreign, properly sets required fields like country and zip code, and prevents incorrect "CFDI to public" settings. This ensures invoices are processed accurately and comply with Mexican tax requirements.
Original PR description
<strike> ## [FIX] l10n_mx_edi: Set "CFDI to public" to true for foreign invoices The field "CFDI to public" is currently only set to true in the domestic to public case (special VAT / Rfc value…
<strike>
## [FIX] l10n_mx_edi: Set "CFDI to public" to true for foreign invoices
The field "CFDI to public" is currently only set to true in
the domestic to public case (special VAT / Rfc value XAXX010101000).
After this commit "CFDI to public" will also be set to true in the
XEXX010101000 case.
related: task-3731058
</strike>
A part of the original PR was reverted before this PR was merged.
That part was left out in this FW port.
Reverting PR: https://github.com/odoo/enterprise/pull/58697
## [FIX] l10n_mx_edi: import: fix partner creation and detection logic
There are currently the following problems when importing an invoice
with an unknown partner. A new partner is created in this case.
For invoices with an unknown domestic partner (no special VAT values):
- (1) There may be a VAT validation error.
- (2) The "CFDI to public" field (l10n_mx_edi_cfdi_to_public) on the
invoice will be set to True. It should be False.
For invoices with an unknown foreign partner (no special VAT values):
- (3) The partner is created w/o country or VAT value (since only
the special VAT / Rfc value XEXX010101000 is used).
Thus the detection logic applied to the partner to decide
whether we are in the domestic non-public, domestic public or
foreign case does not work correctly.
The issues are solved after this commit by the following changes
- (A) The country is set to Mexico for all created partners that are not
from a foreign invoice (XEXX010101000).
- (B) The detection logic to decide the case is updated.
Also see (C).
- (C) The "Foreign Customers" fiscal position is set for partners
created during the import of foreign invoices.
Note on (B) / (C):
We still want to assume that partners without a country are Mexican
partners. This is done since (many) Mexican users will not set an
explicit country for Mexican customers.
(One would e.g. not put the country for domestic letters either.)
This is why we use the "Foreign Customers" fiscal position (C).
### Details
(1)
Due to the missing country the wrong VAT validation is used.
The same error can be reproduced on a runbot when creating a new
customer without country and VAT DEA040805DZ4
(works after setting the country to Mexico).
(2) / (3)
Due to the missing country on the partner the invoice is wrongly
interpreted as a domestic invoice to public (XAXX010101000).
This leads to the wrong "CFDI to public" value.
### task
task-3731058
Forward-Port-Of: odoo/enterprise#57516This update brings Portuguese Balance Sheet and Profit & Loss reports into compliance with the official general regime regulations. The financial statements now correctly align with the Portuguese accounting standards (SNC 2016), ensuring that companies using Odoo in Portugal will generate accurate regulatory reports that match government requirements.
Original PR description
In Portugal, there are four regimes of regulations, which include a CoA and financial statements: general regime, small companies, micro-companies and non-profits. Regulations are published at https://www.cnc.min-financas.pt/snc2016.html As a result of the refactor in https://github.com/odoo/odoo/pull/87572, the CoA (almost) perfectly follows the general regime regulation. However, the financial reports are not up-to-date. This commit implements the Portuguese Balance Sheet and Profit and Loss for companies under the general regime, as defined at pp.42-45, 53-55 of https://www.occ.pt/fotos/editor2/manualapoiosaf-t_1.pdf. The correspondence between account 'Taxonomy Codes' and account codes was taken from https://www.occ.pt/fotos/editor2/taxonomiasplanocontas_fev2019.pdf. Community PR: https://github.com/odoo/odoo/pull/157131 taskid:3060790 Forward-Port-Of: odoo/enterprise#58387