fix(fusion_claims): OWL wizard review fixes (statement handler, scss borders, tech guard)
- Move the call-type select handler into onCallType() — OWL cannot compile a multi-statement inline t-on body (was a render-breaking crash on mount). - Replace color-mix() inside border shorthands with var(--sb-border) (Odoo-19 SCSS drops color-mix in a border shorthand). - Technician placeholder option value '' (not 'false') so the required-tech guard isn't bypassed. - Remove dead setTiming(); null-coalesce the refdata onWillStart load. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,8 +25,10 @@ export class ServiceBookingWizard extends Component {
|
||||
onWillStart(async () => {
|
||||
const r = await rpc("/fusion_claims/service_booking/refdata", {});
|
||||
Object.assign(this.state, {
|
||||
technicians: r.technicians, calloutRates: r.callout_rates,
|
||||
perKm: r.per_km, labour: r.labour,
|
||||
technicians: r.technicians || [],
|
||||
calloutRates: r.callout_rates || [],
|
||||
perKm: r.per_km ?? 0.70,
|
||||
labour: r.labour || this.state.labour,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -59,9 +61,13 @@ export class ServiceBookingWizard extends Component {
|
||||
this.state.device = ev.target.value;
|
||||
this.state.category = ev.target.value === "lift" ? "lift" : "standard";
|
||||
}
|
||||
onCallType(ev) {
|
||||
const r = this.state.calloutRates.find(x => x.code === ev.target.value);
|
||||
if (r) { this.state.category = r.category; this.state.timing = r.timing; }
|
||||
}
|
||||
setCust(m) { this.state.custMode = m; }
|
||||
setTiming(t) { this.state.timing = t; }
|
||||
setAmpm(v) { this.state.ampm = v; }
|
||||
|
||||
toggleInShop() { this.state.inShop = !this.state.inShop; }
|
||||
_timeStartFloat() { return (this.state.hour % 12) + (this.state.ampm === "PM" ? 12 : 0) + this.state.minute / 60; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user