From e084b5dcf9f360e9120ffbeee89473a0ffaf969d Mon Sep 17 00:00:00 2001 From: Martin Maes Date: Thu, 26 Jan 2023 09:25:31 +0000 Subject: [PATCH] [FIX] mrp: Workorder timer not updating This PR addresses a bug introduced in odoo/odoo/pull/109776 The user can indeed modify the timer, but because a started timer is a readonly field, the timer does not update. Using isDirty allows to check if the user really modified the timer. closes odoo/odoo#111064 X-original-commit: 9aa8752da18ed679d7ddae93682c045204083104 Signed-off-by: William Henrotin (whe) --- addons/mrp/static/src/widgets/timer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mrp/static/src/widgets/timer.js b/addons/mrp/static/src/widgets/timer.js index dc5ac3fe109..feaedccb48b 100644 --- a/addons/mrp/static/src/widgets/timer.js +++ b/addons/mrp/static/src/widgets/timer.js @@ -67,7 +67,8 @@ export class MrpTimer extends Component { } get durationFormatted() { - if(this.props.value!=this.state.duration && this.props.record && !this.readonly){ + if(this.props.value!=this.state.duration && this.props.record && this.props.record.isDirty){ + if (typeof this.props.setDirty==='function')this.props.setDirty(false); this.state.duration=this.props.value } return formatMinutes(this.state.duration);