Skip to content

Commit

Permalink
[IMP] l10n_mx_res_partner_csf_regime: save the last fiscal regime
Browse files Browse the repository at this point in the history
  • Loading branch information
SMaciasOSI committed Oct 30, 2023
1 parent f7f905f commit 1116636
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions l10n_mx_res_partner_csf_regime/wizard/import_csf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"Régimen de Incorporación Fiscal": "621",
"Régimen de las Actividades Empresariales "
"con ingresos a través de Plataformas Tecnológicas": "625",
"Régimen de las Actividades Empresariales "
"con ingresos a través de Plataformas Tecnológicas.": "625",
"Régimen Simplificado de Confianza": "626",
}

Expand All @@ -21,11 +23,9 @@ def prepare_res_partner_values(self, text):
vals = super().prepare_res_partner_values(text)
split_data = text.split("\n")
fiscal_regime = ""
for index, line in enumerate(split_data):
if "Regímenes" in line:
fiscal_regime += split_data[index + 2].strip()
if fiscal_regime == "Régimen":
fiscal_regime = split_data[index + 3].strip()
for index, _line in enumerate(split_data):
if split_data[index].strip() in FISCAL_REGIMES_MAPPING.keys():
fiscal_regime = split_data[index].strip()
fiscal_regime = FISCAL_REGIMES_MAPPING[fiscal_regime]
vals.update(
{
Expand Down

0 comments on commit 1116636

Please sign in to comment.