Tryton - Issues

 

Issue7162

Title Parent Location quantity of flat_child location is incorrect
Priority bug Status resolved
Superseder Nosy List ced, mrichez, reviewbot, roundup-bot, tbruyere
Type behavior Components stock
Assigned To ced Keywords patch, review
Reviews 44871003
View: 44871003

Created on 2018-02-22.14:08:04 by mrichez, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
bug_qty_location_flat_children.pdf mrichez, 2018-02-26.10:23:29 application/pdf
bug_quantity.diff mrichez, 2018-02-26.13:36:49 text/plain
Messages
New changeset cf4b2a6dafd6 by Cédric Krier in branch '4.6':
Do not include flat location children from child_of search
http://hg.tryton.org/modules/stock/rev/cf4b2a6dafd6
New changeset 710baff52769 by Cédric Krier in branch 'default':
Do not include flat location children from child_of search
http://hg.tryton.org/modules/stock/rev/710baff52769

New changeset e7ad20e4dc9b by Cédric Krier in branch 'default':
Add tests for products_by_location on 2nd level flat_childs
http://hg.tryton.org/modules/stock/rev/e7ad20e4dc9b
review44871003 updated at https://codereview.tryton.org/44871003/#ps20001
New review44871003 at https://codereview.tryton.org/44871003/#ps1
msg39634 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-04-01.17:11:30
I found the problem, it is when a single location is requested and that it contains a flat location.
Here is review44871003 which fix it and include a minimal version of file2552.
msg38609 (view) Author: [hidden] (mrichez) Date: 2018-02-26.13:36:49
Here's a scenario to reproduce bug, scenario fails when expected 80 units and get 140 units. (i made a copy of test_products_by_location_flat_childs test). This is a diff file with the changes.
msg38606 (view) Author: [hidden] (mrichez) Date: 2018-02-26.10:23:29
Here's a pdf with the detailed screenshots. This bug happens only when using a flat children and when double clicking in the location treeview to get the quantities of the parent of a flat_children location (in our case "Storage Zone")
msg38582 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-23.17:59:30
I tried to adapt the test_products_by_location_flat_childs to get your error but I could not.
Could you try to provide a failing test?
Are you sure you moved the 60 products from the Storage Zone to Z1?
msg38568 (view) Author: [hidden] (mrichez) Date: 2018-02-22.14:08:03
We noticed a wrong computation of stock when using flat_children storage.
Here's a scenario to reproduce it.

We create a storage location named "Z0" with parent "Storage Zone" and we check the "flat_children" box.
We create another storage location named "Z1" with parent "Z0".

We receive 80 products 'P' into Storage Zone. (supplier shipment)
We move 60 products into location "Z1" (internal shipment)

Now in the "Locations" treeview, if we double-click on Storage Zone to see product quantities, product "P" has 140 (which is incorrect).

Quantity of product "P" in "Z1" = 60 (correct), Quantity of product "P" in "Z0" = 60 (correct).

It seems quantity of a child location into a flat_children location is counted twice during stock computation...
History
Date User Action Args
2018-04-13 20:21:32roundup-botsetmessages: + msg39978
2018-04-03 16:40:39roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg39674
2018-04-03 12:57:16reviewbotsetmessages: + msg39659
2018-04-01 17:34:34reviewbotsetnosy: + reviewbot
messages: + msg39635
2018-04-01 17:34:33reviewbotsetreviews: 44871003
keyword: + review
2018-04-01 17:11:31cedsetstatus: in-progress -> testing
messages: + msg39634
2018-04-01 17:04:19cedsetstatus: chatting -> in-progress
assignedto: ced
type: behavior
2018-02-26 17:19:55cedsetstatus: need-eg -> chatting
2018-02-26 13:36:50mrichezsetfiles: + bug_quantity.diff
messages: + msg38609
keyword: + patch
2018-02-26 10:23:29mrichezsetfiles: + bug_qty_location_flat_children.pdf
messages: + msg38606

Showing 10 items. Show all history (warning: this could be VERY long)