[IMP] l10n_co: remove unused field

Followup of 
https://github.com/odoo/odoo/commit/b44f559fe7577afdaa83511bdf0b6ca47ffeb8b7

closes odoo/odoo#50862

Related: odoo/upgrade#1164
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
Victor Feyens
2020-05-07 13:12:01 +00:00
parent 5c0b431baf
commit e8ca97273b
2 changed files with 0 additions and 33 deletions
-30
View File
@@ -17,36 +17,6 @@ class ResPartner(models.Model):
('civil_registration', 'Registro Civil'),
('national_citizen_id', 'Cédula de ciudadanía')], string='Document Type',
help='Indicates to what document the information in here belongs to.')
l10n_co_verification_code = fields.Char(compute='_compute_verification_code', string='VC', # todo remove this field in master
help='Redundancy check to verify the vat number has been typed in correctly.')
@api.depends('vat')
def _compute_verification_code(self):
multiplication_factors = [71, 67, 59, 53, 47, 43, 41, 37, 29, 23, 19, 17, 13, 7, 3]
for partner in self:
if partner.vat and partner.country_id == self.env.ref('base.co') and len(partner.vat) <= len(multiplication_factors):
number = 0
padded_vat = partner.vat
while len(padded_vat) < len(multiplication_factors):
padded_vat = '0' + padded_vat
# if there is a single non-integer in vat the verification code should be False
try:
for index, vat_number in enumerate(padded_vat):
number += int(vat_number) * multiplication_factors[index]
number %= 11
if number < 2:
partner.l10n_co_verification_code = number
else:
partner.l10n_co_verification_code = 11 - number
except ValueError:
partner.l10n_co_verification_code = False
else:
partner.l10n_co_verification_code = False
@api.constrains('vat', 'country_id', 'l10n_co_document_type')
def check_vat(self):
-3
View File
@@ -8,9 +8,6 @@
<field name="vat" position="before">
<field name="l10n_co_document_type"/>
</field>
<field name="vat" position="after">
<field name="l10n_co_verification_code" invisible="1"/>
</field>
</field>
</record>
</odoo>