diff --git a/fusion_plating/fusion_plating/models/fp_process_node.py b/fusion_plating/fusion_plating/models/fp_process_node.py index 1784f46a..99307645 100644 --- a/fusion_plating/fusion_plating/models/fp_process_node.py +++ b/fusion_plating/fusion_plating/models/fp_process_node.py @@ -738,6 +738,25 @@ class FpProcessNode(models.Model): # ---- Actions ------------------------------------------------------------- + # ---- Express Orders helper (2026-05-26) ---- + def _fp_all_nodes_with_kind(self, kinds): + """Return all descendants (and self) where default_kind ∈ kinds. + + Uses _parent_store's parent_path for a single SQL hit via the + 'child_of' operator. No Python tree walking. + + :param kinds: tuple/list of default_kind strings, e.g. + ('masking', 'de_masking') or ('baking',) + :return: recordset of matching fusion.plating.process.node rows + """ + self.ensure_one() + if not kinds: + return self.browse([]) + return self.search([ + ('id', 'child_of', self.id), + ('default_kind', 'in', list(kinds)), + ]) + def action_open_tree_editor(self): """Open the OWL recipe tree editor for this recipe.""" self.ensure_one()