Files
Odoo-Modules/fusion_plating/fusion_plating/security/fp_menu_visibility.xml
gsinghpal a19a299c7f feat(fusion_plating): Office User grants Contact Creation + rack-load Phase 1 models
- group_fp_office_user now implies base.group_partner_manager so every office/
  manager role can create contacts (Technicians excluded). Fixes the live
  "create a company contact, it doesn't show" report (AccessError on save).
- New fp.rack.load + fp.rack.load.line models (multi-rack split at Racking,
  Phase 1) with sequence, ACLs, equal-split math, and tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 08:36:27 -04:00

82 lines
4.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
2026-05-24 — Hide non-essential app menus from Technicians.
Per user request: technicians should see ONLY the apps they actually
need on the tablet — Discuss, To-do, Plating, AI, Maintenance, Time
Off. Every other top-level app menu is restricted to a new "office
user" group implied by every fp role ABOVE technician.
THIS FILE only declares the office_user group + the implied_ids
chain. The actual menu group-restriction is applied via a
post_init_hook / post-migrate script (see fusion_plating/__init__.py
and migrations/19.0.21.4.0/post-migrate.py), because cross-module
<menuitem id="other_module.X" groups="..."/> overrides require the
other module in `depends`, which would lock us into hard
dependencies on calendar/sale/hr/etc. The hook uses
env.ref(..., raise_if_not_found=False) — modules that aren't
installed are silently skipped.
Why a separate office_user group instead of !technician?
Manager → ... → Technician via implied_ids, so a Manager IS a
technician for group-matching purposes. A "!technician" filter would
hide menus from managers too. The office_user pattern flips that:
we add a new group that's implied by manager+ (and explicitly NOT
by technician), then require it on the menus we want to hide.
-->
<odoo>
<data>
<!-- ============================================================ -->
<!-- New marker group: "Office User" — implied by every non- -->
<!-- technician fp role. -->
<!-- ============================================================ -->
<record id="group_fp_office_user" model="res.groups">
<field name="name">Plating: Office User (sees back-office menus)</field>
<field name="privilege_id"
ref="fusion_plating.res_groups_privilege_fusion_plating"/>
<field name="sequence">90</field>
<!-- 2026-06-02: office_user also grants "Contact Creation"
(base.group_partner_manager) so back-office staff + managers
can create contacts/companies. office_user is implied by every
fp role ABOVE Technician (Sales Rep, Shop Manager, Manager,
Quality Manager, Owner; Sales Manager via Sales Rep), so they
all inherit contact-creation. Pure Technicians do NOT imply
office_user, so they stay unable to create contacts. -->
<field name="implied_ids" eval="[(4, ref('base.group_partner_manager'))]"/>
<field name="comment">Marker group that controls visibility of
non-tablet app menus (Calendar, Sales, Inventory, etc.).
Implied by every fp role above Technician (Owner, Manager,
Quality Manager, Shop Manager, Sales Rep, Estimator).
Pure Technicians don't have it, so they only see the
tablet apps (Plating, Discuss, To-do, AI, Maintenance,
Time Off).</field>
</record>
<!-- ============================================================ -->
<!-- Add office_user to implied_ids of each above-technician role -->
<!-- These records UPDATE existing groups (additive Command.link) -->
<!-- ============================================================ -->
<record id="group_fp_sales_rep" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_fp_office_user'))]"/>
</record>
<record id="group_fp_shop_manager_v2" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_fp_office_user'))]"/>
</record>
<record id="group_fp_manager" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_fp_office_user'))]"/>
</record>
<record id="group_fp_quality_manager" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_fp_office_user'))]"/>
</record>
<record id="group_fp_owner" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_fp_office_user'))]"/>
</record>
</data>
</odoo>