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 )