[IMP] account, account_analytic_plans: Improvements in amount currency func and removed extra spaces
bzr revid: pso@tinyerp.com-20110415060050-mzt5k94o63y8n43r
This commit is contained in:
parent
9d96add953
commit
11644bde68
|
@ -28,7 +28,6 @@ from tools.translate import _
|
|||
class account_analytic_line(osv.osv):
|
||||
_inherit = 'account.analytic.line'
|
||||
_description = 'Analytic Line'
|
||||
|
||||
_columns = {
|
||||
'product_uom_id': fields.many2one('product.uom', 'UoM'),
|
||||
'product_id': fields.many2one('product.product', 'Product'),
|
||||
|
|
|
@ -57,11 +57,12 @@ class account_analytic_line(osv.osv):
|
|||
return res
|
||||
for id in ids:
|
||||
res.setdefault(id, 0.0)
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
from_currency_id = line.company_id.currency_id.id
|
||||
to_currency_id = line.currency_id.id
|
||||
from_amount = line.amount
|
||||
res[line.id] = self.pool.get('res.currency').compute(cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context=context)
|
||||
res[line.id] = currency_obj.compute(cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context=context)
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
|
Loading…
Reference in New Issue