From e73c5a1c08365ee4e5cc32b2e940c3cba1471f28 Mon Sep 17 00:00:00 2001 From: Alnus Tmp Date: Fri, 20 Nov 2020 19:30:42 -0500 Subject: [PATCH] subdivision_municipalit required --- party.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/party.py b/party.py index 16873b2..0c9f74b 100644 --- a/party.py +++ b/party.py @@ -276,8 +276,6 @@ class PartyIdentifier(ModelSQL, ModelView): @fields.depends('type', 'party', 'code', 'rut') def check_code(self): - #if self.code.isdigit() is not True: - #raise UserError(str('33333')) super(PartyIdentifier, self).check_code() tax_identifiers = ['12', '13', '31'] @@ -304,11 +302,7 @@ class PartyIdentifier(ModelSQL, ModelView): raise PartyIdentifierError( gettext('account_co_co.msg_invalid_vat', code=self.code)) - #raise UserError(str('sdfsd')) - #self.raise_user_error('invalid_vat', { - #'code': self.code, - #'party': party, - #}) + if self.type in tax_identifiers and not self.code.isdigit(): if self.party and self.party.id > 0: party = self.party.rec_name @@ -317,11 +311,7 @@ class PartyIdentifier(ModelSQL, ModelView): raise PartyIdentifierError( gettext('account_co_co.msg_invalid_vat', code=self.code)) - #self.raise_user_error('invalid_vat',{ - #code=self.code, - #'party':party - #}) - + @staticmethod def default_type_document(): return '13' @@ -371,6 +361,7 @@ class Address(ModelSQL, ModelView): ('type', '=', 'municipality') ], depends=['country', 'subdivision', 'city'], + required=True )