Hello,
when i edit/change a sql_contraint in my module in will not update the contraint in the Database.
What is the best way to update in sql_contraint in Odoo 15 without deleting and reinstall the module?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
when i edit/change a sql_contraint in my module in will not update the contraint in the Database.
What is the best way to update in sql_contraint in Odoo 15 without deleting and reinstall the module?
Thanks
Hi,
By keeping the same name, you can modify existing SQL constrains via custom modules.
For example, if you need to change below constrain
_sql_constraints = [
('positive_color', 'CHECK(color >= 0)', 'The color code must be positive!')
]
In your custom module,
_sql_constraints = [
('positive_color', 'CHECK(color > 0)', 'The color code must be greater than zero!')
]
Thanks
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up