[IMP] base: if company_ids is empty, it will be set with deafult value on user creation
bzr revid: hmo@tinyerp.com-20101011132252-wcej9vlsb6582w5x
This commit is contained in:
parent
f9eb2e0260
commit
e232dd6638
|
@ -350,6 +350,12 @@ class users(osv.osv):
|
|||
# User can write to a few of her own fields (but not her groups for example)
|
||||
SELF_WRITEABLE_FIELDS = ['menu_tips','view', 'password', 'signature', 'action_id', 'company_id', 'user_email']
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if (not vals.get('company_ids',[])):
|
||||
company_ids = self._get_companies(cr, uid, context=context)
|
||||
if company_ids and len(company_ids): vals['company_ids'] = [(6, 0, company_ids)]
|
||||
return super(users, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, values, context=None):
|
||||
if not hasattr(ids, '__iter__'):
|
||||
ids = [ids]
|
||||
|
|
Loading…
Reference in New Issue