Skip to content

Commit

Permalink
[MIG] web_widget_url_advanced: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-pelykh authored and JoanSForgeFlow committed Mar 6, 2020
1 parent 55e8847 commit d1f91f4
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 32 deletions.
21 changes: 14 additions & 7 deletions web_widget_url_advanced/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Web URL widget advanced
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |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
.. |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
.. |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

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -61,20 +61,26 @@ 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

.. 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

.. 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
===========

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.
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.

Expand All @@ -90,6 +96,7 @@ Contributors
~~~~~~~~~~~~

* Simone Orsi <[email protected]>
* Alexey Pelykh <[email protected]>

Maintainers
~~~~~~~~~~~
Expand All @@ -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
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.
2 changes: 1 addition & 1 deletion web_widget_url_advanced/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"summary": "This module extends URL widget "
"for displaying anchors with custom labels.",
"category": "Web",
"version": "11.0.1.0.0",
"version": "12.0.1.0.0",
"license": "LGPL-3",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web/",
Expand Down
3 changes: 2 additions & 1 deletion web_widget_url_advanced/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Simone Orsi <[email protected]>
* Simone Orsi <[email protected]>
* Alexey Pelykh <[email protected]>
2 changes: 2 additions & 0 deletions web_widget_url_advanced/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* ``<field text_field="foo"/>`` is not supported in tree views.

38 changes: 23 additions & 15 deletions web_widget_url_advanced/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Web URL widget advanced</h1>
!! This file is generated by oca-gen-addon-readme !!
!! 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 anchor’s text.</p>
<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>
Expand All @@ -376,11 +376,12 @@ <h1 class="title">Web URL widget advanced</h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<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="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</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>
</li>
</ul>
Expand All @@ -400,43 +401,50 @@ <h1><a class="toc-backref" href="#id1">Usage</a></h1>
</pre>
<p>This is going to change the rendering from</p>
<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>
<p>to</p>
<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 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">
<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>.
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
<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>
</div>
<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">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple">
<li>Camptocamp</li>
</ul>
</div>
<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">
<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>
</div>
<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>
<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
mission is to support the collaborative development of Odoo features and
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>
</div>
</div>
Expand Down
11 changes: 5 additions & 6 deletions web_widget_url_advanced/static/src/js/url_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ odoo.define('web_widget_url_advanced', function (require) {
this._super.apply(this, arguments);
// retrieve customized `<a />` text from a 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 field_value = this.recordData[text_field];
if (_.isObject(field_value) && _.has(field_value.data)) {
field_value = field_value.data.display_name;
}
if (field_value) {
if (text_field) {
var field_value = this.recordData[text_field];
if (_.isObject(field_value) && _.has(field_value.data)) {
field_value = field_value.data.display_name;
}
this.attrs.text = field_value;
}
},
Expand Down
4 changes: 2 additions & 2 deletions web_widget_url_advanced/templates/assets.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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).
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">
Expand Down

0 comments on commit d1f91f4

Please sign in to comment.