Monday, February 27, 2023
1 change
Resolved issues and error corrections
The Mexican localization now sets the correct fiscal regime based on whether a partner is Mexican or foreign. This prevents foreign customers from being assigned an invalid default and lets users review or adjust the value directly.
Original PR description
The Mexican localization has a custom field for the fiscal regime. Currently this field is only shown for Mexican partners and defaulting to `601` (General de Ley Personas Morales). Foreign partners can legally only have the regime `616` (Sin obligaciones fiscales). Since we default to `601` and the field is not shown for foreign partners, the field is always incorrect. This fix computes the field depending on whether the partner is Mexican or not and also allows the user to change it manually. The field is shown for all partners now, so foreign partners can get the correct fiscal regime. An upgrade script has also been added to automatically set all foreign customers to regime `616`. task-3143841 Related: https://github.com/odoo/odoo/pull/111230 Related: https://github.com/odoo/upgrade/pull/4277