Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] purchase_delivery_split_date: prevent error when adding a PO line on confirmed POs #2436

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

AaronHForgeFlow
Copy link
Contributor

I reproduced it by using the purchase request module to add a new line on an existing PO using the flag:
"Merge on PO lines with equal Scheduled Date"

image

cc @ForgeFlow

purchase order line on a different delivery date on confirmed POs
For example: use the purchase request module to add a new line on
an existing PO
@@ -132,7 +132,7 @@ def _check_split_pickings(self):
continue
if (
move.picking_id.scheduled_date.date() != date_key
or pickings_by_date[date_key] != move.picking_id
or pickings_by_date.get(date_key, []) != move.picking_id
Copy link
Member

@StefanRijnhart StefanRijnhart Oct 17, 2024

Choose a reason for hiding this comment

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

Just a nitpick: I find using a list as a default value confusing and I would not be surprised if this comparison was going to give a TypeError at some point. You can just leave it out, because comparing with None (get's default) is at least just as valid.

In [2]: picking
Out[2]: stock.picking(1,)

In [3]: picking != []
Out[3]: True

In [4]: picking != None
Out[4]: True

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.

2 participants