mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_widget_one2many_product_picker: Don't save in 'refresh' time
(cherry picked from commit aca8ae4217)
This commit is contained in:
committed by
Daniel Reis
parent
0c2be8f166
commit
316cb0a0f5
@@ -98,6 +98,9 @@ odoo.define(
|
||||
},
|
||||
|
||||
canBeUpdated: function() {
|
||||
if (!this.getParent()) {
|
||||
return false;
|
||||
}
|
||||
var model = this.getParent().getBasicFieldParams().model;
|
||||
for (var widget of this.widgets) {
|
||||
if (!widget.state) {
|
||||
@@ -148,7 +151,10 @@ odoo.define(
|
||||
});
|
||||
},
|
||||
|
||||
getWidgetsWithoutOnchange: function(product_id) {
|
||||
getWidgetsWithoutOnchange: function() {
|
||||
if (!this.getParent()) {
|
||||
return false;
|
||||
}
|
||||
var model = this.getParent().getBasicFieldParams().model;
|
||||
return _.filter(this.widgets, function(item) {
|
||||
return (
|
||||
|
||||
@@ -809,7 +809,12 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
||||
*/
|
||||
_saveDocument: function(ids_to_update) {
|
||||
var widgets = this.renderer.getWidgetsWithoutOnchange();
|
||||
if (!_.isEmpty(this._ids_to_wait) || _.isEmpty(ids_to_update) || !_.isEmpty(widgets)) {
|
||||
if (
|
||||
widgets === false ||
|
||||
!_.isEmpty(this._ids_to_wait) ||
|
||||
_.isEmpty(ids_to_update) ||
|
||||
!_.isEmpty(widgets)
|
||||
) {
|
||||
return this._saveChain;
|
||||
}
|
||||
var self = this;
|
||||
@@ -1135,11 +1140,23 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
||||
|
||||
_onResumeAutoSave: function() {
|
||||
// Check if can resume
|
||||
<<<<<<< HEAD
|
||||
if (this.$('.oe_product_picker_quick_modif_price').is(':visible') || this.$('.oe_search_input').is(':focus') || this.$('.oe_flip_card.active').length) {
|
||||
=======
|
||||
if (
|
||||
!this._is_auto_save_paused ||
|
||||
this.$(".oe_product_picker_quick_modif_price").is(":visible") ||
|
||||
this.$(".oe_search_input").is(":focus") ||
|
||||
this.$(".oe_flip_card.active").length
|
||||
) {
|
||||
>>>>>>> aca8ae42 ([FIX] web_widget_one2many_product_picker: Don't save in 'refresh' time)
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._need_resume_auto_save) {
|
||||
if (this._auto_save_timeout) {
|
||||
clearTimeout(this._auto_save_timeout);
|
||||
}
|
||||
this._auto_save_timeout = setTimeout(
|
||||
this._saveDocument.bind(this),
|
||||
this.options.auto_save_delay,
|
||||
|
||||
Reference in New Issue
Block a user