diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2011-06-16 17:07:31 +0200 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2011-06-16 17:07:31 +0200 |
| commit | 0b844d312fbab3d2730f838a1fb4958ff655d0fd (patch) | |
| tree | b3002ddf105f0ff8d7c90afeed1edbb8558c3dcd /addons/analytic_user_function/analytic_user_function.py | |
| parent | 900a19dbacf0044d0266c7ba58b02494940f6af5 (diff) | |
| parent | e121ce7091a552da296d216920e1f1f864ef1448 (diff) | |
[MERGE] merged with main trunk
bzr revid: qdp-launchpad@openerp.com-20110616150731-5kps7wbw0d8qehoa
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
| -rw-r--r-- | addons/analytic_user_function/analytic_user_function.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 04f66fb8daa..ca3e9ef80c7 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -20,7 +20,6 @@ ############################################################################## from osv import fields,osv -from osv import orm from tools.translate import _ class analytic_user_funct_grid(osv.osv): @@ -98,11 +97,11 @@ class hr_analytic_timesheet(osv.osv): '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 @@ -133,11 +132,12 @@ class hr_analytic_timesheet(osv.osv): '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'] + 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) + amount = unit_amount * amount_unit + res ['value']['amount']= - round(amount, 2) res ['value']['general_account_id']= a return res |
