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

[14.0][FIX] l10n_it_delivery_note: fix partner ddt #2785

Merged
merged 1 commit into from
Feb 23, 2024
Merged
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
21 changes: 12 additions & 9 deletions l10n_it_delivery_note/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@
partner_id = self.mapped("partner_id")
src_location_id = self.mapped("location_id")
dest_location_id = self.mapped("location_dest_id")
picking_type_code = self.mapped("picking_type_code")

src_warehouse_id = src_location_id.get_warehouse()
dest_warehouse_id = dest_location_id.get_warehouse()
Expand All @@ -382,16 +383,18 @@
dest_partner_id = dest_warehouse_id.partner_id

if not src_partner_id:
src_partner_id = partner_id

if not dest_partner_id:
raise ValueError(
"Fields 'src_partner_id' and 'dest_partner_id' "
"cannot be both unset."
)
src_partner_id = (

Check warning on line 386 in l10n_it_delivery_note/models/stock_picking.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_delivery_note/models/stock_picking.py#L386

Added line #L386 was not covered by tests
self.company_id.partner_id
if picking_type_code == ["outgoing"]
else partner_id
)

elif not dest_partner_id:
dest_partner_id = partner_id
if not dest_partner_id:
dest_partner_id = (
self.company_id.partner_id
if picking_type_code == ["incoming"]
else partner_id
)

return (src_partner_id, dest_partner_id)

Expand Down
Loading