diff options
| author | Harry (Open ERP) <hmo@tinyerp.com> | 2010-03-08 16:28:08 +0530 |
|---|---|---|
| committer | Harry (Open ERP) <hmo@tinyerp.com> | 2010-03-08 16:28:08 +0530 |
| commit | 748a44059e2cb5b9085df30e41c79458362b4f81 (patch) | |
| tree | 29c7c8b94a3b25eabc6bc32da80f59f1493b5a2e /addons/analytic_user_function/analytic_user_function.py | |
| parent | bc8ede63ce255d6b3d2fb5fb8ff5fffe0503c061 (diff) | |
| parent | 3b04171221de08948f82c977b63c457ea1539dd1 (diff) | |
[MERGE]
bzr revid: hmo@tinyerp.com-20100308105808-daycevll1sgvayfl
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
| -rw-r--r-- | addons/analytic_user_function/analytic_user_function.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index e2279bb891e..c5c2af729a0 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -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 |
