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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion purchase_delivery_split_date/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

):
if date_key not in pickings_by_date:
copy_vals = line._first_picking_copy_vals(key, line)
Expand Down
Loading