Skip to content
Advertisement

Using an _sql_constraints in Odoo 12 date

Hi I created the following model:

However I cannot get the _sql_constraints to work:

I’m trying to get it so that each person can log only one prescription per Date_entered. Would greatly appreciate any help. 🙂

Advertisement

Answer

Odoo will not be able to add the constraint because of a psycopg2.ProgrammingError

column “date_entered” named in key does not exist

You just need to rename it to date_entered and update the module.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement