From 878a92b528327b8dfad0dd49a80ce73f2ff2db94 Mon Sep 17 00:00:00 2001
From: William Henrotin <whe@odoo.com>
Date: Wed, 1 Jul 2020 15:10:02 +0000
Subject: [PATCH] [FIX] mrp: 'To consume' field disappear

The custom 'to consume' widget wrap the classic float widget into a
<span> tag to add a non editable part to display. The issue this commit
fix is the following: the float widget element is this.$el in
_renderEdit. Appending it to a new element make it loose its link to the
DOM. The custom widget is totally blank.
This commit clone this.$el before surrounding it by the new span

Task : 2278147

closes odoo/odoo#54042

X-original-commit: 01bb1fce77cce3d54cd969e643b7c720673f2b22
Related: odoo/upgrade#1451
Related: odoo/enterprise#11645
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
---
 addons/mrp/static/src/js/mrp_should_consume.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/mrp/static/src/js/mrp_should_consume.js b/addons/mrp/static/src/js/mrp_should_consume.js
index 50b4f3f893bb..d0503eac3f24 100644
--- a/addons/mrp/static/src/js/mrp_should_consume.js
+++ b/addons/mrp/static/src/js/mrp_should_consume.js
@@ -50,7 +50,7 @@ var MrpShouldConsume = FieldFloat.extend({
         // without losing track of the actual input.
         var def = this._super.apply(this, arguments);
         if (this.displayShouldConsume) {
-            var $container = this._addShouldConsume(this.$el, this.should_consume_qty);
+            var $container = this._addShouldConsume(this.$el.clone(), this.should_consume_qty);
             $container.addClass('o_row');
             this.$el = $container;
         };
-- 
GitLab