summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Biersbach <cbi@openerp.com>2013-03-14 10:20:17 +0100
committerChris Biersbach <cbi@openerp.com>2013-03-14 10:20:17 +0100
commit6b80f5bdffd2c0789983c97fc874bad540eaef4b (patch)
tree0bd28b9951c546935ffbd8da7c636297bb7e09b2
parentab76b7a67f9042c90abc292f9f3bb00eae33e066 (diff)
[FIX] orm: moves the access_rule check to the end of the create method to avoid getting errors when trying to create and m2m values are passed, which can cause the rules to fail
bzr revid: cbi@openerp.com-20130314092017-agwzvwwbxev531kk
-rw-r--r--openerp/osv/orm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index 8a432240567..61f1a83c040 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -4432,7 +4432,6 @@ class BaseModel(object):
upd1 += ",%s,(now() at time zone 'UTC'),%s,(now() at time zone 'UTC')"
upd2.extend((user, user))
cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
- self.check_access_rule(cr, user, [id_new], 'create', context=context)
upd_todo.sort(lambda x, y: self._columns[x].priority-self._columns[y].priority)
if self._parent_store and not context.get('defer_parent_store_computation'):
@@ -4485,6 +4484,7 @@ class BaseModel(object):
self.name_get(cr, user, [id_new], context=context)[0][1] + \
"' " + _("created.")
self.log(cr, user, id_new, message, True, context=context)
+ self.check_access_rule(cr, user, [id_new], 'create', context=context)
self._workflow_trigger(cr, user, [id_new], 'trg_create', context=context)
return id_new