mirror of https://github.com/OCA/web.git
[MIG] web_widget_url_advanced: Migration to 15.0
parent
47950555e0
commit
7528544f75
|
@ -5,11 +5,14 @@
|
|||
"summary": "This module extends URL widget "
|
||||
"for displaying anchors with custom labels.",
|
||||
"category": "Web",
|
||||
"version": "14.0.1.0.1",
|
||||
"version": "15.0.1.0.0",
|
||||
"license": "LGPL-3",
|
||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"depends": ["web"],
|
||||
"data": ["templates/assets.xml"],
|
||||
"data": [],
|
||||
"assets": {
|
||||
"web.assets_backend": ["web_widget_url_advanced/static/src/js/url_widget.js"],
|
||||
},
|
||||
"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) {
|
||||
"use strict";
|
||||
|
||||
var basic_fields = require("web.basic_fields");
|
||||
|
||||
basic_fields.UrlWidget.include({
|
||||
|
@ -37,11 +36,14 @@ odoo.define("web_widget_url_advanced", function (require) {
|
|||
*/
|
||||
_renderReadonly: function () {
|
||||
// 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._super.apply(this, arguments);
|
||||
var prefix = this.attrs.prefix_name || this.attrs.options.prefix_name;
|
||||
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>
|
Loading…
Reference in New Issue