+ taxep=None
+ tax_obj = self.pool.get('account.tax')
+ if type in ('out_invoice', 'out_refund'):
+ taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False)
+ tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
+ else:
+ taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False)
+ tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
+ if type in ('in_invoice', 'in_refund'):
+ to_update = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
+ result.update(to_update)
+ else:
+ result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})
+
+ if not name:
+ result['name'] = res.name
+