From ea2745b866760f824c47a8f84df166ff2cea7f38 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 3 Sep 2015 09:50:07 +0200 Subject: [PATCH] [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 --- addons/delivery/delivery.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 2333877b8b5..275c19cd861 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -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):