Use context to check model and field access
issue4081 review8481002
This commit is contained in:
1 parent
a0c28f6e23
commit
076c471bad
1 file changed
+3
-5
@@ -45,11 +45,9 @@ class Sale:
|
||||
shipment = super(Sale, self)._get_shipment_sale(shipment_type, values)
|
||||
Shipment = shipment.__class__
|
||||
if self.shipment_grouping_method:
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
domain = self._get_grouped_shipment_domain(shipment)
|
||||
order = self._get_grouped_shipment_order()
|
||||
grouped_shipments = Shipment.search(domain, order=order,
|
||||
limit=1)
|
||||
domain = self._get_grouped_shipment_domain(shipment)
|
||||
order = self._get_grouped_shipment_order()
|
||||
grouped_shipments = Shipment.search(domain, order=order, limit=1)
|
||||
if grouped_shipments:
|
||||
shipment, = grouped_shipments
|
||||
return shipment
|
||||
Reference in new issue
Block a user