mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_widget_url_advanced: Migration to 15.0
This commit is contained in:
@@ -5,11 +5,14 @@
|
|||||||
"summary": "This module extends URL widget "
|
"summary": "This module extends URL widget "
|
||||||
"for displaying anchors with custom labels.",
|
"for displaying anchors with custom labels.",
|
||||||
"category": "Web",
|
"category": "Web",
|
||||||
"version": "14.0.1.0.1",
|
"version": "15.0.1.0.0",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/web",
|
"website": "https://github.com/OCA/web",
|
||||||
"depends": ["web"],
|
"depends": ["web"],
|
||||||
"data": ["templates/assets.xml"],
|
"data": [],
|
||||||
|
"assets": {
|
||||||
|
"web.assets_backend": ["web_widget_url_advanced/static/src/js/url_widget.js"],
|
||||||
|
},
|
||||||
"installable": True,
|
"installable": True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). */
|
|||||||
|
|
||||||
odoo.define("web_widget_url_advanced", function (require) {
|
odoo.define("web_widget_url_advanced", function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var basic_fields = require("web.basic_fields");
|
var basic_fields = require("web.basic_fields");
|
||||||
|
|
||||||
basic_fields.UrlWidget.include({
|
basic_fields.UrlWidget.include({
|
||||||
@@ -37,11 +36,14 @@ odoo.define("web_widget_url_advanced", function (require) {
|
|||||||
*/
|
*/
|
||||||
_renderReadonly: function () {
|
_renderReadonly: function () {
|
||||||
// Base widget uses `this.attrs.text` instead of `this.value` when available.
|
// Base widget uses `this.attrs.text` instead of `this.value` when available.
|
||||||
|
// TODO: To check better way for update link
|
||||||
this.attrs.text = this._get_text();
|
this.attrs.text = this._get_text();
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
var prefix = this.attrs.prefix_name || this.attrs.options.prefix_name;
|
var prefix = this.attrs.prefix_name || this.attrs.options.prefix_name;
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
this.$el.attr("href", prefix + ":" + this.value);
|
this.$el.html(
|
||||||
|
$(this.$el.html()).attr("href", prefix + ":" + this.value)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<!--
|
|
||||||
Copyright 2018 Simone Orsi - Camptocamp SA
|
|
||||||
License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
|
|
||||||
-->
|
|
||||||
<odoo>
|
|
||||||
<template
|
|
||||||
id="assets_backend"
|
|
||||||
name="web_widget_url_advanced assets"
|
|
||||||
inherit_id="web.assets_backend"
|
|
||||||
>
|
|
||||||
<xpath expr="." position="inside">
|
|
||||||
<script
|
|
||||||
type="text/javascript"
|
|
||||||
src="/web_widget_url_advanced/static/src/js/url_widget.js"
|
|
||||||
/>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
</odoo>
|
|
||||||
Reference in New Issue
Block a user