[MIG] web_drop_target: Migration to 15.0

This commit is contained in:
Jasmin Solanki
2022-02-03 16:22:47 +05:30
parent 2536db8db3
commit 1967bb1f3d
3 changed files with 14 additions and 30 deletions

View File

@@ -2,13 +2,20 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{ {
"name": "Drop target support", "name": "Drop target support",
"version": "14.0.1.0.1", "version": "15.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)", "author": "Therp BV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",
"license": "AGPL-3", "license": "AGPL-3",
"category": "Usability", "category": "Usability",
"summary": "Allows to drag files into Odoo", "summary": "Allows to drag files into Odoo",
"depends": ["web"], "depends": ["web"],
"data": ["views/templates.xml"], "data": [],
"qweb": ["static/src/xml/widgets.xml"], "assets": {
"web.assets_backend": [
"web_drop_target/static/lib/base64js.min.js",
"web_drop_target/static/src/js/web_drop_target.js",
"web_drop_target/static/src/scss/web_drop_target.scss",
],
"web.assets_qweb": ["web_drop_target/static/src/xml/widgets.xml"],
},
} }

View File

@@ -5,7 +5,7 @@
odoo.define("web_drop_target", function (require) { odoo.define("web_drop_target", function (require) {
"use strict"; "use strict";
const ActionManager = require("web.ActionManager"); const AbstractAction = require("web.AbstractAction");
const FormController = require("web.FormController"); const FormController = require("web.FormController");
const core = require("web.core"); const core = require("web.core");
const qweb = core.qweb; const qweb = core.qweb;
@@ -152,10 +152,10 @@ odoo.define("web_drop_target", function (require) {
*/ */
_onBodyFileDragover: function (ev) { _onBodyFileDragover: function (ev) {
ev.preventDefault(); ev.preventDefault();
const actionManager = this.findAncestor(function (ancestor) { const abstractAction = this.findAncestor(function (ancestor) {
return ancestor instanceof ActionManager; return ancestor instanceof AbstractAction;
}); });
const controller = actionManager.currentDialogController; const controller = abstractAction.currentDialogController;
if ( if (
_.isEmpty(this._get_drop_items(ev)) && _.isEmpty(this._get_drop_items(ev)) &&
this._checkDragOver() && this._checkDragOver() &&

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template
id="assets_backend"
name="web_drop_target assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/web_drop_target/static/lib/base64js.min.js"
/>
<script
type="text/javascript"
src="/web_drop_target/static/src/js/web_drop_target.js"
/>
<link
rel="stylesheet"
href="/web_drop_target/static/src/scss/web_drop_target.scss"
/>
</xpath>
</template>
</odoo>