Browse Source

security: Read access to DP Service Class

master
Harald Welte 7 months ago
parent
commit
b685d48fd9
  1. 4
      models/dp_delivery_carrier.py
  2. 3
      security/ir.model.access.csv

4
models/dp_delivery_carrier.py

@ -119,7 +119,7 @@ class DPDeliveryCarrier(models.Model):
recipient = pickings.partner_id
warehouse = pickings.picking_type_id.warehouse_id.partner_id
weight = self._get_weight(order, pickings)
service = self.get_service_by_class(recipient, weight, self.sudo().dp_service_class)
service = self.get_service_by_class(recipient, weight, self.dp_service_class)
if not service:
raise Warning("Service not available for weight!")
im = self.conn_auth_im()
@ -151,7 +151,7 @@ class DPDeliveryCarrier(models.Model):
config = self._get_config()
recipient = order.partner_shipping_id if order.partner_shipping_id else order.partner_id
warehouse = order.warehouse_id.partner_id
service_class = self.sudo().dp_service_class
service_class = self.dp_service_class
# single-package implementation
weight = self._get_weight(order)

3
security/ir.model.access.csv

@ -2,3 +2,6 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_dp_service_public_user,delivery.carrier.dp.service,model_delivery_carrier_dp_service,base.group_public,1,0,0,0
access_dp_service_users,delivery.carrier.dp.service,model_delivery_carrier_dp_service,,1,0,0,0
access_dp_service_portal_user,delivery.carrier.dp.service,model_delivery_carrier_dp_service,base.group_portal,1,0,0,0
access_dp_class_public_user,delivery.carrier.dp.class,model_delivery_carrier_dp_class,base.group_public,1,0,0,0
access_dp_class_users,delivery.carrier.dp.class,model_delivery_carrier_dp_class,,1,0,0,0
access_dp_class_portal_user,delivery.carrier.dp.class,model_delivery_carrier_dp_class,base.group_portal,1,0,0,0
Loading…
Cancel
Save