fix(plating): Process Details tab no longer red on every WO

Bug: in Odoo 19, `required="1"` on a field inside an `invisible="..."`
group still triggers the missing-required-field flag — paints the
whole tab red on EVERY WO regardless of whether the field is shown.

Symptom: Process Details tab was red on masking, racking, oven, etc.
because the rack and mask groups' required fields were always
flagged as missing even when their parent group was hidden.

Fix: switch `required="1"` to `required="x_fc_wo_kind == 'rack'"` and
`required="x_fc_wo_kind == 'mask'"` so the required flag only fires
when the field is actually relevant. Matches the existing pattern
on bath/tank/oven (`required="x_fc_requires_bath"` etc.).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-19 11:52:53 -04:00
parent 7fa54d8fc9
commit f979bc686d

View File

@@ -203,17 +203,23 @@
<field name="x_fc_bake_duration_hours"/>
</group>
</group>
<!-- Rack / de-rack WOs -->
<!-- Rack / de-rack WOs.
Note: required="x_fc_wo_kind == 'rack'" (not "1") —
in Odoo 19 a `required="1"` on a field inside an
invisible group still triggers the missing-required
flag, painting the whole tab red on every WO. -->
<group invisible="x_fc_wo_kind != 'rack'">
<group string="Rack">
<field name="x_fc_rack_id" required="1"/>
<field name="x_fc_rack_id"
required="x_fc_wo_kind == 'rack'"/>
<field name="x_fc_rack_ref"/>
</group>
</group>
<!-- Mask / De-mask WOs -->
<group invisible="x_fc_wo_kind != 'mask'">
<group string="Masking">
<field name="x_fc_masking_material" required="1"/>
<field name="x_fc_masking_material"
required="x_fc_wo_kind == 'mask'"/>
</group>
</group>
<!-- Inspection -->