From 048f33a7029377732aef0386d8821698045f6289 Mon Sep 17 00:00:00 2001 From: braisab Date: Wed, 27 Mar 2024 12:37:10 +0100 Subject: [PATCH] [FIX]14.0-pms_l10n_es: update vat code country constrain uses document country instead of country --- pms_l10n_es/data/pms_data.xml | 25 ++++++++++++++++++++++--- pms_l10n_es/models/res_partner.py | 19 ++++++++++--------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/pms_l10n_es/data/pms_data.xml b/pms_l10n_es/data/pms_data.xml index 0b3e7ae23b..f3da5287b7 100644 --- a/pms_l10n_es/data/pms_data.xml +++ b/pms_l10n_es/data/pms_data.xml @@ -4,6 +4,7 @@ DNI D + 10 letters = { 0: "T", @@ -43,6 +44,24 @@ else: + + Spanish Residence permit + N + 30 + + +permit_first_letter=id_number.name[0:1] +permit_last_letter = id_number.name[ + len(id_number.name) - 1 : len(id_number.name) +] +if (permit_first_letter.upper() in ['X','Y']) and id_number.name[1:8].isdigit() and not permit_last_letter.isdigit(): + failed = False +else: + failed = True + + + + @@ -51,9 +70,9 @@ else: 02 + id="pms_l10n_es.document_type_spanish_residence" + model="res.partner.id_category" + > 05