diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 250a0446534..2c59fe26bf0 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1394,7 +1394,12 @@ class account_invoice_line(osv.osv): # XXX this gets the default account for the user's company, # it should get the default account for the invoice's company # however, the invoice's company does not reach this point - prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) + if context is None: + context = {} + if context.get('type') in ('out_invoice','out_refund'): + prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) + else: + prop = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category', context=context) return prop and prop.id or False _defaults = {