[FIX] delivery: conversion rate according to the date

When using compute in model "res.currency", the date must be set in the
context to have the right conversion rate.

opw:647799
This commit is contained in:
Goffin Simon 2015-09-03 09:50:07 +02:00
parent ea07b7dc2b
commit ea2745b866
1 changed files with 3 additions and 1 deletions

View File

@ -223,7 +223,9 @@ class delivery_grid(osv.osv):
quantity += q
total = (order.amount_total or 0.0) - total_delivery
total = self.pool['res.currency'].compute(cr, uid, order.currency_id.id, order.company_id.currency_id.id, total, context=context)
ctx = context.copy()
ctx['date'] = order.date_order
total = self.pool['res.currency'].compute(cr, uid, order.currency_id.id, order.company_id.currency_id.id, total, context=ctx)
return self.get_price_from_picking(cr, uid, id, total,weight, volume, quantity, context=context)
def get_price_from_picking(self, cr, uid, id, total, weight, volume, quantity, context=None):