In a demo instance previous to production release, I created an automated action to avoid VAT duplication and got a message where Warning is not recognized in the execution phase!!! There is no message of a syntaxis error. Next the code:
if record.vat:
contact = env ['res.partner'].search([['vat','=',record.vat]])
if contact:
for c in contact:
if c.id != record.id:
raise Warning ('VAT is duplicated, change it pls')
Any idea to solve this problem? This was working properly before the last version update
It worked!!! Thank you very very very very much!!!
what would be the code to avoid creating contact with same email?