Skip to content
Open
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion delivery_price_method/models/delivery_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def rate_shipment(self, order):
# Trick the method for using all the upstream code for the
# price computation in case of using fixed or base_on_rule.
previous_method = False
if self.price_method in ("fixed", "base_on_rule"):
if self.price_method in ("fixed", "base_on_rule") and (
not self.free_over or not self.amount or order.amount_total < self.amount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using self._compute_currency() as in base code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that you mean changing the order.amount to self._compute_currency() right?

):
previous_method = self.delivery_type
self.sudo().delivery_type = self.price_method
res = super().rate_shipment(order)
Expand Down