feat(plating): B1 - recipe walker _fp_all_nodes_with_kind for Express Orders
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user