feat(jobs): add x_fc_use_native_jobs flag + SO confirm hook (Task 2.5)

Settings flag controls which SO confirm path runs. Default False
keeps the legacy bridge_mrp / mrp.production flow on entech.
Setting True diverts confirm into fp.job creation.

Both hooks coexist — bridge_mrp's _fp_auto_create_mo and the new
_fp_auto_create_job — but only one creates records per SO confirm
(controlled by the flag).

The new _fp_auto_create_job mirrors bridge_mrp's grouping logic
(x_fc_wo_group_tag), recipe resolution (coating → part), and
traceability fields (origin, sale_order_line_ids).

Settings UI shows the flag in a 'Fusion Plating Jobs' app section
of the standard Configuration menu.

3 new tests cover: flag off no-op, flag on creates job, idempotency.

Manifest 19.0.1.3.0 → 19.0.1.4.0.

Part of: native job model migration (spec 2026-04-25)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-24 23:22:41 -04:00
parent 3b7eae9b78
commit 294cea0e50
6 changed files with 243 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_res_config_settings_jobs" model="ir.ui.view">
<field name="name">res.config.settings.fp.jobs</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="Fusion Plating Jobs" string="Fusion Plating Jobs" name="fusion_plating_jobs">
<block title="Native Job Migration" name="fp_jobs_migration">
<setting id="fp_use_native_jobs"
string="Use Native Plating Jobs"
help="When enabled, SO confirmation creates fp.job records instead of mrp.production. Phase-2 migration toggle.">
<field name="x_fc_use_native_jobs"/>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>