From dd7c408df30880b517a839b2113d62d16e39a057 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Wed, 22 Apr 2026 08:47:01 -0400 Subject: [PATCH] =?UTF-8?q?feat(configurator):=20Sub=203=20=E2=80=94=20fp.?= =?UTF-8?q?part.catalog=20gains=20default=5Fprocess=5Fid=20+=20action=5Fop?= =?UTF-8?q?en=5Fpart=5Fcomposer=20(Task=202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/fp_part_catalog.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/fusion_plating/fusion_plating_configurator/models/fp_part_catalog.py b/fusion_plating/fusion_plating_configurator/models/fp_part_catalog.py index 96c7ae71..2af3f91a 100644 --- a/fusion_plating/fusion_plating_configurator/models/fp_part_catalog.py +++ b/fusion_plating/fusion_plating_configurator/models/fp_part_catalog.py @@ -151,6 +151,18 @@ class FpPartCatalog(models.Model): '"Inherit" reads the customer\'s default on the partner form.', ) + # Sub 3 — part's cloned process tree. NULL until the user first + # composes a process. The Composer client action sets this to the + # root node of the cloned tree. + default_process_id = fields.Many2one( + 'fusion.plating.process.node', + string='Default Process', + domain="[('part_catalog_id', '=', id), ('node_type', '=', 'recipe')]", + help='Root of this part\'s composed process tree. Use the ' + 'Compose button to edit. When a job runs for this part, ' + 'work orders are generated from this tree.', + ) + # ---- Direct-order defaults (Phase C — C4) ---- x_fc_default_coating_config_id = fields.Many2one( 'fp.coating.config', @@ -378,6 +390,20 @@ class FpPartCatalog(models.Model): else: rec.display_name = rec.name or _('[unnamed part]') + def action_open_part_composer(self): + """Launch the Process Composer client action for this part.""" + self.ensure_one() + return { + 'type': 'ir.actions.client', + 'tag': 'fp_part_process_composer', + 'name': 'Process Composer — %s' % (self.display_name or self.part_number), + 'params': { + 'part_id': self.id, + 'part_display': self.display_name or self.part_number, + }, + 'target': 'current', + } + def action_view_customer(self): self.ensure_one() return {