I am customizing accounts module.
I want to make sure that an item is not added multiple times on an invoice(account.invoice.line).
From this question, https://www.odoo.com/forum/help-1/question/how-to-make-a-unique-field-in-a-module-16386, i came out with a solutions which does not work and dont know why.
_name = "account.invoice.line"
_inherit = "account.invoice.line"
#other code
_sql_constraints = [
('unique_product', 'unique(id, product_id)', 'Cannot Use one tracker twice!\nPlease, select a different product')
]
It still allows me to add same product twice.
Please, where am i going wrong?
Thanks for your reply