Merge lp:~openerp-dev/openobject-addons/7.0-opw-599516-han into lp:openobject-addons/7.0

Proposed by Hardik Ansodariya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-599516-han
Merge into: lp:openobject-addons/7.0
Diff against target: 11 lines (+1/-1)
1 file modified
stock/stock.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-599516-han
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+192132@code.launchpad.net

Description of the change

Fixed the issue of Phantom sets in valuation of components.

to reproduce:
* Create 3 product lets say:
  product 101011 cost price: 12.12
  product 101005 "" : 6.38
  product 101008 "" : 2.87

* Product config:
  Costing Method: Average
  Inventory Valuation: Real Time
* BOM
  Product 101011(BOM Type: Sets / Phantom)
  Product 101005 and 101008 as component.

* create a sale order with one line:
   - product 101011 (qty=1)
* "compute" and "confirm" that sale order
* in warehouse, delivery orders:
   - check availability
   - process
   - validate
* accounting / chart of accounts -> choose "All Entries"
   - edit account "330000"
-> you'll see that for this sale, there are 2 lines:
   - product 101005: credit = 12.12
   - product 101008: credit = 24.24

The credit values takes the price of product 101011 instead of taking
their price for their corresponding product (101005 or 101008).

The journal items should be:
   - product 101005: credit = 6.38
   - product 101008: credit = 5.74 (2.87*2)

With the reference of Maintenance case: 599516.

To post a comment you must log in.

Unmerged revisions

9517. By Hardik Ansodariya (OpenERP)

[FIX] stock: Bug with Phantom sets in valuation of components (Maintanance case: 599516)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2013-10-15 11:20:16 +0000
3+++ stock/stock.py 2013-10-22 11:40:33 +0000
4@@ -2308,7 +2308,7 @@
5
6 # if product is set to average price and a specific value was entered in the picking wizard,
7 # we use it
8- if move.product_id.cost_method == 'average' and move.price_unit:
9+ if move.product_id.cost_method == 'average' and move.price_unit and move.picking_id.type in ('in', 'internal'):
10 reference_amount = qty * move.price_unit
11 reference_currency_id = move.price_currency_id.id or reference_currency_id
12