Use context to check model and field access

issue4081
review8481002
This commit is contained in:
Cédric Krier committed 2014-09-17 21:45:55 +02:00
1 parent a0c28f6e23
commit 076c471bad
1 file changed
+3 -5
+3 -5
View File
@@ -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