Odoo Help


Record rule error when model inherits mail.thread

Martin Varela
on 11/13/15, 9:45 AM 504 views

We have a problem when a model inherits mail.thread.

The example is:

- Model named "order" than inherits "mail.thread"

- order has state field ('draft','done') with the property track_visibility on_change.

- a record rule for write with domain ('state','=','draft'). You can only update the order in draft state

The problem is that when the order is marked as 'done', the record rule is evaluated twice, one for changing the state to 'done' and the other when de mail.thread indicating the state change is created. In the second case the order is in state 'done' so the rule raises an error. 

To avoid the error in the rule we have to change de domain to ('state','in',['draft','done']), but then the rule has no use

¿Is this a bug?

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/13/15, 9:45 AM
Seen: 504 times
Last updated: 11/13/15, 9:45 AM