3
0
Fork 0

[MIG] web_widget_url_advanced: Migration to 12.0

12.0
Alexey Pelykh 2019-07-20 16:25:30 +03:00 committed by OCA-git-bot
parent eac5e700d2
commit d9067eed9d
7 changed files with 49 additions and 32 deletions

View File

@ -14,13 +14,13 @@ Web URL widget advanced
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3 :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/11.0/web_widget_url_advanced :target: https://github.com/OCA/web/tree/12.0/web_widget_url_advanced
:alt: OCA/web :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_widget_url_advanced :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_url_advanced
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/11.0 :target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -61,12 +61,18 @@ if you want to display the website link with partner's name as anchor you can do
This is going to change the rendering from This is going to change the rendering from
.. figure:: https://raw.githubusercontent.com/OCA/web/11.0/web_widget_url_advanced/static/description/before.png .. figure:: https://raw.githubusercontent.com/OCA/web/12.0/web_widget_url_advanced/static/description/before.png
to to
.. figure:: https://raw.githubusercontent.com/OCA/web/11.0/web_widget_url_advanced/static/description/after.png .. figure:: https://raw.githubusercontent.com/OCA/web/12.0/web_widget_url_advanced/static/description/after.png
Known issues / Roadmap
======================
* ``<field text_field="foo"/>`` is not supported in tree views.
Bug Tracker Bug Tracker
=========== ===========
@ -74,7 +80,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_url_advanced%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_url_advanced%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -90,6 +96,7 @@ Contributors
~~~~~~~~~~~~ ~~~~~~~~~~~~
* Simone Orsi <simone.orsi@camptocamp.com> * Simone Orsi <simone.orsi@camptocamp.com>
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
@ -104,6 +111,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/11.0/web_widget_url_advanced>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_widget_url_advanced>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -5,7 +5,7 @@
"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": "11.0.1.0.0", "version": "12.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/",

View File

@ -1 +1,2 @@
* Simone Orsi <simone.orsi@camptocamp.com> * Simone Orsi <simone.orsi@camptocamp.com>
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com>

View File

@ -0,0 +1,2 @@
* ``<field text_field="foo"/>`` is not supported in tree views.

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_widget_url_advanced"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_widget_url_advanced"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_url_advanced"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_url_advanced"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Extend URL widget features to ease customization of anchors text.</p> <p>Extend URL widget features to ease customization of anchors text.</p>
<p>By default the URL widget will show the plain URL. <p>By default the URL widget will show the plain URL.
You can specify an attribute <cite>text</cite> to provide a static label too.</p> You can specify an attribute <cite>text</cite> to provide a static label too.</p>
@ -376,11 +376,12 @@ You can specify an attribute <cite>text</cite> to provide a static label too.</p
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li> <li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul> <li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li> <li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li> <li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li> <li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -400,43 +401,50 @@ if you want to display the website link with partners name as anchor you can
</pre> </pre>
<p>This is going to change the rendering from</p> <p>This is going to change the rendering from</p>
<div class="figure"> <div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/web/11.0/web_widget_url_advanced/static/description/before.png" src="https://raw.githubusercontent.com/OCA/web/11.0/web_widget_url_advanced/static/description/before.png" /> <img alt="https://raw.githubusercontent.com/OCA/web/12.0/web_widget_url_advanced/static/description/before.png" src="https://raw.githubusercontent.com/OCA/web/12.0/web_widget_url_advanced/static/description/before.png" />
</div> </div>
<p>to</p> <p>to</p>
<div class="figure"> <div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/web/11.0/web_widget_url_advanced/static/description/after.png" src="https://raw.githubusercontent.com/OCA/web/11.0/web_widget_url_advanced/static/description/after.png" /> <img alt="https://raw.githubusercontent.com/OCA/web/12.0/web_widget_url_advanced/static/description/after.png" src="https://raw.githubusercontent.com/OCA/web/12.0/web_widget_url_advanced/static/description/after.png" />
</div> </div>
</div> </div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li><tt class="docutils literal">&lt;field <span class="pre">text_field=&quot;foo&quot;/&gt;</span></tt> is not supported in tree views.</li>
</ul>
</div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_url_advanced%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_url_advanced%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1> <h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2> <h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Camptocamp</li> <li>Camptocamp</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2> <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li> <li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
<li>Alexey Pelykh &lt;<a class="reference external" href="mailto:alexey.pelykh&#64;brainbeanapps.com">alexey.pelykh&#64;brainbeanapps.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2> <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_widget_url_advanced">OCA/web</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_url_advanced">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@ -14,13 +14,12 @@ odoo.define('web_widget_url_advanced', function (require) {
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`
// NOTE: `<field text_field="foo"..` is not supported in tree views.
var text_field = this.attrs.text_field || this.attrs.options.text_field; var text_field = this.attrs.text_field || this.attrs.options.text_field;
var field_value = this.recordData[text_field]; if (text_field) {
if (_.isObject(field_value) && _.has(field_value.data)) { var field_value = this.recordData[text_field];
field_value = field_value.data.display_name; if (_.isObject(field_value) && _.has(field_value.data)) {
} field_value = field_value.data.display_name;
if (field_value) { }
this.attrs.text = field_value; this.attrs.text = field_value;
} }
}, },

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
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> <odoo>
<template id="assets_backend" name="web_widget_url_advanced assets" inherit_id="web.assets_backend"> <template id="assets_backend" name="web_widget_url_advanced assets" inherit_id="web.assets_backend">