From 0296c93eddfd82a9df46d10ba34da26b3b814a55 Mon Sep 17 00:00:00 2001 From: JF Aubert Date: Mon, 12 Dec 2022 13:57:04 +0000 Subject: [PATCH] [FIX] mrp: fix workorder timer for sample data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_working_duration can't work on generated samples. closes odoo/odoo#107934 Task: 3098709 X-original-commit: 642ca37e4e5a3db6ef7929a25850fafc499e4257 Signed-off-by: William Henrotin (whe) Signed-off-by: Jean-François Aubert --- addons/mrp/static/src/widgets/timer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/static/src/widgets/timer.js b/addons/mrp/static/src/widgets/timer.js index a17b409d4d7..7c39c65dec1 100644 --- a/addons/mrp/static/src/widgets/timer.js +++ b/addons/mrp/static/src/widgets/timer.js @@ -43,7 +43,7 @@ export class MrpTimer extends Component { : this.props.record.data.is_user_working; onWillStart(async () => { - if(this.props.ongoing === undefined && this.props.record.data.state == "progress") { + if(this.props.ongoing === undefined && !this.props.record.model.useSampleModel && this.props.record.data.state == "progress") { const additionalDuration = await this.orm.call('mrp.workorder', 'get_working_duration', [this.props.record.resId]); this.state.duration += additionalDuration; }