Hi,
I'm using odoo 12 and I have a model called "shift", this shift is related to user (user_id), and has a selection field called status with options: (open, closed)
i want to ensure that user can't open 2 shifts at the same time
he can have a lot of closed shifts but if he has one open shift he can't open another one
anyone can help me with creating the constraint and i'll be thankful