improving ir_sequence to rely on its own security rule instead of the company rule
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP's Framework R&D |
Bug Description
A few words of explanation: the merge for OPW case 10420 changed the code of ir.sequence to make it select all sequences that belong to companies that are visible to the user. This could be improved by having a default security rule on ir.sequence and use it to select the visible sequences (by default, all sequences of the currently visible companies: the current one and its children), instead of using the companies rules implicitly.
However the code change must be done very carefully, as we must not disrupt the logic of the SELECT FOR UPDATE NOWAIT, used to properly guard concurrent transactions.
See also the comments on the merge, as linked below.
-- original description --
Hello! Please give a look at my comment here https:/
Hi Leonardo,
I've updated the description to sum up what we discussed on the merge proposal, I hope it matches what you had in mind.
After further discussions, I think this change might be too big for stable, as it requires introducing a new ir.rule for ir.sequence, which does not exist now, and will absolutely require a data update - otherwise it will cause regressions in all existing multi-company setups which were not even affected by the original problem.
I suggest we keep the current behavior in 6.0, relying on the security rules of res.company when determining the sequences to use (in essence delegating the visibility of ir.sequence to res.company). It should not be a major problem for stable, provided that bug 809178 is fixed (I could not reproduce it, btw).
Then for 6.1, we can improve it as described above.
What do you think?