I'm working with odoo v11.
I need to bypass VAT number validation that is done by res.partner in module base_vat.
@api.constrains('vat', 'commercial_partner_country_id')
def check_vat(self):
...
I've done a new module with this python code:
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.constrains('vat', 'commercial_partner_country_id')
def check_vat(self):
return True
But it doesn't work as far original check_vat is still executed and not overwrited. I know I need to delete or bypass previous constraint_methods but I don't know how.
Any advice?
Hell Quim,
The way you overwrite the method is perfect.
PS - Just make sure you added this file in your __init__.py file. and also check whether module installed successfully !
Thanks,
Dipak