feat(plating): wire deferred UoM defaults — bake oven, bake window, coating, tank
Follow-up to the company-level UoM defaults commit. Wires four more
unit-bearing fields to inherit from res.company defaults at create-time.
**1. fp.bake.oven**
• New `target_temp_uom` (°F / °C) — defaults from
company.x_fc_default_temp_uom.
• View: target_temp_min / max now render with a unit picker on the
same row instead of unitless floats. Rule of thumb: "350–380 °F".
**2. fp.bake.window**
• New `bake_temp_uom` — defaults from company.x_fc_default_temp_uom.
• View: replaced hardcoded `°F` span with a live unit picker so the
label matches whatever unit was actually recorded.
**3. fp.coating.config**
• New `bake_temperature_uom` — defaults from company.
• Removed hardcoded "Bake Temperature (°F)" label; the field is
now unit-agnostic and the unit travels with the value.
**4. fp.tank.volume_uom**
• Default now derives from company.x_fc_default_volume_uom via a
small mapping (gal → gal_us, L → l, imp_gal → gal_imp). The
selection itself stays the same — tanks already supported all
common volume units; we just pre-pick the right one per company.
**Verified end-to-end** (scripts/fp_uom_smoke2.py):
• Switching company default to °C + Litres
• New oven gets C ✓
• New bake window gets C ✓
• New coating config gets C ✓
• New tank gets `l` ✓ (mapped from company `L`)
• Restored defaults afterwards
Existing records keep their stored uom — no surprise mutation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,8 +42,14 @@
|
||||
<field name="work_center_id"/>
|
||||
</group>
|
||||
<group string="Targets">
|
||||
<field name="target_temp_min"/>
|
||||
<field name="target_temp_max"/>
|
||||
<label for="target_temp_min"/>
|
||||
<div class="o_row">
|
||||
<field name="target_temp_min" nolabel="1" class="oe_inline"/>
|
||||
<span class="ms-1 me-2">to</span>
|
||||
<field name="target_temp_max" nolabel="1" class="oe_inline"/>
|
||||
<field name="target_temp_uom" nolabel="1"
|
||||
class="oe_inline ms-1"/>
|
||||
</div>
|
||||
<field name="chart_recorder_ref"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
|
||||
@@ -93,7 +93,8 @@
|
||||
<label for="bake_temp"/>
|
||||
<div class="o_row">
|
||||
<field name="bake_temp" nolabel="1" class="oe_inline"/>
|
||||
<span class="ms-1">°F</span>
|
||||
<field name="bake_temp_uom" nolabel="1"
|
||||
class="oe_inline ms-1"/>
|
||||
</div>
|
||||
<label for="bake_duration_hours"/>
|
||||
<div class="o_row">
|
||||
|
||||
Reference in New Issue
Block a user