Skip to content

Commit

Permalink
[IMP] code simplification for _available_carriers method in sale order
Browse files Browse the repository at this point in the history
  • Loading branch information
chafique-delli committed Sep 13, 2024
1 parent dca2425 commit 888359e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions shopinvader_delivery_carrier/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ def _compute_shopinvader_available_carrier_ids(self):
order.shopinvader_available_carrier_ids = order._available_carriers()

def _available_carriers(self):
carriers = self.env["delivery.carrier"].search(
[
"|",
("company_id", "=", False),
("company_id", "=", self.company_id.id),
]
)
return (
carriers.available_carriers(self.partner_shipping_id)
if self.partner_id
else carriers
)
self.ensure_one()
wizard = self.env["choose.delivery.carrier"].new({"order_id": self.id})
return wizard.available_carrier_ids._origin

0 comments on commit 888359e

Please sign in to comment.