# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) # Part of the Fusion Plating product family. from odoo import fields, models class ResCompany(models.Model): _inherit = 'res.company' # Contract Review signer rosters. Company-scoped so multi-tenant # Odoo deployments keep their own QA team isolated. Managed from # Settings → Fusion Plating → Contract Review. Stored here (not # as groups) so granting the right to sign a Contract Review does # not cascade any other permission elsewhere in Odoo. x_fc_qa_assistant_user_ids = fields.Many2many( 'res.users', 'res_company_qa_assistant_rel', 'company_id', 'user_id', string='QA Assistant Signers', domain=[('share', '=', False)], help='Users authorised to sign Section 2.0 (Planning / Production ' 'Review) on a Contract Review. Plating Managers can sign ' 'regardless of this list.', ) x_fc_qa_manager_user_ids = fields.Many2many( 'res.users', 'res_company_qa_manager_rel', 'company_id', 'user_id', string='QA Manager Signers', domain=[('share', '=', False)], help='Users authorised to sign Section 3.0 (Quality Review) on a ' 'Contract Review. Plating Managers can sign regardless of ' 'this list.', ) def _fp_get_qa_signers(self, section): """Return effective signer roster for Section 2.0 or 3.0. Central helper so Sub 6 (per-customer / contact profiles) can layer overrides without touching the sign action call sites. """ self.ensure_one() if section == 20: return self.x_fc_qa_assistant_user_ids if section == 30: return self.x_fc_qa_manager_user_ids return self.env['res.users']