Merge lp:~camptocamp/ocb-addons/7.0-fix-pricelist-currency-compute-context-2013-03-18 into lp:ocb-addons

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 8897
Proposed branch: lp:~camptocamp/ocb-addons/7.0-fix-pricelist-currency-compute-context-2013-03-18
Merge into: lp:ocb-addons
Diff against target: 15 lines (+4/-1)
1 file modified
product/pricelist.py (+4/-1)
To merge this branch: bzr merge lp:~camptocamp/ocb-addons/7.0-fix-pricelist-currency-compute-context-2013-03-18
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp Approve
Stefan Rijnhart (Opener) Approve
Holger Brunn (Therp) Approve
Review via email: mp+153738@code.launchpad.net

Description of the change

Fix a missing context in product/pricelist.py

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

looks good

review: Approve
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

The patch looks clear enough, and I know that in general it is good to pass the context. However, I was just wondering what problem this is supposed to solve. I *assume* that the lookup date for the conversion rate gets lost. Maybe you could change the description of the bug report to make this ultimately clear?

review: Needs Information
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Added some information on beg report

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks!

review: Approve
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/pricelist.py'
2--- product/pricelist.py 2012-12-06 14:56:32 +0000
3+++ product/pricelist.py 2013-03-18 10:23:27 +0000
4@@ -236,7 +236,10 @@
5 qty, context=context)[res['base_pricelist_id']]
6 ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
7 uom_price_already_computed = True
8- price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
9+ price = currency_obj.compute(cr, uid,
10+ ptype_src, res['currency_id'],
11+ price_tmp, round=False,
12+ context=context)
13 elif res['base'] == -2:
14 # this section could be improved by moving the queries outside the loop:
15 where = []