mirror of https://github.com/OCA/web.git
[IMP] web_widget_url_advanced: black, isort, prettier
parent
67d2f43c1b
commit
1bdbf68c16
|
@ -8,7 +8,7 @@
|
||||||
"version": "13.0.1.1.0",
|
"version": "13.0.1.1.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": ["templates/assets.xml"],
|
||||||
"installable": True,
|
"installable": True,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright 2018 Simone Orsi - Camptocamp SA
|
/* Copyright 2018 Simone Orsi - Camptocamp SA
|
||||||
License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). */
|
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");
|
||||||
|
@ -10,7 +10,7 @@ odoo.define("web_widget_url_advanced", function(require) {
|
||||||
/**
|
/**
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function () {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
// Retrieve customized `<a />` text from a field
|
// Retrieve customized `<a />` text from a field
|
||||||
// via `text_field` attribute or `options.text_field`
|
// via `text_field` attribute or `options.text_field`
|
||||||
|
@ -20,7 +20,7 @@ odoo.define("web_widget_url_advanced", function(require) {
|
||||||
* Retrieve anchor text based on options.
|
* Retrieve anchor text based on options.
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
_get_text: function() {
|
_get_text: function () {
|
||||||
if (this.text_field) {
|
if (this.text_field) {
|
||||||
var field_value = this.recordData[this.text_field];
|
var field_value = this.recordData[this.text_field];
|
||||||
if (_.isObject(field_value) && _.has(field_value.data)) {
|
if (_.isObject(field_value) && _.has(field_value.data)) {
|
||||||
|
@ -35,7 +35,7 @@ odoo.define("web_widget_url_advanced", function(require) {
|
||||||
* @override
|
* @override
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_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.
|
||||||
this.attrs.text = this._get_text();
|
this.attrs.text = this._get_text();
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
Loading…
Reference in New Issue