[FIX] account_anglo_saxon: fixed error due to bad commit in revision 5691: 'Variable not defined'. (shame on me)
bzr revid: qdp-launchpad@openerp.com-20111115150718-elelutfa5qvm5k21
This commit is contained in:
parent
7e9090fde7
commit
2502b18a1f
|
@ -28,13 +28,13 @@ class purchase_order(osv.osv):
|
|||
|
||||
def prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
|
||||
line = super(purchase_order, self).prepare_inv_line(cr, uid, account_id, order_line, context=context)
|
||||
if ol.product_id and not ol.product_id.type == 'service':
|
||||
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
|
||||
if order_line.product_id and not order_line.product_id.type == 'service':
|
||||
acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id
|
||||
if not oa:
|
||||
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
|
||||
if oa:
|
||||
fpos = ol.order_id.fiscal_position or False
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
|
||||
line.update({'account_id': a})
|
||||
acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id
|
||||
if acc_id:
|
||||
fpos = order_line.order_id.fiscal_position or False
|
||||
new_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id)
|
||||
line.update({'account_id': new_account_id})
|
||||
return line
|
||||
purchase_order()
|
||||
|
|
Loading…
Reference in New Issue