Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
4714 Weergaven

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?

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
mrt. 15
5529
1
mrt. 15
13057
1
mrt. 15
6634
1
feb. 25
1502
2
dec. 24
2476