Tryton - Issues

 

Issue7856

Title Can't move qty from a parent location to child location
Priority bug Status resolved
Superseder Nosy List ced, resteve, reviewbot, roundup-bot, tbruyere
Type feature request Components stock
Assigned To ced Keywords review
Reviews 66541002
View: 66541002

Created on 2018-11-13.11:35:48 by resteve, last changed by roundup-bot.

Messages
New changeset 20e64d915b37 by Cédric Krier in branch 'default':
Do not pick product at the destination location
https://hg.tryton.org/tryton-env/rev/20e64d915b37
New changeset d57f046484b8 by Cédric Krier in branch 'default':
Do not pick product at the destination location
https://hg.tryton.org/modules/stock/rev/d57f046484b8

New changeset 98c660e6695d by Cédric Krier in branch 'default':
Add test Move assign_try skips to_location
https://hg.tryton.org/modules/stock/rev/98c660e6695d
review66541002 updated at https://codereview.tryton.org/66541002/#ps20001
review66541002 updated at https://codereview.tryton.org/66541002/#ps1
msg46740 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-02-05.18:41:15
The preference for the from location is for me a new feature.
So here is review66541002 that avoid picking product from the destination.
msg46641 (view) Author: [hidden] (tbruyere) Date: 2019-01-30.14:57:40
I have the same issue.

I agree with the proposal to skip the to_location in location_qties dict.

But I think it would be necessary to first check the quantities on the from_location before doing the pick_product.
Maybe adding the from_location as first in the location_qties dict.
msg44866 (view) Author: [hidden] (resteve) Date: 2018-11-13.11:35:47
Locations:

- Location "X"
  - Location "AX"
  - Location "BX"
- Location "Y"

The product A, I have stock in location "X" and location "AX".

I create a new move (with internal shipment):

- From locatoon: Location "X"
- To location: Location "AX"

In case I assign a shipment, qty from location "X" to location "AX", I can't because in the assign_try [2] write the from_location that have stock (location name "AX" is before that "X" in order name [2]) and not respect the from_location that I insert in the stock.move.

I get the error "Source and destination location must be different" because assing try, add "from tocation" to "AX" and is equal "to location".

I think with need to skip to_location in add locations in location_qties dict [3].

             for location in childs:
+                if location.id == to_location.id:
+                    continue
                 key = get_key(location)


[1] https://bitbucket.org/tryton/stock/src/9872e817351e36c2d2b6e438b835af3eb66c93b5/move.py#lines-857
[2] https://bitbucket.org/tryton/stock/src/9872e817351e36c2d2b6e438b835af3eb66c93b5/location.py#lines-123
[3] https://bitbucket.org/tryton/stock/src/9872e817351e36c2d2b6e438b835af3eb66c93b5/move.py#lines-868
History
Date User Action Args
2019-02-18 18:36:16roundup-botsetmessages: + msg47092
2019-02-18 18:36:06roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg47091
2019-02-06 12:09:10reviewbotsetmessages: + msg46766
2019-02-05 18:43:07reviewbotsetnosy: + reviewbot
messages: + msg46741
2019-02-05 18:41:15cedsetstatus: chatting -> testing
keyword: + review
nosy: + ced
messages: + msg46740
reviews: 66541002
assignedto: ced
2019-01-30 14:57:41tbruyeresetnosy: + tbruyere
messages: + msg46641
2018-11-13 11:35:48restevecreate