feat(promote-customer-spec): Phase C — pricing, quality, job, cert re-keyed

Pricing:
- Quality inherit on fp.pricing.rule adds customer_spec_id + recipe_id
- Quality inherit on fp.quote.configurator adds customer_spec_id field
  + extends _find_matching_rule with priority chain:
    spec (+8) > recipe (+6) > coating (+4) > material (+2) > cert (+1)
- View inherit surfaces both new pickers on the rule form

Quality points:
- fp.quality.point now has customer_spec_ids + recipe_ids M2M filters
- Matcher (_matches + _find_matching) accepts new args
- Hook overrides on SO confirm + job confirm/done + step finish
  pass spec/recipe context through to the matcher
- View surfaces both new M2M widgets

Job:
- jobs/sale_order.py wires x_fc_customer_spec_id from SO line to
  fp.job.customer_spec_id on action_confirm

Cert:
- Quality inherit on fp.certificate adds customer_spec_id field +
  create() override auto-fills spec_reference from spec.code+revision
  Resolution priority: explicit spec_reference > cert.customer_spec_id
  > SO line spec (with print_on_cert) > legacy coating fallback

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-15 01:23:06 -04:00
parent 7cafab1b9f
commit c637f82ae2
11 changed files with 278 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
Adds Specification + Recipe pickers to the pricing rule form.
Both fields live on this module's inherit (the customer.spec model
lives here).
-->
<odoo>
<record id="view_fp_pricing_rule_form_quality_inherit" model="ir.ui.view">
<field name="name">fp.pricing.rule.form.quality.spec.inherit</field>
<field name="model">fp.pricing.rule</field>
<field name="inherit_id"
ref="fusion_plating_configurator.view_fp_pricing_rule_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='coating_config_id']"
position="after">
<field name="customer_spec_id"
options="{'no_quick_create': True}"/>
<field name="recipe_id"
options="{'no_quick_create': True}"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -65,6 +65,10 @@
placeholder="All parts if empty"/>
</group>
<group>
<field name="customer_spec_ids" widget="many2many_tags"
placeholder="All specs if empty"/>
<field name="recipe_ids" widget="many2many_tags"
placeholder="All recipes if empty"/>
<field name="coating_config_ids" widget="many2many_tags"
placeholder="All coatings if empty"/>
<field name="step_kind"