3
0
Fork 0

Merge PR #2090 into 13.0

Signed-off-by pedrobaeza
13.0
OCA-git-bot 2022-01-26 19:06:19 +00:00
commit 51a3a5c6c5
1 changed files with 17 additions and 2 deletions

View File

@ -5,7 +5,7 @@
odoo.define("web_drop_target", function(require) {
"use strict";
const ActionManager = require("web.ActionManager");
const FormController = require("web.FormController");
const core = require("web.core");
const qweb = core.qweb;
@ -140,7 +140,15 @@ odoo.define("web_drop_target", function(require) {
*/
_onBodyFileDragover: function(ev) {
ev.preventDefault();
if (_.isEmpty(this._get_drop_items(ev))) {
const actionManager = this.findAncestor(function(ancestor) {
return ancestor instanceof ActionManager;
});
const controller = actionManager.currentDialogController;
if (
_.isEmpty(this._get_drop_items(ev)) &&
this._checkDragOver() &&
(controller == undefined || controller.jsID === this.controllerID)
) {
const drop_zone_offset = this.$drop_zone.offset();
const overlay_css = {
top: drop_zone_offset.top,
@ -156,6 +164,10 @@ odoo.define("web_drop_target", function(require) {
}
},
_checkDragOver: function() {
return true;
},
/**
* @private
* @param {MouseEvent} ev
@ -309,6 +321,9 @@ odoo.define("web_drop_target", function(require) {
_get_record_id: function() {
return this.renderer.state.res_id;
},
_checkDragOver: function() {
return this.renderer.chatter;
},
})
);