[FIX] account : Not Create Account form Account Templates
lp bug: https://launchpad.net/bugs/909014 fixed bzr revid: mdi@tinyerp.com-20111228094509-tsyuafffvk1rg8rq
This commit is contained in:
parent
76fa5eda36
commit
33802ab48b
|
@ -2443,7 +2443,7 @@ class account_account_template(osv.osv):
|
|||
_columns = {
|
||||
'name': fields.char('Name', size=256, required=True, select=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
|
||||
'code': fields.char('Code', size=64, select=1),
|
||||
'code': fields.char('Code', size=64, required=True, select=1),
|
||||
'type': fields.selection([
|
||||
('receivable','Receivable'),
|
||||
('payable','Payable'),
|
||||
|
@ -2592,7 +2592,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
|||
acc_obj = self.pool.get('account.account')
|
||||
tmpl_obj = self.pool.get('account.account.template')
|
||||
data = self.read(cr, uid, ids)
|
||||
company_id = acc_obj.read(cr, uid, [data[0]['cparent_id']], ['company_id'])[0]['company_id'][0]
|
||||
company_id = acc_obj.read(cr, uid, [data[0]['cparent_id']][0][0], ['company_id'])['company_id'][0]
|
||||
account_template = tmpl_obj.browse(cr, uid, context['tmpl_ids'])
|
||||
vals = {
|
||||
'name': account_template.name,
|
||||
|
@ -2603,7 +2603,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
|||
'reconcile': account_template.reconcile,
|
||||
'shortcut': account_template.shortcut,
|
||||
'note': account_template.note,
|
||||
'parent_id': data[0]['cparent_id'],
|
||||
'parent_id': data[0]['cparent_id'][0],
|
||||
'company_id': company_id,
|
||||
}
|
||||
acc_obj.create(cr, uid, vals)
|
||||
|
|
Loading…
Reference in New Issue