mirror of https://github.com/OCA/web.git
commit
cc7b0a9d46
|
@ -259,11 +259,12 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateFormView
|
||||||
success_callback: function () {
|
success_callback: function () {
|
||||||
self.trigger_up("create_quick_record", {
|
self.trigger_up("create_quick_record", {
|
||||||
id: record.id,
|
id: record.id,
|
||||||
});
|
callback: function () {
|
||||||
self.model.unsetDirty(self.handle);
|
self.model.unsetDirty(self.handle);
|
||||||
//self._updateButtons();
|
|
||||||
self._enableQuickCreate();
|
self._enableQuickCreate();
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
block: true,
|
block: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -271,8 +272,6 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateFormView
|
||||||
|
|
||||||
_remove: function () {
|
_remove: function () {
|
||||||
if (this._disabled) {
|
if (this._disabled) {
|
||||||
|
|
||||||
// Don't do anything if we are already creating a record
|
|
||||||
return $.Deferred();
|
return $.Deferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,10 +300,11 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateFormView
|
||||||
success_callback: function () {
|
success_callback: function () {
|
||||||
self.trigger_up("update_quick_record", {
|
self.trigger_up("update_quick_record", {
|
||||||
id: record.id,
|
id: record.id,
|
||||||
});
|
callback: function () {
|
||||||
self.model.unsetDirty(self.handle);
|
self.model.unsetDirty(self.handle);
|
||||||
//self._updateButtons();
|
|
||||||
self._enableQuickCreate();
|
self._enableQuickCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
block: true,
|
block: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -592,10 +592,9 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
||||||
{operation: "ADD", id: evt.data.id},
|
{operation: "ADD", id: evt.data.id},
|
||||||
{notifyChange: false}
|
{notifyChange: false}
|
||||||
).then(function () {
|
).then(function () {
|
||||||
if (self.options.auto_save) {
|
self.parent_controller.saveRecord(undefined, {stayInEdit: true}).then(function () {
|
||||||
self.parent_controller.saveRecord(undefined, {stayInEdit: true}).then(function (rrr) {
|
|
||||||
// Because 'create' generates a new state and we can't know these new id we
|
// Because 'create' generates a new state and we can't know these new id we
|
||||||
// need force update the all the current states.
|
// need force update all the current states.
|
||||||
self._setValue(
|
self._setValue(
|
||||||
{operation: "UPDATE", id: evt.data.id},
|
{operation: "UPDATE", id: evt.data.id},
|
||||||
{doNotSetDirty: true}
|
{doNotSetDirty: true}
|
||||||
|
@ -605,9 +604,6 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (evt.data.callback) {
|
|
||||||
evt.data.callback();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// This is used to know when need use 'yellow' color
|
// This is used to know when need use 'yellow' color
|
||||||
|
|
Loading…
Reference in New Issue