=== modified file 'account_management/model/account_company.py' --- account_management/model/account_company.py 2012-03-05 19:58:31 +0000 +++ account_management/model/account_company.py 2012-05-03 19:22:21 +0000 @@ -370,10 +370,10 @@ raise osv.except_osv('ADVERTENCIA', note) if level is None: scope = 1 - vals['code'] = str(self._get_number(cr, uid, parent_brw,scope)) + vals['code'] = str(self._get_number(cr, uid, parent_brw,scope,context)) else: scope = pattern[level+1] - pattern[level] - vals['code'] = parent_code + str(self._get_number(cr, uid, parent_brw,scope)).rjust(scope, '0') + vals['code'] = parent_code + str(self._get_number(cr, uid, parent_brw,scope,context)).rjust(scope, '0') return vals === modified file 'account_management/model/account_partner.py' --- account_management/model/account_partner.py 2012-03-05 19:58:31 +0000 +++ account_management/model/account_partner.py 2012-05-03 19:25:13 +0000 @@ -163,13 +163,13 @@ return u'%s %s'%(code, name) def create(self, cr, uid, vals, context=None): - self._check(cr, uid, vals) + self._check(cr, uid, vals,context) return super(res_partner_account, self).create(cr, uid, vals, context) def write(self, cr, uid, ids, vals, context=None): if not vals.get('company_id',False): vals.update({'company_id':self.browse(cr, uid, ids[0],context=context).company_id.id}) - self._check(cr, uid, vals) + self._check(cr, uid, vals,context) return super(res_partner_account, self).write(cr, uid, ids, vals, context) def _get_account(self, cr, uid, kind_id, account_name, do_account=False, account_id=None, do_write=False, context=None): @@ -194,7 +194,7 @@ 'active': True, 'reconcile': True, 'parent_id':parent_id, - }) + },context) return account_id else: @@ -398,7 +398,7 @@ previous_accounts={} if context.get('previous_accounts',False): previous_accounts=context['previous_accounts'] - + rpa = self.pool.get('res.partner.account') if self._check_unique(cr,uid,ids,k,vals,context=context): @@ -406,10 +406,10 @@ parent_id = getattr(rpa_brw,'property_account_partner').id parent_name = getattr(rpa_brw,'property_account_partner').name name = str(u'%s - %s'%(parent_name.decode('utf-8').upper(), vals['name'].decode('utf-8').upper())).encode('utf-8') - self.pool.get('account.account').write(cr,uid,[previous_accounts[__ACC__[k][0]]],{'parent_id':parent_id,'auto':True,'name':name}) + self.pool.get('account.account').write(cr,uid,[previous_accounts[__ACC__[k][0]]],{'parent_id':parent_id,'auto':True,'name':name},context) vals[__ACC__[k][0]]=previous_accounts[__ACC__[k][0]] else: - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) self._switch_accounts(cr,uid,ids,k,vals,context=context) self._unlink_account(cr,uid,ids,k,vals,context=context) @@ -430,17 +430,17 @@ if previous_accounts.get(__ACC__[k][1],False) == vals.get(__ACC__[k][1],False): if not previous_accounts.get(__ACC__[k][0],False) and not vals.get(__ACC__[k][0],False): - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) elif not previous_accounts.get(__ACC__[k][0],False) and vals.get(__ACC__[k][0],False): - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) elif previous_accounts.get(__ACC__[k][0],False) != vals.get(__ACC__[k][0],False): if self._check_unique(cr,uid,ids,k,vals,context=context): vals[__ACC__[k][0]]=previous_accounts[__ACC__[k][0]] else: - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) self._switch_accounts(cr,uid,ids,k,vals,context=context) self._unlink_account(cr,uid,ids,k,vals,context=context) @@ -448,7 +448,7 @@ if self._check_unique(cr,uid,ids,k,vals,context=context): vals[__ACC__[k][0]]=previous_accounts[__ACC__[k][0]] else: - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) self._switch_accounts(cr,uid,ids,k,vals,context=context) self._unlink_account(cr,uid,ids,k,vals,context=context) @@ -458,10 +458,10 @@ else: if not previous_accounts.get(__ACC__[k][0],False) and not vals.get(__ACC__[k][0],False): - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) elif not previous_accounts.get(__ACC__[k][0],False) and vals.get(__ACC__[k][0],False): - vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k]) + vals[__ACC__[k][0]] = rpa._get_account(cr, uid, vals.get(__ACC__[k][1],False), vals['name'], vals[k],context=context) elif previous_accounts.get(__ACC__[k][0],False) != vals.get(__ACC__[k][0],False): vals = self._assign_account(cr,uid,ids,k,vals,context=context) @@ -559,7 +559,7 @@ def _update_code(self, cr, uid,ids,vals, context=None): if context is None: context={} - + for k in __ACC__: vals = self._comparison(cr, uid,ids,k,vals,context=context) return vals