Update Dominican withholding catalog

Apply the Article 309 rates introduced by Law 30-26 with dated historical templates and rules. Complete tax-code reversals, improve English terminology, harden migrations, and expand structural and functional tests.
This commit is contained in:
José Arturo García
2026-08-10 09:10:05 -04:00
parent e646947a6e
commit 1583dd3387
16 changed files with 765 additions and 154 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ from sql import Table
from trytond.pool import PoolMeta
from trytond.transaction import Transaction
LEGACY_OBSOLETE_IDS = {
LEGACY_OBSOLETE_IDS = frozenset({
'do_tax_itbis_8_compra', 'do_tax_itbis_8_venta',
'do_tax_itbis_9_compra', 'do_tax_itbis_9_venta',
'do_tax_ret_itbis_2_adq',
@@ -23,9 +23,9 @@ LEGACY_OBSOLETE_IDS = {
'do_trline_cust_card_acquirer',
'do_trline_cust_itbis8', 'do_trline_cust_itbis9',
'do_trline_supp_itbis8', 'do_trline_supp_itbis9',
}
})
LOCALIZATION_MODELS = {
LOCALIZATION_MODELS = frozenset({
'account.account.template',
'account.account.type.template',
'account.tax.code.line.template',
@@ -34,7 +34,7 @@ LOCALIZATION_MODELS = {
'account.tax.rule.line.template',
'account.tax.rule.template',
'account.tax.template',
}
})
class ModelData(metaclass=PoolMeta):
@@ -58,7 +58,7 @@ class ModelData(metaclass=PoolMeta):
cursor.execute(*table.select(
table.id, table.fs_id,
where=(table.module == 'account_do')
& table.model.in_(tuple(LOCALIZATION_MODELS))))
& table.model.in_(tuple(sorted(LOCALIZATION_MODELS)))))
obsolete = []
for record_id, fs_id in cursor.fetchall():
if fs_id in LEGACY_OBSOLETE_IDS: