wms icon indicating copy to clipboard operation
wms copied to clipboard

[16.0][FWP][IMP] shopfloor: Ensure destination location on moves for allow move create

Open mt-software-de opened this issue 6 months ago • 5 comments

FWP of #973

cc @jbaudoux

mt-software-de avatar Jun 24 '25 15:06 mt-software-de

Hi @guewen, @sebalix, @simahawk, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Jun 24 '25 15:06 OCA-git-bot

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_lines is used in the set_quantity__post_line method, which first sets result_package_id on the move line if a package was scanned, then set_destination_and_unload_lines is 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_id to 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

mt-software-de avatar Jul 30 '25 13:07 mt-software-de

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_lines is used in the set_quantity__post_line method, which first sets result_package_id on the move line if a package was scanned, then set_destination_and_unload_lines is 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_id to 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

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.

mmequignon avatar Jul 31 '25 08:07 mmequignon

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_lines is used in the set_quantity__post_line method, which first sets result_package_id on the move line if a package was scanned, then set_destination_and_unload_lines is 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_id to 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

My 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.

mt-software-de avatar Jul 31 '25 08:07 mt-software-de

@mmequignon Can we merge this and update the port to v18 ?

jbaudoux avatar Aug 12 '25 13:08 jbaudoux

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.

github-actions[bot] avatar Dec 14 '25 12:12 github-actions[bot]

Ping @jbaudoux @mmequignon

mt-software-de avatar Dec 14 '25 19:12 mt-software-de

/ocabot merge minor

jbaudoux avatar Dec 15 '25 13:12 jbaudoux

This PR looks fantastic, let's merge it! Prepared branch 16.0-ocabot-merge-pr-1064-by-jbaudoux-bump-minor, awaiting test results.

OCA-git-bot avatar Dec 15 '25 13:12 OCA-git-bot

Congratulations, your PR was merged at 04f2e6a2bd3f10e48f1ded58a8f88f813c0e651f. Thanks a lot for contributing to OCA. ❤️

OCA-git-bot avatar Dec 15 '25 13:12 OCA-git-bot