feat(logistics): technicians can create/edit delivery, POD, chain-of-custody

Spec D5 delivery-completion set. Dispatch records (route/vehicle/pickup)
stay read-only for technicians.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-29 09:13:11 -04:00
parent d37f10f1c3
commit be7256ce4c
4 changed files with 38 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Plating — Logistics',
'version': '19.0.3.11.1',
'version': '19.0.3.11.2',
'category': 'Manufacturing/Plating',
'summary': (
'Pickup & delivery for plating shops: vehicle master, driver '

View File

@@ -5,7 +5,7 @@ access_fp_vehicle_manager,fp.vehicle.manager,model_fusion_plating_vehicle,fusion
access_fp_pickup_request_operator,fp.pickup.request.operator,model_fusion_plating_pickup_request,fusion_plating.group_fp_technician,1,0,0,0
access_fp_pickup_request_supervisor,fp.pickup.request.supervisor,model_fusion_plating_pickup_request,fusion_plating.group_fp_shop_manager_v2,1,1,1,0
access_fp_pickup_request_manager,fp.pickup.request.manager,model_fusion_plating_pickup_request,fusion_plating.group_fp_manager,1,1,1,1
access_fp_delivery_operator,fp.delivery.operator,model_fusion_plating_delivery,fusion_plating.group_fp_technician,1,0,0,0
access_fp_delivery_operator,fp.delivery.operator,model_fusion_plating_delivery,fusion_plating.group_fp_technician,1,1,1,0
access_fp_delivery_supervisor,fp.delivery.supervisor,model_fusion_plating_delivery,fusion_plating.group_fp_shop_manager_v2,1,1,1,0
access_fp_delivery_manager,fp.delivery.manager,model_fusion_plating_delivery,fusion_plating.group_fp_manager,1,1,1,1
access_fp_route_operator,fp.route.operator,model_fusion_plating_route,fusion_plating.group_fp_technician,1,0,0,0
@@ -14,9 +14,9 @@ access_fp_route_manager,fp.route.manager,model_fusion_plating_route,fusion_plati
access_fp_route_stop_operator,fp.route.stop.operator,model_fusion_plating_route_stop,fusion_plating.group_fp_technician,1,0,0,0
access_fp_route_stop_supervisor,fp.route.stop.supervisor,model_fusion_plating_route_stop,fusion_plating.group_fp_shop_manager_v2,1,1,1,0
access_fp_route_stop_manager,fp.route.stop.manager,model_fusion_plating_route_stop,fusion_plating.group_fp_manager,1,1,1,1
access_fp_chain_of_custody_operator,fp.chain.of.custody.operator,model_fusion_plating_chain_of_custody,fusion_plating.group_fp_technician,1,0,0,0
access_fp_chain_of_custody_operator,fp.chain.of.custody.operator,model_fusion_plating_chain_of_custody,fusion_plating.group_fp_technician,1,1,1,0
access_fp_chain_of_custody_supervisor,fp.chain.of.custody.supervisor,model_fusion_plating_chain_of_custody,fusion_plating.group_fp_shop_manager_v2,1,1,1,0
access_fp_chain_of_custody_manager,fp.chain.of.custody.manager,model_fusion_plating_chain_of_custody,fusion_plating.group_fp_manager,1,1,1,1
access_fp_proof_of_delivery_operator,fp.proof.of.delivery.operator,model_fusion_plating_proof_of_delivery,fusion_plating.group_fp_technician,1,0,0,0
access_fp_proof_of_delivery_operator,fp.proof.of.delivery.operator,model_fusion_plating_proof_of_delivery,fusion_plating.group_fp_technician,1,1,1,0
access_fp_proof_of_delivery_supervisor,fp.proof.of.delivery.supervisor,model_fusion_plating_proof_of_delivery,fusion_plating.group_fp_shop_manager_v2,1,1,1,0
access_fp_proof_of_delivery_manager,fp.proof.of.delivery.manager,model_fusion_plating_proof_of_delivery,fusion_plating.group_fp_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_fp_pickup_request_operator fp.pickup.request.operator model_fusion_plating_pickup_request fusion_plating.group_fp_technician 1 0 0 0
6 access_fp_pickup_request_supervisor fp.pickup.request.supervisor model_fusion_plating_pickup_request fusion_plating.group_fp_shop_manager_v2 1 1 1 0
7 access_fp_pickup_request_manager fp.pickup.request.manager model_fusion_plating_pickup_request fusion_plating.group_fp_manager 1 1 1 1
8 access_fp_delivery_operator fp.delivery.operator model_fusion_plating_delivery fusion_plating.group_fp_technician 1 0 1 0 1 0
9 access_fp_delivery_supervisor fp.delivery.supervisor model_fusion_plating_delivery fusion_plating.group_fp_shop_manager_v2 1 1 1 0
10 access_fp_delivery_manager fp.delivery.manager model_fusion_plating_delivery fusion_plating.group_fp_manager 1 1 1 1
11 access_fp_route_operator fp.route.operator model_fusion_plating_route fusion_plating.group_fp_technician 1 0 0 0
14 access_fp_route_stop_operator fp.route.stop.operator model_fusion_plating_route_stop fusion_plating.group_fp_technician 1 0 0 0
15 access_fp_route_stop_supervisor fp.route.stop.supervisor model_fusion_plating_route_stop fusion_plating.group_fp_shop_manager_v2 1 1 1 0
16 access_fp_route_stop_manager fp.route.stop.manager model_fusion_plating_route_stop fusion_plating.group_fp_manager 1 1 1 1
17 access_fp_chain_of_custody_operator fp.chain.of.custody.operator model_fusion_plating_chain_of_custody fusion_plating.group_fp_technician 1 0 1 0 1 0
18 access_fp_chain_of_custody_supervisor fp.chain.of.custody.supervisor model_fusion_plating_chain_of_custody fusion_plating.group_fp_shop_manager_v2 1 1 1 0
19 access_fp_chain_of_custody_manager fp.chain.of.custody.manager model_fusion_plating_chain_of_custody fusion_plating.group_fp_manager 1 1 1 1
20 access_fp_proof_of_delivery_operator fp.proof.of.delivery.operator model_fusion_plating_proof_of_delivery fusion_plating.group_fp_technician 1 0 1 0 1 0
21 access_fp_proof_of_delivery_supervisor fp.proof.of.delivery.supervisor model_fusion_plating_proof_of_delivery fusion_plating.group_fp_shop_manager_v2 1 1 1 0
22 access_fp_proof_of_delivery_manager fp.proof.of.delivery.manager model_fusion_plating_proof_of_delivery fusion_plating.group_fp_manager 1 1 1 1

View File

@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
from . import test_delivery_shipping_fields
from . import test_technician_delivery_acl

View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
"""Technician can create/edit delivery-completion records (spec D5).
Spec: docs/superpowers/specs/2026-05-29-technician-receiving-shipping-tablet-design.md
"""
from odoo.tests.common import TransactionCase
from odoo.exceptions import AccessError
class TestTechnicianDeliveryAcl(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner = cls.env['res.partner'].create({'name': 'DelCust'})
cls.tech = cls.env['res.users'].create({
'name': 'Tech Del',
'login': 'tech_acl_del',
'group_ids': [(6, 0, [
cls.env.ref('fusion_plating.group_fp_technician').id,
])],
})
def test_technician_can_create_delivery(self):
try:
delivery = self.env['fusion.plating.delivery'].with_user(
self.tech,
).create({'partner_id': self.partner.id})
except AccessError as e:
self.fail("Technician blocked creating delivery: %s" % e)
self.assertTrue(delivery.id)