From 95debabc28e9fd326d73b506d5d0700be14ff7a1 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Mon, 27 Apr 2026 20:34:12 -0400 Subject: [PATCH] feat(sub12a): res.company.x_fc_default_recipe_editor setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- fusion_plating/fusion_plating/models/res_company.py | 12 ++++++++++++ .../fusion_plating/models/res_config_settings.py | 7 +++++++ .../views/res_config_settings_views.xml | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/fusion_plating/fusion_plating/models/res_company.py b/fusion_plating/fusion_plating/models/res_company.py index aa1733c6..3eab66f3 100644 --- a/fusion_plating/fusion_plating/models/res_company.py +++ b/fusion_plating/fusion_plating/models/res_company.py @@ -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.', + ) diff --git a/fusion_plating/fusion_plating/models/res_config_settings.py b/fusion_plating/fusion_plating/models/res_config_settings.py index fcc62866..c8d18d83 100644 --- a/fusion_plating/fusion_plating/models/res_config_settings.py +++ b/fusion_plating/fusion_plating/models/res_config_settings.py @@ -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', + ) diff --git a/fusion_plating/fusion_plating/views/res_config_settings_views.xml b/fusion_plating/fusion_plating/views/res_config_settings_views.xml index 62bea3e5..81dd3456 100644 --- a/fusion_plating/fusion_plating/views/res_config_settings_views.xml +++ b/fusion_plating/fusion_plating/views/res_config_settings_views.xml @@ -38,6 +38,16 @@ + + + + + +