Files
Odoo-Modules/fusion_plating/fusion_plating/models/res_config_settings.py
gsinghpal 0568d8ae87 fix(plating-perms): widen settings landing field to ir.actions.actions
res.config.settings.x_fc_default_landing_action_id is related= to
res.company.x_fc_default_landing_action_id, which was widened from
ir.actions.act_window to ir.actions.actions in the Phase I post-deploy
fixes (so the picker accepts both window AND client actions). The
settings field's comodel was left at the old type and tripped on
opening Settings: 'Wrong value for ...: ir.actions.actions()' when
the related compute tried to write the client-action value into the
narrower settings field.

Module version: 19.0.21.1.2 -> 19.0.21.1.3

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 10:11:40 -04:00

77 lines
2.8 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
"""Expose Fusion Plating company-level settings on the Settings page.
Today this only carries the default timezone, but it's the single
place to add new shop-wide preferences (default facility, currency
overrides, etc.).
"""
_inherit = 'res.config.settings'
x_fc_default_tz = fields.Selection(
related='company_id.x_fc_default_tz',
readonly=False,
string='Fusion Plating Timezone',
)
x_fc_default_mastery_threshold = fields.Integer(
related='company_id.x_fc_default_mastery_threshold',
readonly=False,
string='Default Mastery Threshold',
)
# ----- Unit-of-measure defaults --------------------------------------
x_fc_default_temp_uom = fields.Selection(
related='company_id.x_fc_default_temp_uom',
readonly=False, string='Temperature Unit',
)
x_fc_default_thickness_uom = fields.Selection(
related='company_id.x_fc_default_thickness_uom',
readonly=False, string='Thickness Unit',
)
x_fc_default_volume_uom = fields.Selection(
related='company_id.x_fc_default_volume_uom',
readonly=False, string='Volume Unit',
)
x_fc_default_mass_uom = fields.Selection(
related='company_id.x_fc_default_mass_uom',
readonly=False, string='Mass Unit',
)
x_fc_default_pressure_uom = fields.Selection(
related='company_id.x_fc_default_pressure_uom',
readonly=False, string='Pressure Unit',
)
x_fc_default_current_density_uom = fields.Selection(
related='company_id.x_fc_default_current_density_uom',
readonly=False, string='Current Density Unit',
)
x_fc_default_area_uom = fields.Selection(
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',
)
# ----- Phase 1 — Plating landing page default -----------------------
# Comodel MUST match res.company.x_fc_default_landing_action_id, which
# was widened to ir.actions.actions in the post-deploy fixes so the
# picker accepts both window AND client actions (Manager Desk, Plant
# Kanban, Quality Dashboard are all client actions).
x_fc_default_landing_action_id = fields.Many2one(
'ir.actions.actions',
related='company_id.x_fc_default_landing_action_id',
readonly=False,
string='Default Plating Landing Page',
)