OpenERP Addons (modules)

Merge lp:~openerp-dev/openobject-addons/trunk-bug-937669-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP) on 2012-03-12
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-937669-mma
Merge into: lp:openobject-addons
Diff against target: 30 lines (+4/-5) 1 file modified
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-937669-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team 2012-03-12 Pending
Review via email: mp+96991@code.launchpad.net

Description of the Change

Hello,

    stock: passed move product qty in reference amount

Thanks.
mma

To post a comment you must log in.

Unmerged revisions

6668. By Graeme Gellatly on 2012-03-12

[FIX]stock: passed move product qty in reference amount

Preview Diff

1=== modified file 'stock/stock.py'
2--- stock/stock.py 2012-02-28 14:08:16 +0000
3+++ stock/stock.py 2012-03-12 10:32:21 +0000
4@@ -2149,13 +2149,10 @@
5 # by default the reference currency is that of the move's company
6 reference_currency_id = move.company_id.currency_id.id
7
8- default_uom = move.product_id.uom_id.id
9- qty = product_uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, default_uom)
10-
11 # if product is set to average price and a specific value was entered in the picking wizard,
12 # we use it
13 if move.product_id.cost_method == 'average' and move.price_unit:
14- reference_amount = qty * move.price_unit
15+ reference_amount = move.product_qty * move.price_unit
16 reference_currency_id = move.price_currency_id.id or reference_currency_id
17
18 # Otherwise we default to the company's valuation price type, considering that the values of the
19@@ -2163,8 +2160,10 @@
20 else:
21 if context is None:
22 context = {}
23- currency_ctx = dict(context, currency_id = move.company_id.currency_id.id)
24+ currency_ctx = dict(context, currency_id = reference_currency_id)
25 amount_unit = move.product_id.price_get('standard_price', context=currency_ctx)[move.product_id.id]
26+ default_uom = move.product_id.uom_id.id
27+ qty = product_uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, default_uom)
28 reference_amount = amount_unit * qty or 1.0
29
30 return reference_amount, reference_currency_id

Subscribers

People subscribed via source and target branches

to all changes: