Tryton - Issues



Title Parent Location quantity of flat_child location is incorrect
Priority bug Status chatting
Superseder Nosy List ced, mrichez, tbruyere
Type Components stock
Assigned To Keywords patch

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

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
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...
Date User Action Args
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
2018-02-23 17:59:31cedsetstatus: unread -> need-eg
nosy: + ced
messages: + msg38582
2018-02-22 14:08:04mrichezcreate

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