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

[16.0] [FIX] l10n_it_delivery_note: fix partner ddt #3750

Merged
merged 1 commit into from
Jan 5, 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: 11 additions & 10 deletions l10n_it_delivery_note/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,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.warehouse_id
dest_warehouse_id = dest_location_id.warehouse_id
Expand All @@ -383,16 +384,16 @@
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."
)

elif not dest_partner_id:
dest_partner_id = partner_id
if picking_type_code == ["outgoing"]:
src_partner_id = self.company_id.partner_id

Check warning on line 388 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#L388

Added line #L388 was not covered by tests
else:
src_partner_id = partner_id or self.company_id.partner_id

Check warning on line 390 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#L390

Added line #L390 was not covered by tests

if not dest_partner_id:
if picking_type_code == ["incoming"]:
dest_partner_id = self.company_id.partner_id

Check warning on line 394 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#L394

Added line #L394 was not covered by tests
else:
dest_partner_id = partner_id or self.company_id.partner_id

return (src_partner_id, dest_partner_id)

Expand Down
Loading