fix(fusion_plating_configurator): Express Order customers default customer_rank=1

Customers created from the Express Order / quote-configurator / part-catalog
pickers now default customer_rank=1, so they stay visible in those pickers and
the Customers menu (were landing at rank 0 and disappearing). The field context
is a real dict, not a string — Odoo 19 web_read does with_context(**context),
which throws TypeError on a str and broke the form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-06-03 08:36:38 -04:00
parent a19a299c7f
commit fc3fd513a9
4 changed files with 8 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Plating — Configurator',
'version': '19.0.22.10.0',
'version': '19.0.22.11.0',
'category': 'Manufacturing/Plating',
'summary': 'Quotation configurator with part catalog, coating configs, and formula-based pricing engine.',
'description': """

View File

@@ -79,6 +79,7 @@ class FpPartCatalog(models.Model):
partner_id = fields.Many2one(
'res.partner', string='Customer', required=True, ondelete='cascade',
tracking=True, domain="[('customer_rank', '>', 0)]",
context={'default_customer_rank': 1}, # inline-created customers get rank=1 so they stay visible in this picker
)
part_number = fields.Char(string='Part Number', required=True, tracking=True, help="Customer's part number (e.g. VS-R392007E01).")
revision = fields.Char(

View File

@@ -52,6 +52,7 @@ class FpQuoteConfigurator(models.Model):
partner_id = fields.Many2one(
'res.partner', string='Customer', required=True,
domain="[('customer_rank', '>', 0)]",
context={'default_customer_rank': 1}, # inline-created customers get rank=1 so they stay visible in this picker
)
part_catalog_id = fields.Many2one(
'fp.part.catalog', string='Part (Catalog)',

View File

@@ -62,6 +62,11 @@ class FpDirectOrderWizard(models.Model):
partner_id = fields.Many2one(
'res.partner', string='Customer',
domain="[('customer_rank', '>', 0)]",
# 2026-06-02: default customer_rank=1 so a customer created inline
# (quick-create) from the Express Order form is marked as a customer
# and stays visible in this picker AND the Customers menu (both filter
# customer_rank>0). Without it new customers got rank 0 and vanished.
context={'default_customer_rank': 1},
tracking=True,
)
partner_invoice_id = fields.Many2one(