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:
@@ -1,2 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import test_delivery_shipping_fields
|
||||
from . import test_technician_delivery_acl
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user