[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) <whe@odoo.com>
This commit is contained in:
Martin Maes
2023-01-26 18:51:34 +01:00
parent 84a445a8e0
commit e084b5dcf9
+2 -1
View File
@@ -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);