Skip to content

Commit

Permalink
[FIX] l10n_it_delivery_note: fix partner ddt
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso authored and OCA-git-bot committed Dec 15, 2023
1 parent 37118d5 commit 8ead37d
Showing 1 changed file with 11 additions and 10 deletions.
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 @@ -374,6 +374,7 @@ def _get_partners(self):
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,16 @@ def _get_partners(self):
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 387 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#L387

Added line #L387 was not covered by tests
else:
src_partner_id = partner_id

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

Check warning on line 393 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#L393

Added line #L393 was not covered by tests
else:
dest_partner_id = partner_id

return (src_partner_id, dest_partner_id)

Expand Down

0 comments on commit 8ead37d

Please sign in to comment.