Skip to content

[16.0][IMP] shopfloor_reception*: allow over receiving#1090

Open
nicolas-delbovier-acsone wants to merge 2 commits intoOCA:16.0from
acsone:16.0-imp-shopfloor-reception-allow-over-receiving-nde
Open

[16.0][IMP] shopfloor_reception*: allow over receiving#1090
nicolas-delbovier-acsone wants to merge 2 commits intoOCA:16.0from
acsone:16.0-imp-shopfloor-reception-allow-over-receiving-nde

Conversation

@nicolas-delbovier-acsone
Copy link

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Aug 12, 2025

This PR adds the possibility to receive more goods than ordered (in case of an error from the supplier for example)

@OCA-git-bot
Copy link
Contributor

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

@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-imp-shopfloor-reception-allow-over-receiving-nde branch from 8e064b8 to 462d83d Compare August 12, 2025 15:03
Comment on lines +1243 to +1250
if compare == 1 and not is_over_reception_confirmed:
line.write(previous_vals)
message = self._response_for_confirm_over_reception(
picking,
line,
quantity,
action,
message=self.msg_store.line_scanned_qty_done_higher_than_allowed(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid the useless write,

if compare == 1:
    return self._response_for_confirm_over_reception()
line.qty_done = quantity

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This write is not useless, this is used to rollback the value before user confirms.

I need to do this because the function _set_quantity__check_quantity_done is checking all the qty_done on the move so I need to update the move before this check but then I need to rollback before user confirms. I agree this is not beautiful since, in the case of a user confirming, we will have a useless double write. However, I suspect this is necessary to follow this pattern to avoid problems in the case of many workers working on the same move.

I copied this pattern from the function _set_quantity__by_product

Comment on lines +565 to +573
# def over_reception_ask_confirm(self):
# return {
# "message_type": "warning",
# "body": _(
# "You confirmed you wanted to receive more goods "
# "than expected. Click again to continue."
# ),
# }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# def over_reception_ask_confirm(self):
# return {
# "message_type": "warning",
# "body": _(
# "You confirmed you wanted to receive more goods "
# "than expected. Click again to continue."
# ),
# }

"message_type": "warning",
"body": _(
"Confirm location change from %(location_from)s to " "%(location_to)s?"
"Confirm location change from %(location_from)s to %(location_to)s?"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid this changes

}
if (this.qty > this.qtyTodo) {
return "background-color: orangered";
return "background-color: rgb(229, 171, 0)";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid this changes

Copy link
Author

@nicolas-delbovier-acsone nicolas-delbovier-acsone Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to make the color a "warning" color instead of a "danger" one since now it is possible to over-receive. Thus, it is no more an error.

"""

def _set_quantity__process__set_qty_and_split(
self, picking, line, quantity, action, is_over_reception_confirmed=False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self, picking, line, quantity, action, is_over_reception_confirmed=False
self, picking, line, quantity, action=None, is_over_reception_confirmed=False

@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-imp-shopfloor-reception-allow-over-receiving-nde branch from 7ffe855 to 6704bf5 Compare August 14, 2025 07:02
return response
compare = self._set_quantity__check_quantity_done(selected_line)
compare = self._set_quantity__check_quantity_done(
selected_line, selected_line.qty_done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
selected_line, selected_line.qty_done
selected_line, sum(move.move_line_ids.mapped("qty_done"))

Copy link

@sbejaoui sbejaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review + functional test

@simahawk simahawk changed the title [16.0][IMP] shopfloor reception: allow over receiving [16.0][IMP] shopfloor_reception*: allow over receiving Aug 20, 2025
Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have separated commits per module? The rest can be squashed.

@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rollback these README changes?
TIP: run export SKIP=oca-gen-addon-readme to avoid updating readme files on each commit ;)

savepoint.rollback()
return self._response_for_set_quantity(
picking, line, message=self.msg_store.unable_to_pick_qty()
def _after_over_recepetion_confirmed_hook(self, picking, line):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _after_over_recepetion_confirmed_hook(self, picking, line):
def _after_over_reception_confirmed_hook(self, picking, line):

Comment on lines +1358 to +1359
"process_with_new_pack",
is_over_reception_confirmed,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"process_with_new_pack",
is_over_reception_confirmed,
action="process_with_new_pack",
is_over_reception_confirmed=is_over_reception_confirmed,

I'm not a fan of "hiding" kw args w/ positional args just because python allows to do so :)

<div class="button-list button-vertical-list full">
<v-row align="center">
<v-col class="text-center" cols="12">
<div>{{ state.display_info.message }}</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

display_info messages are normally visible on the top of the page automatically. Is this really needed?

@github-actions
Copy link

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 github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 21, 2025
@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-imp-shopfloor-reception-allow-over-receiving-nde branch from 9155440 to 3b31d93 Compare January 23, 2026 16:04
@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 25, 2026
@sbejaoui
Copy link

can you rebase please

@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-imp-shopfloor-reception-allow-over-receiving-nde branch from 3b31d93 to fde4d5a Compare February 20, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants