summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-02-13 18:51:55 +0100
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-02-13 18:51:55 +0100
commitcad3d17c2cd0eb52150ea555fa2ce220be124a2d (patch)
tree78cdc60c6211d21472b5d2417ca36632861b6398
parentfdc7eee9b37f040c64d1a2cc96ef8e142423708e (diff)
parentdba6e07ecdf8ed61316bdc1f4c4af36e489a95be (diff)
[MERGE] fix of bug 1084819
lp bug: https://launchpad.net/bugs/1084819 fixed bzr revid: qdp-launchpad@openerp.com-20130213175155-sicmreihpw8qviie
-rw-r--r--addons/account/account_invoice.py7
1 files changed, 6 insertions, 1 deletions
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 = {