From f95ef19bd6bf17b26284e7125a59442fa28f826f Mon Sep 17 00:00:00 2001 From: Martin Nicolas Cuesta Date: Mon, 13 Aug 2018 10:39:39 -0300 Subject: [PATCH] [MIG] web_domain_field: Migration to 11.0 --- web_domain_field/README.rst | 3 ++- web_domain_field/__manifest__.py | 3 +-- web_domain_field/i18n/web_domain_field.pot | 2 +- web_domain_field/readme/CONTRIBUTORS.rst | 3 +++ web_domain_field/readme/DESCRIPTION.rst | 3 +++ web_domain_field/static/src/js/pyeval.js | 7 +++---- web_domain_field/views/web_domain_field.xml | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 web_domain_field/readme/CONTRIBUTORS.rst create mode 100644 web_domain_field/readme/DESCRIPTION.rst diff --git a/web_domain_field/README.rst b/web_domain_field/README.rst index a14831b6f..30fc9decc 100644 --- a/web_domain_field/README.rst +++ b/web_domain_field/README.rst @@ -65,7 +65,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/162/10.0 + :target: https://runbot.odoo-community.org/runbot/162/11.0 @@ -90,6 +90,7 @@ Contributors * Laurent Mignon * Denis Roussel +* Martín Nicolás Cuesta Maintainer ---------- diff --git a/web_domain_field/__manifest__.py b/web_domain_field/__manifest__.py index c0d77b4d3..28783439e 100644 --- a/web_domain_field/__manifest__.py +++ b/web_domain_field/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -6,7 +5,7 @@ 'name': 'Web Domain Field', 'summary': """ Use computed field as domain""", - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'author': 'ACSONE SA/NV,Odoo Community Association (OCA)', 'website': 'https://acsone.eu/', diff --git a/web_domain_field/i18n/web_domain_field.pot b/web_domain_field/i18n/web_domain_field.pot index 04177b360..fa11ba2b4 100644 --- a/web_domain_field/i18n/web_domain_field.pot +++ b/web_domain_field/i18n/web_domain_field.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" diff --git a/web_domain_field/readme/CONTRIBUTORS.rst b/web_domain_field/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..f741a45aa --- /dev/null +++ b/web_domain_field/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Laurent Mignon +* Denis Roussel +* Martín Nicolás Cuesta diff --git a/web_domain_field/readme/DESCRIPTION.rst b/web_domain_field/readme/DESCRIPTION.rst new file mode 100644 index 000000000..c88a7b49e --- /dev/null +++ b/web_domain_field/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +In order to mitigate limitations with domains in views, now you can define +a computed field in a domain attribute and It's related method will return +the domain to apply. diff --git a/web_domain_field/static/src/js/pyeval.js b/web_domain_field/static/src/js/pyeval.js index f4b75e579..a713c09cb 100644 --- a/web_domain_field/static/src/js/pyeval.js +++ b/web_domain_field/static/src/js/pyeval.js @@ -47,7 +47,7 @@ var wrapping_dict = py.type('wrapping_dict', null, { return this.__getitem__(py.str.fromJSON(key)); }, __len__: function () { - return Object.keys(this._store).length + return Object.keys(this._store).length; }, __nonzero__: function () { return py.PY_size(this) > 0 ? py.True : py.False; @@ -99,8 +99,7 @@ function wrap_context (context) { if (val === null) { continue; } if (val.constructor === Array) { context[k] = wrapping_list.fromJSON(val); - } else if (val.constructor === Object - && !py.PY_isInstance(val, py.object)) { + } else if (val.constructor === Object && !py.PY_isInstance(val, py.object)) { context[k] = wrapping_dict.fromJSON(val); } } @@ -230,4 +229,4 @@ pyeval.eval = domain_field_pyeval; pyeval.ensure_evaluated = ensure_evaluated; pyeval.sync_eval_domains_and_contexts = sync_eval_domains_and_contexts; -}); \ No newline at end of file +}); diff --git a/web_domain_field/views/web_domain_field.xml b/web_domain_field/views/web_domain_field.xml index 537d2f874..4d746a551 100644 --- a/web_domain_field/views/web_domain_field.xml +++ b/web_domain_field/views/web_domain_field.xml @@ -5,4 +5,4 @@