hi,i have a form named "subject" for the student,,what i want is that user can not save duplicate or same subject name again and again,,for example if "english" is saved with its code it should not be saved again,,,how to do that??
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
2549
Views
Hi,
Use _sql_constraints
_sql_constraints = [
('name_uniq', 'UNIQUE (name)', 'You can not have two users with the same name !')
]
Thanks & Regards
Avinash N K
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up