feat(sub12a): res.company.x_fc_default_recipe_editor setting

Per-company default for which editor opens for new recipes / recipes
with preferred_editor=auto. Defaults to 'tree' to preserve existing
behavior. Surfaces in Settings → Fusion Plating → Recipe Editor.

Naming follows the existing x_fc_* convention used throughout
res_company.py for company-level Fusion Plating defaults.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-27 20:34:12 -04:00
parent 91681d722e
commit 95debabc28
3 changed files with 29 additions and 0 deletions

View File

@@ -161,3 +161,15 @@ class ResCompany(models.Model):
string='CGP Registered',
help='Show the Controlled Goods Program logo on certificates.',
)
# =====================================================================
# Sub 12a — Default recipe editor
# =====================================================================
x_fc_default_recipe_editor = fields.Selection(
[('tree', 'Tree Editor'), ('simple', 'Simple Editor')],
string='Default Recipe Editor',
default='tree',
help='Which editor opens when a new recipe is created OR when a '
'recipe with preferred_editor=auto is selected. Per-recipe '
'preferred_editor (tree/simple) overrides this.',
)

View File

@@ -55,3 +55,10 @@ class ResConfigSettings(models.TransientModel):
related='company_id.x_fc_default_area_uom',
readonly=False, string='Area Unit',
)
# ----- Sub 12a — recipe editor default ------------------------------
x_fc_default_recipe_editor = fields.Selection(
related='company_id.x_fc_default_recipe_editor',
readonly=False,
string='Default Recipe Editor',
)

View File

@@ -38,6 +38,16 @@
</setting>
</block>
<block title="Recipe Editor"
name="fp_recipe_editor_settings"
help="Choose which editor opens when a recipe is created or when a recipe's editor preference is 'Auto'.">
<setting id="fp_default_recipe_editor"
string="Default Recipe Editor"
help="Tree Editor: hierarchical drag-drop tree with sub-processes (existing). Simple Editor: flat ordered list with a step library on the side (Steelhead-style). Per-recipe preferred_editor (tree/simple) overrides this default.">
<field name="x_fc_default_recipe_editor"/>
</setting>
</block>
<block title="Units of Measure"
name="fp_uom_settings"
help="Default units used wherever the shop records measurements. North-American aerospace shops typically pick °F + mils; metric shops pick °C + microns. Each new record (work order, oven, bath log, thickness reading) inherits these defaults; per-record overrides remain possible.">