Skip to content

[16.0][IMP] shopinvader_delivery_carrier: code simplification for _available_carriers method in sale order #12

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

Open
wants to merge 1 commit into
base: 16.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
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