bugfixed for currency rounding
lp bug: https://launchpad.net/bugs/345314 fixed bzr revid: hda@hda-20090319130214-0v0ef0ujit372dsy
This commit is contained in:
parent
dbfaf144fa
commit
3bad199af3
|
@ -918,8 +918,14 @@ account_invoice()
|
|||
class account_invoice_line(osv.osv):
|
||||
def _amount_line(self, cr, uid, ids, prop, unknow_none,unknow_dict):
|
||||
res = {}
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
for line in self.browse(cr, uid, ids):
|
||||
res[line.id] = round(line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0),2)
|
||||
if line.invoice_id:
|
||||
res[line.id] = line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0)
|
||||
cur = line.invoice_id.currency_id
|
||||
res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
|
||||
else:
|
||||
res[line.id] = round(line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0),2)
|
||||
return res
|
||||
|
||||
def _price_unit_default(self, cr, uid, context=None):
|
||||
|
|
Loading…
Reference in New Issue