From feb51680cf39afadc8ca6a698f78edbaee3ca1a9 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 11 Oct 2017 04:40:14 +0200 Subject: [PATCH] [FIX] base_view_inheritance_extension: 2 things: * warning about dynamic context * import for safe_eval --- base_view_inheritance_extension/i18n/de.po | 23 ++++++------- base_view_inheritance_extension/i18n/es.po | 34 +++++++++++++++++++ base_view_inheritance_extension/i18n/hr.po | 34 +++++++++++++++++++ base_view_inheritance_extension/i18n/it.po | 24 ++++++------- .../models/ir_ui_view.py | 6 ++-- 5 files changed, 95 insertions(+), 26 deletions(-) create mode 100644 base_view_inheritance_extension/i18n/es.po create mode 100644 base_view_inheritance_extension/i18n/hr.po diff --git a/base_view_inheritance_extension/i18n/de.po b/base_view_inheritance_extension/i18n/de.po index 1e8b83970..5dd858a7f 100644 --- a/base_view_inheritance_extension/i18n/de.po +++ b/base_view_inheritance_extension/i18n/de.po @@ -3,15 +3,14 @@ # * base_view_inheritance_extension # # Translators: -# OCA Transbot , 2017 -# Rudolf Schnapka , 2017 +# Niki Waibel , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-19 17:59+0000\n" -"PO-Revision-Date: 2017-04-19 17:59+0000\n" -"Last-Translator: Rudolf Schnapka , 2017\n" +"POT-Creation-Date: 2017-12-01 02:10+0000\n" +"PO-Revision-Date: 2017-12-01 02:10+0000\n" +"Last-Translator: Niki Waibel , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,14 +19,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: base_view_inheritance_extension -#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_form -msgid "A new page" -msgstr "Eine neue Seite" +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Partner form" +msgstr "" #. module: base_view_inheritance_extension -#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_form -msgid "Partner form" -msgstr "Partner-Formular" +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Phone numbers" +msgstr "" #. module: base_view_inheritance_extension #: model:ir.model,name:base_view_inheritance_extension.model_ir_ui_view diff --git a/base_view_inheritance_extension/i18n/es.po b/base_view_inheritance_extension/i18n/es.po new file mode 100644 index 000000000..d41bffc21 --- /dev/null +++ b/base_view_inheritance_extension/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_view_inheritance_extension +# +# Translators: +# Pedro M. Baeza , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-01 02:10+0000\n" +"PO-Revision-Date: 2017-12-01 02:10+0000\n" +"Last-Translator: Pedro M. Baeza , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: base_view_inheritance_extension +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Partner form" +msgstr "" + +#. module: base_view_inheritance_extension +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Phone numbers" +msgstr "" + +#. module: base_view_inheritance_extension +#: model:ir.model,name:base_view_inheritance_extension.model_ir_ui_view +msgid "ir.ui.view" +msgstr "ir.ui.view" diff --git a/base_view_inheritance_extension/i18n/hr.po b/base_view_inheritance_extension/i18n/hr.po new file mode 100644 index 000000000..3d628dd99 --- /dev/null +++ b/base_view_inheritance_extension/i18n/hr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_view_inheritance_extension +# +# Translators: +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-02 18:40+0000\n" +"PO-Revision-Date: 2018-03-02 18:40+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: base_view_inheritance_extension +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Partner form" +msgstr "Forma partnera" + +#. module: base_view_inheritance_extension +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Phone numbers" +msgstr "Brojevi telefona" + +#. module: base_view_inheritance_extension +#: model:ir.model,name:base_view_inheritance_extension.model_ir_ui_view +msgid "ir.ui.view" +msgstr "ir.ui.view" diff --git a/base_view_inheritance_extension/i18n/it.po b/base_view_inheritance_extension/i18n/it.po index dea907836..b7fca35a4 100644 --- a/base_view_inheritance_extension/i18n/it.po +++ b/base_view_inheritance_extension/i18n/it.po @@ -3,14 +3,14 @@ # * base_view_inheritance_extension # # Translators: -# Paolo Valier , 2017 +# Paolo Valier , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-19 17:59+0000\n" -"PO-Revision-Date: 2017-04-19 17:59+0000\n" -"Last-Translator: Paolo Valier , 2017\n" +"POT-Creation-Date: 2018-01-06 02:25+0000\n" +"PO-Revision-Date: 2018-01-06 02:25+0000\n" +"Last-Translator: Paolo Valier , 2018\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,16 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: base_view_inheritance_extension -#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_form -msgid "A new page" -msgstr "Una nuova pagina" +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Partner form" +msgstr "Form Partner" #. module: base_view_inheritance_extension -#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_form -msgid "Partner form" -msgstr "" +#: model:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form +msgid "Phone numbers" +msgstr "Numeri di telefono" #. module: base_view_inheritance_extension #: model:ir.model,name:base_view_inheritance_extension.model_ir_ui_view msgid "ir.ui.view" -msgstr "" +msgstr "ir.ui.view" diff --git a/base_view_inheritance_extension/models/ir_ui_view.py b/base_view_inheritance_extension/models/ir_ui_view.py index ae5a00695..7f3823371 100644 --- a/base_view_inheritance_extension/models/ir_ui_view.py +++ b/base_view_inheritance_extension/models/ir_ui_view.py @@ -3,6 +3,7 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from lxml import etree from odoo import api, models, tools +from odoo.tools.safe_eval import safe_eval class UnquoteObject(str): @@ -103,9 +104,10 @@ class IrUiView(models.Model): """ node = self.locate_node(source, specs) for attribute_node in specs: - python_dict = tools.safe_eval( + python_dict = safe_eval( node.get(attribute_node.get('name')) or '{}', - UnquoteEvalObjectContext() + UnquoteEvalObjectContext(), + nocopy=True ) python_dict[attribute_node.get('key')] = UnquoteObject( attribute_node.text