[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>
This commit is contained in:
William Henrotin
2020-07-03 11:22:16 +00:00
parent 59531bc10a
commit 878a92b528
@@ -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;
};