[16.0][FWP][IMP] shopfloor: Ensure destination location on moves for allow move create
FWP of #973
cc @jbaudoux
Hi @guewen, @sebalix, @simahawk, some modules you are maintaining are being modified, check this out!
Hi @mt-software-de I tested this on 18.0, and there's something that I find confusing. In 14.0 this
set_destination_and_unload_linesis used in theset_quantity__post_linemethod, which first setsresult_package_idon the move line if a package was scanned, thenset_destination_and_unload_linesis called, which sets result_package_id to False.As I understand/remember, we can move a product to a pallet, and we shouldn't force the
result_package_idto False in such case.Do you guys have some insight? @jbaudoux @mt-software-de
I can not find the method set_quantity__post_line in v14
Hi @mt-software-de I tested this on 18.0, and there's something that I find confusing. In 14.0 this
set_destination_and_unload_linesis used in theset_quantity__post_linemethod, which first setsresult_package_idon the move line if a package was scanned, thenset_destination_and_unload_linesis called, which sets result_package_id to False. As I understand/remember, we can move a product to a pallet, and we shouldn't force theresult_package_idto False in such case. Do you guys have some insight? @jbaudoux @mt-software-deI can not find the method
set_quantity__post_linein v14
My bad, this isn't post_line but post_move :pray: When a package is scanned, we set the result_package on the line https://github.com/OCA/wms/blob/14.0/shopfloor_single_product_transfer/services/single_product_transfer.py#L746 set_destination_and_unload_lines is then called, and reverts this.
Hi @mt-software-de I tested this on 18.0, and there's something that I find confusing. In 14.0 this
set_destination_and_unload_linesis used in theset_quantity__post_linemethod, which first setsresult_package_idon the move line if a package was scanned, thenset_destination_and_unload_linesis called, which sets result_package_id to False. As I understand/remember, we can move a product to a pallet, and we shouldn't force theresult_package_idto False in such case. Do you guys have some insight? @jbaudoux @mt-software-deI can not find the method
set_quantity__post_linein v14My bad, this isn't post_line but post_move 🙏 When a package is scanned, we set the result_package on the line https://github.com/OCA/wms/blob/14.0/shopfloor_single_product_transfer/services/single_product_transfer.py#L746 set_destination_and_unload_lines is then called, and reverts this.
In fact _set_quantity__post_move is calling _write_destination_on_lines https://github.com/OCA/wms/blob/c63f6d29e42dac0573e71ba93e5d77285e8eb054/shopfloor_single_product_transfer/services/single_product_transfer.py#L641 and then stock.set_destination_and_unload_lines https://github.com/OCA/wms/blob/c63f6d29e42dac0573e71ba93e5d77285e8eb054/shopfloor_single_product_transfer/services/single_product_transfer.py#L636 but it is not unloading it. Because the parameter unload is not passed to it. https://github.com/OCA/wms/blob/c63f6d29e42dac0573e71ba93e5d77285e8eb054/shopfloor/actions/stock.py#L250
I guess the naming of the method is a little bit misleading.
@mmequignon Can we merge this and update the port to v18 ?
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
Ping @jbaudoux @mmequignon
/ocabot merge minor
This PR looks fantastic, let's merge it! Prepared branch 16.0-ocabot-merge-pr-1064-by-jbaudoux-bump-minor, awaiting test results.
Congratulations, your PR was merged at 04f2e6a2bd3f10e48f1ded58a8f88f813c0e651f. Thanks a lot for contributing to OCA. ❤️