# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. """Masking reference attachments — captured at Express order entry, surfaced on the job's masking step (operator workstation) and rolled up to the job form (office). Populated by sale.order.line._fp_apply_express_overrides_to_job. """ from odoo import api, fields, models class FpJobStep(models.Model): _inherit = 'fp.job.step' x_fc_masking_attachment_ids = fields.Many2many( 'ir.attachment', 'fp_job_step_masking_att_rel', 'step_id', 'attachment_id', string='Masking Reference(s)', help='Reference image(s)/PDF(s) of what to mask, attached at order ' 'entry (Express) and shown to the operator on the masking step.', ) class FpJob(models.Model): _inherit = 'fp.job' x_fc_masking_attachment_ids = fields.Many2many( 'ir.attachment', compute='_compute_masking_attachment_ids', string='Masking References', help='All masking reference files across this job\'s masking steps.', ) @api.depends('step_ids.x_fc_masking_attachment_ids') def _compute_masking_attachment_ids(self): for job in self: atts = job.step_ids.mapped('x_fc_masking_attachment_ids') job.x_fc_masking_attachment_ids = [(6, 0, atts.ids)]