ir_rule should apply to the result of a Model.write() in some cases
Bug #1070884 reported by
Stefan Rijnhart (Opener)
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP's Framework R&D | ||
Therp Backports (Deprecated) |
In Progress
|
Low
|
Stefan Rijnhart (Opener) |
Bug Description
Currently in OpenERP 6.1 and trunk the record rules are applied at write time only before the resource is written. This is inconsistent with creating resources, as in that case the record rules are applied at the results.
For instance, we have applied a record rule that restricts HR officers from writing their own record (or their contracts). Under the current behaviour, they can still create a new employee with their own user associated with it (but they cannot delete it).
I think that the rule should apply to the resources before modification as well as after the modification.
Related branches
lp://staging/~therp-nl/openobject-server/trunk-lp1070884-apply_rule_after_write
On hold
for merging
into
lp://staging/openobject-server
- OpenERP Core Team: Pending requested
-
Diff: 10 lines (+1/-0)1 file modifiedopenerp/osv/orm.py (+1/-0)
lp://staging/~therp-nl/therp-backports/server-6.1-lp1070884-apply_rule_after_write
On hold
for merging
into
lp://staging/therp-backports/server-6.1
- Holger Brunn (Therp): Disapprove
- Olivier Dony (Odoo) (community): Disapprove (functional)
-
Diff: 11 lines (+1/-0)1 file modifiedopenerp/osv/orm.py (+1/-0)
Changed in openobject-server: | |
status: | New → Fix Committed |
Changed in therp-backports: | |
status: | New → Fix Committed |
importance: | Undecided → Low |
assignee: | nobody → Stefan Rijnhart (Therp) (stefan-therp) |
milestone: | none → 6.1-maintenance |
Changed in therp-backports: | |
milestone: | 6.1-maintenance → 7.0-maintenance |
Changed in therp-backports: | |
status: | Fix Committed → In Progress |
To post a comment you must log in.
There is a particular use case worth considering here: rules that restrict writing based on records 'state'.
With this type of rules in place, the user would be unable to change a record from a state with write access to the next state, where he only only have read access.