I've made a workflow that automatically assigns a partner to a corresponding company through the partner's ZIP.
My companies are something like these:
---- Company 1
---- Company 2
When I create a new partner with an user from Company 1 but that has to be assigned to Company 2, it gives me an error because user from Company 1 has no permissions with Company 2... I still wanna keep that user from Company 1 can't see Company 2 partners, but I want this automatic assigment working...
Is it possible that a record rule can be applied globally but not to some groups?
Answer 1: I wouldn't do it using workflow. What you can do is to inherit the create and/or write method of res.partner, capture the change of zip there, and assign company_id based on your rule. You can use SUPERUSER_ID (from openerp import SUPERUSER_ID and used it very sparingly) to overcome all record rules.
Answer 2: Yes, if you leave the group blank in a record rule, it will apply globally.
About This Community
|Asked: 1/21/15, 5:13 AM|
|Seen: 270 times|
|Last updated: 3/16/15, 8:10 AM|