Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

[v9]How to set up a constraint for the full record

By
Mind And Go
on 4/4/16, 12:16 PM 219 views

Hi,

I would like to apply a constraint on specific fields whatever the fileds that are modified.
For example I would like to check that field 'my_field' is checked whatever the filed that is changed :

@api.one
@api.constrains('write_date', 'create_date', 'my_field')
def my_constraints(self):
.../... Blabla raise ValdiationError

This part works well if my_field is modified, yet it's not thrown if another field is changed.
So the constraints does not apply each time you validate a record.
How is it possible to do so?

Do I need to override the write method?

regards

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/4/16, 12:16 PM
Seen: 219 times
Last updated: 4/4/16, 12:16 PM