diff options
| author | Olivier Dony <odo@openerp.com> | 2011-08-10 01:44:28 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2011-08-10 01:44:28 +0200 |
| commit | 50507512cbaf6d0119a29943c9ca85deb4057404 (patch) | |
| tree | 05f66487a913e409b4b4bf055a55e2cd79ddc9ba /addons/analytic_user_function/analytic_user_function.py | |
| parent | 3e6b0297d02168de2194e71e80f60774603c3634 (diff) | |
| parent | 097b76d372c77f5cc006cda7a86c623fcc89b8df (diff) | |
[MERGE] latest trunk
This was a helluva merge, with hundreds of conflicts resolved manually!!
I hope I did not break too many things, but a full review of the mail-related
features (where most of the conflicts occurred) must still be done before
this feature branch can be merged.
bzr revid: odo@openerp.com-20110809234428-3dsvxrt6t54ju0cf
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 |
