Skip to content

Commit 6537bd2

Browse files
chienandaluvictoralmau
authored andcommitted
[FIX] delivery_price_method: method permissions
If a user don't have the necessary permissions for writing in the `delivery.carrier` model (like a low range salesman) he won't be able to choose a carrier wich uses the rate shipment override. TT31627 delivery_price_method 13.0.1.0.1
1 parent 1623f89 commit 6537bd2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

delivery_price_method/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"website": "https://github.com/OCA/delivery-carrier",
1010
"license": "AGPL-3",
1111
"category": "Delivery",
12-
"version": "13.0.1.0.0",
12+
"version": "13.0.1.0.1",
1313
"depends": ["delivery"],
1414
"data": ["views/delivery_carrier_views.xml"],
1515
}

delivery_price_method/models/delivery_carrier.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def rate_shipment(self, order):
2424
previous_method = False
2525
if self.price_method in ("fixed", "base_on_rule"):
2626
previous_method = self.delivery_type
27-
self.delivery_type = self.price_method
27+
self.sudo().delivery_type = self.price_method
2828
res = super().rate_shipment(order)
2929
if previous_method:
30-
self.delivery_type = previous_method
30+
self.sudo().delivery_type = previous_method
3131
return res
3232

3333
def send_shipping(self, pickings):

0 commit comments

Comments
 (0)