|
@ -18,11 +18,10 @@ |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
# |
|
|
# |
|
|
############################################################################## |
|
|
############################################################################## |
|
|
import logging |
|
|
|
|
|
from openerp.osv.orm import Model |
|
|
from openerp.osv.orm import Model |
|
|
from openerp.osv import fields |
|
|
|
|
|
from openerp import pooler, SUPERUSER_ID |
|
|
from openerp import pooler, SUPERUSER_ID |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class res_users(Model): |
|
|
class res_users(Model): |
|
|
_inherit = 'res.users' |
|
|
_inherit = 'res.users' |
|
|
|
|
|
|
|
@ -41,13 +40,15 @@ class res_users(Model): |
|
|
groups_obj = pool.get('res.groups') |
|
|
groups_obj = pool.get('res.groups') |
|
|
user.write( |
|
|
user.write( |
|
|
{ |
|
|
{ |
|
|
'groups_id': [(4, dynamic_group.id) |
|
|
|
|
|
|
|
|
'groups_id': [ |
|
|
|
|
|
(4, dynamic_group.id) |
|
|
if dynamic_group.eval_dynamic_group_condition() |
|
|
if dynamic_group.eval_dynamic_group_condition() |
|
|
else (3, dynamic_group.id) |
|
|
else (3, dynamic_group.id) |
|
|
for dynamic_group in groups_obj.browse( |
|
|
for dynamic_group in groups_obj.browse( |
|
|
cr, uid, |
|
|
cr, uid, |
|
|
groups_obj.search(cr, uid, |
|
|
groups_obj.search(cr, uid, |
|
|
[('is_dynamic', '=', True)]))] |
|
|
|
|
|
|
|
|
[('is_dynamic', '=', True)])) |
|
|
|
|
|
], |
|
|
}) |
|
|
}) |
|
|
cr.commit() |
|
|
cr.commit() |
|
|
cr.close() |
|
|
cr.close() |