openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #05885
[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-768968-pso into lp:openobject-addons
Priyesh (Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-768968-pso into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #768968 in OpenERP Addons: "analytic_user_function KeyError: 'amount'"
https://bugs.launchpad.net/openobject-addons/+bug/768968
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-768968-pso/+merge/58951
Fixed 768968: (https://bugs.launchpad.net/openobject-addons/+bug/768968)
Fixed keyerror: 'amount' in analytic_user_function
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-768968-pso/+merge/58951
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-768968-pso.
=== modified file 'analytic_user_function/analytic_user_function.py'
--- analytic_user_function/analytic_user_function.py 2011-01-14 00:11:01 +0000
+++ analytic_user_function/analytic_user_function.py 2011-04-25 12:18:25 +0000
@@ -66,7 +66,7 @@
return False
- def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0):
+ def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0.0):
res = {}
if not (account_id):
#avoid a useless call to super
@@ -98,11 +98,11 @@
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
- amount_unit = self.on_change_unit_amount(cr, uid, ids,
- r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount']
-
- amount = unit_amount * amount_unit
- res ['value']['amount']= - round(amount, 2)
+ if unit_amount:
+ amount_unit = self.on_change_unit_amount(cr, uid, ids,
+ r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount']
+ amount = unit_amount * amount_unit
+ res ['value']['amount']= - round(amount, 2)
res ['value']['general_account_id']= a
return res
Follow ups