I have this odoo py
class CrmProject(models.Model):
_name='crm.project'
customer_id = fields.Many2one('res.partner','Customer')
project_product_id = fields.Many2one('crm.project.product','Project Product')
how to validate and show a warning when the customer_id and project_product_id are inputted together with the same value as the one in the crm.project database? so it must be checked with the database first then show warning if it have the same value with the one in customer_id AND project_product_id input.
For example:
Database table crm.project
customer_id = 1
project_product_id = 2
Will create warning ONLY if input:
customer_id = 1
project_product_id = 2
Beside that no warning will be create
I have tried this but no warning created:
Any help will be grateful