diff options
| author | uco (OpenERP) <uco@tinyerp.co.in> | 2010-02-16 14:15:03 +0530 |
|---|---|---|
| committer | uco (OpenERP) <uco@tinyerp.co.in> | 2010-02-16 14:15:03 +0530 |
| commit | 20c1f2fff1e858b207706f003a3b4b0befcbe9e0 (patch) | |
| tree | 64756ec05ce16f0254915d05946487ee7036a982 /addons/analytic_user_function/analytic_user_function.py | |
| parent | 06fae133f0edd382dad9450956ab5db1e40dc73b (diff) | |
| parent | b4cd54ad9e4baa5f58ea8464222dfeddc1da65d4 (diff) | |
[MERGE]
bzr revid: uco@tinyerp.co.in-20100216084503-k4jbdrp1x23f8awz
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
| -rw-r--r-- | addons/analytic_user_function/analytic_user_function.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 852d0750a42..c5c2af729a0 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -99,8 +99,11 @@ class hr_analytic_timesheet(osv.osv): _('There is no expense account define ' \ 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) - amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid, - r.product_id.uom_id.id, r.product_id.standard_price, False) + # Compute based on pricetype + amount_unit=self.on_change_unit_amount(cr, uid, ids, + r.product_id.id, unit_amount, 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 @@ -132,8 +135,11 @@ class hr_analytic_timesheet(osv.osv): _('There is no expense account define ' \ 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) - amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid, - r.product_id.uom_id.id, r.product_id.standard_price, False) + # Compute based on pricetype + amount_unit=self.on_change_unit_amount(cr, uid, ids, + r.product_id.id, unit_amount, 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 |
