Hi All.
Refer to the picture attached. In CRM i have a custom field "Customer PO" (x_po).
Ones a user has entered the number to the field again this customer. For ex: PO123 against Vodafone Fiji. I don't want any other user to same number for this customer.
However PO123 can be used against all customers but against same customer it should be only used ones and of anyone enters same number then it should give error upon saving.
Can someone help me in writing a automated action.
Thanks
Rishal
Perhaps, this module - https://apps.odoo.com/apps/modules/16.0/crm_duplicates/ - will be useful to your goals
Great Team Thank you all for your feedback. I tried this rule and it worked.
existing_records = env['crm.lead'].search_count([('x_po', '=', record.x_po) , ('partner_id', '=', record.partner_id.id)])
if existing_records > 1:
raise Warning("PO alreay processed.")
Thanks