feat(plating): B1 - recipe walker _fp_all_nodes_with_kind for Express Orders

This commit is contained in:
gsinghpal
2026-05-26 21:11:15 -04:00
parent 01df46f79f
commit baf5c4158f

View File

@@ -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()