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

Proposed by Mayur Maheshwari(OpenERP)
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
stock/stock.py (+4/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-937669-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team 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

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-02-28 14:08:16 +0000
+++ stock/stock.py 2012-03-12 10:32:21 +0000
@@ -2149,13 +2149,10 @@
2149 # by default the reference currency is that of the move's company2149 # by default the reference currency is that of the move's company
2150 reference_currency_id = move.company_id.currency_id.id2150 reference_currency_id = move.company_id.currency_id.id
21512151
2152 default_uom = move.product_id.uom_id.id
2153 qty = product_uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, default_uom)
2154
2155 # if product is set to average price and a specific value was entered in the picking wizard,2152 # if product is set to average price and a specific value was entered in the picking wizard,
2156 # we use it2153 # we use it
2157 if move.product_id.cost_method == 'average' and move.price_unit:2154 if move.product_id.cost_method == 'average' and move.price_unit:
2158 reference_amount = qty * move.price_unit2155 reference_amount = move.product_qty * move.price_unit
2159 reference_currency_id = move.price_currency_id.id or reference_currency_id2156 reference_currency_id = move.price_currency_id.id or reference_currency_id
21602157
2161 # Otherwise we default to the company's valuation price type, considering that the values of the2158 # Otherwise we default to the company's valuation price type, considering that the values of the
@@ -2163,8 +2160,10 @@
2163 else:2160 else:
2164 if context is None:2161 if context is None:
2165 context = {}2162 context = {}
2166 currency_ctx = dict(context, currency_id = move.company_id.currency_id.id)2163 currency_ctx = dict(context, currency_id = reference_currency_id)
2167 amount_unit = move.product_id.price_get('standard_price', context=currency_ctx)[move.product_id.id]2164 amount_unit = move.product_id.price_get('standard_price', context=currency_ctx)[move.product_id.id]
2165 default_uom = move.product_id.uom_id.id
2166 qty = product_uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, default_uom)
2168 reference_amount = amount_unit * qty or 1.02167 reference_amount = amount_unit * qty or 1.0
21692168
2170 return reference_amount, reference_currency_id2169 return reference_amount, reference_currency_id

Subscribers

People subscribed via source and target branches

to all changes: