diff --git a/README.md b/README.md index 9ccaaf2cc7ff..63d0d19c1f72 100644 --- a/README.md +++ b/README.md @@ -13,31 +13,37 @@ This project aims to deal with modules related to the webclient of Odoo. You'll - Generally add clientside functionality [//]: # (addons) + Available addons ---------------- addon | version | summary --- | --- | --- +[help_online](help_online/) | 10.0.1.0.0 | Help Online +[web_chatter_paste](web_chatter_paste/) | 10.0.1.0.0 | Paste images and drop files into the chatter and upload them directly [web_dialog_size](web_dialog_size/) | 10.0.1.0.0 | A module that lets the user expand a dialog box to the full screen width. [web_environment_ribbon](web_environment_ribbon/) | 10.0.1.0.0 | Web Environment Ribbon [web_export_view](web_export_view/) | 10.0.1.0.0 | Web Export Current View [web_favicon](web_favicon/) | 10.0.1.0.0 | Allows to set a custom shortcut icon (aka favicon) +[web_hide_db_manager_link](web_hide_db_manager_link/) | 10.0.1.0.0 | Hide link to database manager in login screen [web_listview_range_select](web_listview_range_select/) | 10.0.1.0.0 | Enables selecting a range of records using the shift key [web_no_bubble](web_no_bubble/) | 10.0.1.0.0 | Remove the bubbles from the web interface [web_notify](web_notify/) | 10.0.1.0.0 | Send notification messages to user [web_responsive](web_responsive/) | 10.0.1.0.0 | It provides a mobile compliant interface for Odoo Community web +[web_search_with_and](web_search_with_and/) | 10.0.1.0.0 | Use AND conditions on omnibar search [web_searchbar_full_width](web_searchbar_full_width/) | 10.0.1.0.0 | Show search bar in full screen width [web_send_message_popup](web_send_message_popup/) | 10.0.1.0.0 | Web Send Message as Popup [web_sheet_full_width](web_sheet_full_width/) | 10.0.1.0.1 | Use the whole available screen width when displaying sheets +[web_translate_dialog](web_translate_dialog/) | 10.0.1.0.0 | Easy-to-use pop-up to translate fields in several languages [web_tree_image](web_tree_image/) | 10.0.1.1.0 | Show images in tree views [web_tree_many2one_clickable](web_tree_many2one_clickable/) | 10.0.1.0.0 | Open the linked resource when clicking on their name [web_widget_color](web_widget_color/) | 10.0.1.0.0 | Web Widget Color [web_x2many_delete_all](web_x2many_delete_all/) | 10.0.1.0.0 | Adds a button to x2many fields that removes all linked records + Unported addons --------------- addon | version | summary --- | --- | --- -[help_online](help_online/) | 8.0.1.0.0 (unported) | Help Online [help_popup](help_popup/) | 8.0.0.5.0 (unported) | Help Popup [support_branding](support_branding/) | 8.0.2.0.0 (unported) | Adds your branding to an Odoo instance [web_access_rule_buttons](web_access_rule_buttons/) | 9.0.1.0.0 (unported) | Disable Edit button if access rules prevent this action @@ -52,7 +58,6 @@ addon | version | summary [web_duplicate_visibility](web_duplicate_visibility/) | 9.0.1.0.0 (unported) | Manage the duplicate button visibiliy [web_graph_improved](web_graph_improved/) | 8.0.0.1.0 (unported) | Improves graph views. [web_group_expand](web_group_expand/) | 8.0.1.0.0 (unported) | Group Expand Buttons -[web_hide_db_manager_link](web_hide_db_manager_link/) | 9.0.1.0.0 (unported) | Hide link to database manager in login screen [web_ir_actions_act_window_message](web_ir_actions_act_window_message/) | 8.0.1.0.0 (unported) | Show a message box to users [web_ir_actions_act_window_page](web_ir_actions_act_window_page/) | 8.0.1.0.0 (unported) | Allows a developer to trigger a pager to show the previous or next next record in the form view [web_last_viewed_records](web_last_viewed_records/) | 8.0.1.0.0 (unported) | Last viewed records @@ -67,7 +72,6 @@ addon | version | summary [web_sheet_full_width_selective](web_sheet_full_width_selective/) | 8.0.0.1.0 (unported) | Show selected sheets with full width [web_shortcuts](web_shortcuts/) | 8.0.1.0.0 (unported) | Web Shortcuts [web_switch_company_warning](web_switch_company_warning/) | 8.0.0.1.0 (unported) | Show a warning if current company has been switched in another tab or window. -[web_translate_dialog](web_translate_dialog/) | 9.0.1.0.0 (unported) | Easy-to-use pop-up to translate fields in several languages [web_tree_dynamic_colored_field](web_tree_dynamic_colored_field/) | 8.0.1.0.0 (unported) | web tree dynamic colored field [web_widget_datepicker_options](web_widget_datepicker_options/) | 8.0.1.0.0 (unported) | web_widget_datepicker_options [web_widget_float_formula](web_widget_float_formula/) | 9.0.1.0.0 (unported) | Allow use of simple formulas in float fields diff --git a/help_online/README.rst b/help_online/README.rst new file mode 100644 index 000000000000..8e1a0ff73bf2 --- /dev/null +++ b/help_online/README.rst @@ -0,0 +1,69 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=========== +Help Online +=========== + + +This module allows the creation of an online help available from the lists +and forms in Odoo. + +When loading a view, the module generates a button allowing access to an help +page for the related model if the page exists and the user is member of the +group 'Help reader'. If the page doesn't exist and the user is member of +the group 'Help writer', the module generate a button allowing the creation an +help page. + +The help pages are created and managed via the website Module. + +Note: When updating the page prefix parameters, the record rules must be + adapted. + +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 + + +Known issues / Roadmap +====================== + +Even if the generated urls to the documentation contains an anchor (website/hel-xx#view_type), +it's no more possible to insert/edit anchors elements into the website since this functionnality is not supported +by the new html editor in Odoo 10.0 (summernote). + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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. + +Credits +======= + +Contributors +------------ + +* Laurent Mignon +* Jonathan Nemry +* Cédric Pigeon + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/help_online/__init__.py b/help_online/__init__.py index ccd23e289847..4fc2e5371b4a 100644 --- a/help_online/__init__.py +++ b/help_online/__init__.py @@ -1,22 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Nemry Jonathan -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import controllers from . import models +from . import wizards diff --git a/help_online/__manifest__.py b/help_online/__manifest__.py index d84efbd771d2..aa0db85de632 100644 --- a/help_online/__manifest__.py +++ b/help_online/__manifest__.py @@ -1,65 +1,29 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Nemry Jonathan -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + { 'name': 'Help Online', - 'version': '8.0.1.0.0', + 'version': '10.0.1.0.0', 'author': "ACSONE SA/NV,Odoo Community Association (OCA)", 'maintainer': 'ACSONE SA/NV', 'website': 'http://www.acsone.eu', + 'license': 'AGPL-3', 'category': 'Documentation', 'depends': [ - 'base', 'website', ], - 'description': """ -Help Online -=========== - -This module allows the creation of an online help available from the lists -and forms in Odoo. - -When loading a view, the module generates a button allowing access to an help -page for the related model if the page exists and the user is member of the -group 'Help reader'. If the page doesn't exist and the user is member of -the group 'Help writer', the module generate a button allowing the creation an -help page. - -The help pages are created and managed via the website Module. - -Note: When updating the page prefix parameters, the record rules must be - adapted. - """, 'data': [ 'security/help_online_groups.xml', 'security/help_online_rules.xml', - 'views/export_help_wizard_view.xml', - 'views/import_help_wizard_view.xml', + 'wizards/export_help_wizard_view.xml', + 'wizards/import_help_wizard_view.xml', 'views/ir_ui_view_view.xml', 'views/help_online_view.xml', - 'views/website_help_online.xml', 'data/ir_config_parameter_data.xml', ], 'qweb': [ 'static/src/xml/help_online.xml', ], - 'installable': False, - 'auto_install': False, + 'installable': True, } diff --git a/help_online/controllers/__init__.py b/help_online/controllers/__init__.py index 287fdda2f6c8..46333083a445 100644 --- a/help_online/controllers/__init__.py +++ b/help_online/controllers/__init__.py @@ -1,21 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Laurent Mignon -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from .import help_online_controllers diff --git a/help_online/controllers/help_online_controllers.py b/help_online/controllers/help_online_controllers.py index 12339b2329c1..e0ed5919b841 100644 --- a/help_online/controllers/help_online_controllers.py +++ b/help_online/controllers/help_online_controllers.py @@ -1,26 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Laurent Mignon -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -import openerp.http as http -from openerp.http import request +import odoo.http as http +from odoo.http import request class HelpOnlineController(http.Controller): diff --git a/help_online/data/ir_config_parameter_data.xml b/help_online/data/ir_config_parameter_data.xml index 3f3cf68f2397..213c3d5e1cac 100644 --- a/help_online/data/ir_config_parameter_data.xml +++ b/help_online/data/ir_config_parameter_data.xml @@ -1,5 +1,5 @@ - + @@ -22,4 +22,4 @@ - + diff --git a/help_online/i18n/de.po b/help_online/i18n/de.po new file mode 100644 index 000000000000..44f1697b7aa6 --- /dev/null +++ b/help_online/i18n/de.po @@ -0,0 +1,244 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * help_online +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-18 04:00+0000\n" +"PO-Revision-Date: 2017-03-18 04:00+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" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "Close" +msgstr "Schließen" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:45 +#, python-format +msgid "Create Help page for %s" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_create_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_uid +msgid "Created by" +msgstr "Erstellt von" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_date +#: model:ir.model.fields,field_description:help_online.field_help_online_create_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_date +msgid "Created on" +msgstr "Erstellt am" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_display_name +#: model:ir.model.fields,field_description:help_online.field_help_online_display_name +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_display_name +msgid "Display Name" +msgstr "Anzeigename" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "Export" +msgstr "Export" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:306 +#: model:ir.actions.act_window,name:help_online.action_export_help_wizard +#, python-format +msgid "Export Help" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "Export Help Data" +msgstr "" + +#. module: help_online +#: model:ir.model,name:help_online.model_export_help_wizard +#: model:ir.ui.menu,name:help_online.menu_help_export +msgid "Export Help Online" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_export_filename +msgid "Export XML Filename" +msgstr "" + +#. module: help_online +#: model:ir.ui.menu,name:help_online.menu_help +#: model:ir.ui.menu,name:help_online.menu_help_main +msgid "Help Online" +msgstr "" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:40 +#, python-format +msgid "Help on %s" +msgstr "" + +#. module: help_online +#: model:res.groups,name:help_online.help_online_group_reader +msgid "Help reader" +msgstr "" + +#. module: help_online +#: model:res.groups,name:help_online.help_online_group_writer +msgid "Help writer" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_id +#: model:ir.model.fields,field_description:help_online.field_help_online_id +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_id +msgid "ID" +msgstr "ID" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "Import" +msgstr "Import" + +#. module: help_online +#: model:ir.actions.act_window,name:help_online.action_import_help_wizard +msgid "Import Help" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "Import Help Data" +msgstr "" + +#. module: help_online +#: model:ir.ui.menu,name:help_online.menu_help_import +msgid "Import Help Online" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard___last_update +#: model:ir.model.fields,field_description:help_online.field_help_online___last_update +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard___last_update +msgid "Last Modified on" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_write_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_date +#: model:ir.model.fields,field_description:help_online.field_help_online_write_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_date +msgid "Last Updated on" +msgstr "" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:299 +#, python-format +msgid "No data to export !" +msgstr "" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:17 +#, python-format +msgid "No page prefix parameter specified !" +msgstr "" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:99 +#, python-format +msgid "Only images from ir.attachment are supported when exporting help pages" +msgstr "" + +#. module: help_online +#. openerp-web +#: code:addons/help_online/static/src/js/help_online.js:37 +#, python-format +msgid "Page does not exist. Do you want to create?" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_source_file +msgid "Source File" +msgstr "Quelldatei" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "" +"This wizard allow you to export all QWeb views\n" +" related to help online. The result will be an Odoo\n" +" data xml file." +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "" +"This wizard allow you to import QWeb views\n" +" related to help online. The required file format is an Odoo\n" +" data xml file." +msgstr "" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:336 +#, python-format +msgid "Unable to write autobackup file in given directory: %s" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.view_view_search +msgid "Website Page" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.view_view_form +msgid "Website Page?" +msgstr "" + +#. module: help_online +#: model:ir.actions.act_window,name:help_online.action_website_pages +#: model:ir.ui.menu,name:help_online.menu_help_pages +msgid "Website Pages" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_data +msgid "XML" +msgstr "XML" + +#. module: help_online +#: model:ir.model,name:help_online.model_help_online +msgid "help.online" +msgstr "help.online" + +#. module: help_online +#: model:ir.model,name:help_online.model_import_help_wizard +msgid "import.help.wizard" +msgstr "import.help.wizard" + +#. module: help_online +#: model:ir.model,name:help_online.model_ir_model_data +msgid "ir.model.data" +msgstr "ir.model.data" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "or" +msgstr "oder" diff --git a/help_online/i18n/fr.po b/help_online/i18n/fr.po index 40cf06d9a68e..1520f1db1c57 100644 --- a/help_online/i18n/fr.po +++ b/help_online/i18n/fr.po @@ -1,72 +1,70 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * help_online -# +# * help_online +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-14 09:06+0000\n" -"PO-Revision-Date: 2014-10-14 09:06+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-03-09 01:42+0000\n" +"PO-Revision-Date: 2017-03-09 01:42+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: help_online -#. openerp-web -#: code:addons/help_online/static/src/js/help_online.js:83 -#, python-format -msgid "Cancel" -msgstr "Annuler" - -#. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "Close" msgstr "Fermer" #. module: help_online -#. openerp-web -#: code:addons/help_online/static/src/js/help_online.js:81 -#, python-format -msgid "Confirm" -msgstr "Confirmer" - -#. module: help_online -#: code:addons/help_online/models/help_online.py:60 +#: code:addons/help_online/models/help_online.py:45 #, python-format msgid "Create Help page for %s" msgstr "Créer la page d'aide pour %s" #. module: help_online -#: field:export.help.wizard,create_uid:0 -#: field:help.online,create_uid:0 -#: field:import.help.wizard,create_uid:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_create_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_uid msgid "Created by" msgstr "Créé par" #. module: help_online -#: field:export.help.wizard,create_date:0 -#: field:help.online,create_date:0 -#: field:import.help.wizard,create_date:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_date +#: model:ir.model.fields,field_description:help_online.field_help_online_create_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_date msgid "Created on" msgstr "Créé le" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_display_name +#: model:ir.model.fields,field_description:help_online.field_help_online_display_name +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_display_name +msgid "Display Name" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view msgid "Export" msgstr "Export" #. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:306 #: model:ir.actions.act_window,name:help_online.action_export_help_wizard +#, python-format msgid "Export Help" msgstr "Export des pages d'aide" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view msgid "Export Help Data" msgstr "Export des pages d'aide" @@ -77,7 +75,7 @@ msgid "Export Help Online" msgstr "Export des pages d'aide" #. module: help_online -#: field:export.help.wizard,export_filename:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_export_filename msgid "Export XML Filename" msgstr "Fichier XML" @@ -88,7 +86,7 @@ msgid "Help Online" msgstr "Aide en ligne" #. module: help_online -#: code:addons/help_online/models/help_online.py:55 +#: code:addons/help_online/models/help_online.py:40 #, python-format msgid "Help on %s" msgstr "Aide sur %s" @@ -104,14 +102,14 @@ msgid "Help writer" msgstr "Aide: rédacteur" #. module: help_online -#: field:export.help.wizard,id:0 -#: field:help.online,id:0 -#: field:import.help.wizard,id:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_id +#: model:ir.model.fields,field_description:help_online.field_help_online_id +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_id msgid "ID" msgstr "ID" #. module: help_online -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "Import" msgstr "Import" @@ -121,7 +119,7 @@ msgid "Import Help" msgstr "Import des pages d'aide" #. module: help_online -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "Import Help Data" msgstr "Import des pages d'aide" @@ -131,81 +129,86 @@ msgid "Import Help Online" msgstr "Import des pages d'aide" #. module: help_online -#: field:export.help.wizard,write_uid:0 -#: field:help.online,write_uid:0 -#: field:import.help.wizard,write_uid:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard___last_update +#: model:ir.model.fields,field_description:help_online.field_help_online___last_update +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard___last_update +msgid "Last Modified on" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_write_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_uid msgid "Last Updated by" msgstr "Mis à jour par" #. module: help_online -#: field:export.help.wizard,write_date:0 -#: field:help.online,write_date:0 -#: field:import.help.wizard,write_date:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_date +#: model:ir.model.fields,field_description:help_online.field_help_online_write_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_date msgid "Last Updated on" msgstr "Mis à jour le" #. module: help_online -#: code:addons/help_online/models/export_help_wizard.py:238 +#: code:addons/help_online/wizards/export_help_wizard.py:299 #, python-format msgid "No data to export !" msgstr "Aucune page à exporter !" #. module: help_online -#: code:addons/help_online/models/help_online.py:33 +#: code:addons/help_online/models/help_online.py:17 #, python-format msgid "No page prefix parameter specified !" msgstr "Le paramètre spécifiant le préfixe des pages n'est pas configuré !" #. module: help_online -#. openerp-web -#: code:addons/help_online/static/src/js/help_online.js:88 +#: code:addons/help_online/wizards/export_help_wizard.py:99 #, python-format -msgid "Ok" -msgstr "Ok" +msgid "Only images from ir.attachment are supported when exporting help pages" +msgstr "" #. module: help_online #. openerp-web -#: code:addons/help_online/static/src/js/help_online.js:107 +#: code:addons/help_online/static/src/js/help_online.js:37 #, python-format msgid "Page does not exist. Do you want to create?" msgstr "La page n'existe pas. Voulez-vous la créer?" #. module: help_online -#: field:import.help.wizard,source_file:0 +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_source_file msgid "Source File" msgstr "Fichier de données" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view -msgid "This wizard allow you to export all QWeb views\n" -" related to help online. The result will be an Odoo\n" -" data xml file." -msgstr "Cet assistant vous permet d'exporter toutes les vues QWeb \n" -" concernant l'aide. Le résultat sera un\n" -" fichier de données Odoo." +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "" +"This wizard allow you to export all QWeb views\n" +" related to help online. The result will be an Odoo\n" +" data xml file." +msgstr "" #. module: help_online -#: view:import.help.wizard:help_online.import_help_wizard_view -msgid "This wizard allow you to import QWeb views\n" -" related to help online. The required file format is an Odoo\n" -" data xml file." -msgstr "Cet assistant vous permet d'importer toutes les vues QWeb\n" -" concernant l'aide. Le format de fichier requis est un\n" -" fichier de données Odoo." +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "" +"This wizard allow you to import QWeb views\n" +" related to help online. The required file format is an Odoo\n" +" data xml file." +msgstr "" #. module: help_online -#: code:addons/help_online/models/export_help_wizard.py:275 +#: code:addons/help_online/wizards/export_help_wizard.py:336 #, python-format msgid "Unable to write autobackup file in given directory: %s" -msgstr "Impossible d'écrire le fichier de sauvegarde dans le répertoire spécifié: %s" +msgstr "" +"Impossible d'écrire le fichier de sauvegarde dans le répertoire spécifié: %s" #. module: help_online -#: view:ir.ui.view:help_online.view_view_search +#: model:ir.ui.view,arch_db:help_online.view_view_search msgid "Website Page" msgstr "Page du site" #. module: help_online -#: view:ir.ui.view:help_online.view_view_form +#: model:ir.ui.view,arch_db:help_online.view_view_form msgid "Website Page?" msgstr "Page du site?" @@ -216,7 +219,27 @@ msgid "Website Pages" msgstr "Pages du site" #. module: help_online -#: field:export.help.wizard,data:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_data msgid "XML" msgstr "XML" +#. module: help_online +#: model:ir.model,name:help_online.model_help_online +msgid "help.online" +msgstr "" + +#. module: help_online +#: model:ir.model,name:help_online.model_import_help_wizard +msgid "import.help.wizard" +msgstr "" + +#. module: help_online +#: model:ir.model,name:help_online.model_ir_model_data +msgid "ir.model.data" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "or" +msgstr "" diff --git a/help_online/i18n/hr.po b/help_online/i18n/hr.po new file mode 100644 index 000000000000..ad48095a77e8 --- /dev/null +++ b/help_online/i18n/hr.po @@ -0,0 +1,251 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * help_online +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-09 01:42+0000\n" +"PO-Revision-Date: 2017-03-09 01:42+0000\n" +"Last-Translator: Bole , 2017\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: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "Close" +msgstr "Zatvori" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:45 +#, python-format +msgid "Create Help page for %s" +msgstr "Kreiraj stranicu pomoći za %s" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_create_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_uid +msgid "Created by" +msgstr "Kreirao" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_date +#: model:ir.model.fields,field_description:help_online.field_help_online_create_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_date +msgid "Created on" +msgstr "Kreirano" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_display_name +#: model:ir.model.fields,field_description:help_online.field_help_online_display_name +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_display_name +msgid "Display Name" +msgstr "Naziv za prikaz" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "Export" +msgstr "Izvoz" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:306 +#: model:ir.actions.act_window,name:help_online.action_export_help_wizard +#, python-format +msgid "Export Help" +msgstr "Izvezi pomoć" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "Export Help Data" +msgstr "Izvezi podatke za pomoć" + +#. module: help_online +#: model:ir.model,name:help_online.model_export_help_wizard +#: model:ir.ui.menu,name:help_online.menu_help_export +msgid "Export Help Online" +msgstr "Izvezi pomoć " + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_export_filename +msgid "Export XML Filename" +msgstr "Naziv izvezene XML datoteke" + +#. module: help_online +#: model:ir.ui.menu,name:help_online.menu_help +#: model:ir.ui.menu,name:help_online.menu_help_main +msgid "Help Online" +msgstr "Online pomoć" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:40 +#, python-format +msgid "Help on %s" +msgstr "Pomoć za %s" + +#. module: help_online +#: model:res.groups,name:help_online.help_online_group_reader +msgid "Help reader" +msgstr "Čitatelj pomoći" + +#. module: help_online +#: model:res.groups,name:help_online.help_online_group_writer +msgid "Help writer" +msgstr "Autor pomoći" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_id +#: model:ir.model.fields,field_description:help_online.field_help_online_id +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_id +msgid "ID" +msgstr "ID" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "Import" +msgstr "Uvoz" + +#. module: help_online +#: model:ir.actions.act_window,name:help_online.action_import_help_wizard +msgid "Import Help" +msgstr "Uvezi pomoć" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "Import Help Data" +msgstr "Uvezi podatke pomoći" + +#. module: help_online +#: model:ir.ui.menu,name:help_online.menu_help_import +msgid "Import Help Online" +msgstr "Uvezi online pomoć" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard___last_update +#: model:ir.model.fields,field_description:help_online.field_help_online___last_update +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard___last_update +msgid "Last Modified on" +msgstr "Zadnje modificirano" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_write_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_uid +msgid "Last Updated by" +msgstr "Zadnje ažurirao" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_date +#: model:ir.model.fields,field_description:help_online.field_help_online_write_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_date +msgid "Last Updated on" +msgstr "Zadnje ažurirano" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:299 +#, python-format +msgid "No data to export !" +msgstr "Nema podataka za izvoz!" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:17 +#, python-format +msgid "No page prefix parameter specified !" +msgstr "Nije specificiran parametar prefiksa!" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:99 +#, python-format +msgid "Only images from ir.attachment are supported when exporting help pages" +msgstr "" +"Samo slike iz ir.attachment modela su podržane pri izvozu stranica pomoći" + +#. module: help_online +#. openerp-web +#: code:addons/help_online/static/src/js/help_online.js:37 +#, python-format +msgid "Page does not exist. Do you want to create?" +msgstr "Stranica ne postoji. Želite li ju kreirati?" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_source_file +msgid "Source File" +msgstr "Izvorišna datoteka" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +msgid "" +"This wizard allow you to export all QWeb views\n" +" related to help online. The result will be an Odoo\n" +" data xml file." +msgstr "" +"Ovaj čarobnjak vam omogućuje izvoz svih Qweb pogleda\n" +"povezanih sa online pomoći. Rezultat će biti Odoo\n" +"podatkovna xml datoteka." + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "" +"This wizard allow you to import QWeb views\n" +" related to help online. The required file format is an Odoo\n" +" data xml file." +msgstr "" +"Ovaj čarobnjak vam omogućuje uvoz svih Qweb pogleda\n" +"povezanih sa online pomoći. Obavezni format je Odoo\n" +"podatkovna xml datoteka." + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:336 +#, python-format +msgid "Unable to write autobackup file in given directory: %s" +msgstr "Nije moguće zapisati autobackup datoteku u zadani direktorij: %s" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.view_view_search +msgid "Website Page" +msgstr "Webstranica" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.view_view_form +msgid "Website Page?" +msgstr "Webstranica?" + +#. module: help_online +#: model:ir.actions.act_window,name:help_online.action_website_pages +#: model:ir.ui.menu,name:help_online.menu_help_pages +msgid "Website Pages" +msgstr "Webstranice" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_data +msgid "XML" +msgstr "XML" + +#. module: help_online +#: model:ir.model,name:help_online.model_help_online +msgid "help.online" +msgstr "help.online" + +#. module: help_online +#: model:ir.model,name:help_online.model_import_help_wizard +msgid "import.help.wizard" +msgstr "import.help.wizard" + +#. module: help_online +#: model:ir.model,name:help_online.model_ir_model_data +msgid "ir.model.data" +msgstr "ir.model.data" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view +msgid "or" +msgstr "ili" diff --git a/help_online/i18n/sl.po b/help_online/i18n/sl.po index 278c7f2d588f..87a07b671b4d 100644 --- a/help_online/i18n/sl.po +++ b/help_online/i18n/sl.po @@ -1,53 +1,70 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * help_online -# -# Matjaž Mozetič , 2015. +# * help_online +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-02 10:20+0200\n" -"PO-Revision-Date: 2015-08-02 10:20+0200\n" -"Last-Translator: Matjaz Mozetic \n" -"Language-Team: Slovenian \n" -"Language: sl\n" +"POT-Creation-Date: 2017-03-09 01:42+0000\n" +"PO-Revision-Date: 2017-03-09 01:42+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"X-Generator: Poedit 1.8.2\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "Close" msgstr "Zaključi" #. module: help_online -#: field:export.help.wizard,create_uid:0 field:help.online,create_uid:0 -#: field:import.help.wizard,create_uid:0 +#: code:addons/help_online/models/help_online.py:45 +#, python-format +msgid "Create Help page for %s" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_create_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_uid msgid "Created by" msgstr "Ustvaril" #. module: help_online -#: field:export.help.wizard,create_date:0 field:help.online,create_date:0 -#: field:import.help.wizard,create_date:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_create_date +#: model:ir.model.fields,field_description:help_online.field_help_online_create_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_create_date msgid "Created on" msgstr "Ustvarjeno" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_display_name +#: model:ir.model.fields,field_description:help_online.field_help_online_display_name +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_display_name +msgid "Display Name" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view msgid "Export" msgstr "Izvoz" #. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:306 #: model:ir.actions.act_window,name:help_online.action_export_help_wizard +#, python-format msgid "Export Help" msgstr "Izvoz navodil" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view msgid "Export Help Data" msgstr "Izvoz podatkov spletnih navodil" @@ -58,7 +75,7 @@ msgid "Export Help Online" msgstr "Izvozi spletna navodila" #. module: help_online -#: field:export.help.wizard,export_filename:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_export_filename msgid "Export XML Filename" msgstr "Naziv izvožene XML datoteke" @@ -68,6 +85,12 @@ msgstr "Naziv izvožene XML datoteke" msgid "Help Online" msgstr "Spletna navodila" +#. module: help_online +#: code:addons/help_online/models/help_online.py:40 +#, python-format +msgid "Help on %s" +msgstr "" + #. module: help_online #: model:res.groups,name:help_online.help_online_group_reader msgid "Help reader" @@ -79,13 +102,14 @@ msgid "Help writer" msgstr "Avtor navodil" #. module: help_online -#: field:export.help.wizard,id:0 field:help.online,id:0 -#: field:import.help.wizard,id:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_id +#: model:ir.model.fields,field_description:help_online.field_help_online_id +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_id msgid "ID" msgstr "ID" #. module: help_online -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "Import" msgstr "Uvoz" @@ -95,7 +119,7 @@ msgid "Import Help" msgstr "Uvoz navodil" #. module: help_online -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "Import Help Data" msgstr "Uvoz podatkov navodil" @@ -105,52 +129,85 @@ msgid "Import Help Online" msgstr "Uvoz spletnih navodil" #. module: help_online -#: field:export.help.wizard,write_uid:0 field:help.online,write_uid:0 -#: field:import.help.wizard,write_uid:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard___last_update +#: model:ir.model.fields,field_description:help_online.field_help_online___last_update +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard___last_update +msgid "Last Modified on" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_uid +#: model:ir.model.fields,field_description:help_online.field_help_online_write_uid +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_uid msgid "Last Updated by" msgstr "Zadnjič posodobil" #. module: help_online -#: field:export.help.wizard,write_date:0 field:help.online,write_date:0 -#: field:import.help.wizard,write_date:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_write_date +#: model:ir.model.fields,field_description:help_online.field_help_online_write_date +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_write_date msgid "Last Updated on" msgstr "Zadnjič posodobljeno" #. module: help_online -#: field:import.help.wizard,source_file:0 +#: code:addons/help_online/wizards/export_help_wizard.py:299 +#, python-format +msgid "No data to export !" +msgstr "" + +#. module: help_online +#: code:addons/help_online/models/help_online.py:17 +#, python-format +msgid "No page prefix parameter specified !" +msgstr "" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:99 +#, python-format +msgid "Only images from ir.attachment are supported when exporting help pages" +msgstr "" + +#. module: help_online +#. openerp-web +#: code:addons/help_online/static/src/js/help_online.js:37 +#, python-format +msgid "Page does not exist. Do you want to create?" +msgstr "" + +#. module: help_online +#: model:ir.model.fields,field_description:help_online.field_import_help_wizard_source_file msgid "Source File" msgstr "Izvorna datoteka" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view msgid "" "This wizard allow you to export all QWeb views\n" -" related to help online. The result will be an Odoo\n" -" data xml file." +" related to help online. The result will be an Odoo\n" +" data xml file." msgstr "" -"Ta čarovnik omogoča izvoz vseh QWeb pogledov,\n" -" ki se tičejo spletnih navodil v Odoo\n" -" xml podatkovno datoteko." #. module: help_online -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "" "This wizard allow you to import QWeb views\n" -" related to help online. The required file format is " -"an Odoo\n" -" data xml file." +" related to help online. The required file format is an Odoo\n" +" data xml file." +msgstr "" + +#. module: help_online +#: code:addons/help_online/wizards/export_help_wizard.py:336 +#, python-format +msgid "Unable to write autobackup file in given directory: %s" msgstr "" -"Ta čarovnik omogoča uvoz QWeb pogledov,\n" -" ki se tičejo spletnih navodil iz Odoo\n" -" xml podatkovne datoteke." #. module: help_online -#: view:ir.ui.view:help_online.view_view_search +#: model:ir.ui.view,arch_db:help_online.view_view_search msgid "Website Page" msgstr "Spletna stran" #. module: help_online -#: view:ir.ui.view:help_online.view_view_form +#: model:ir.ui.view,arch_db:help_online.view_view_form msgid "Website Page?" msgstr "Spletna stran?" @@ -161,12 +218,27 @@ msgid "Website Pages" msgstr "Spletne strani" #. module: help_online -#: field:export.help.wizard,data:0 +#: model:ir.model.fields,field_description:help_online.field_export_help_wizard_data msgid "XML" msgstr "XML" #. module: help_online -#: view:export.help.wizard:help_online.export_help_wizard_view -#: view:import.help.wizard:help_online.import_help_wizard_view +#: model:ir.model,name:help_online.model_help_online +msgid "help.online" +msgstr "" + +#. module: help_online +#: model:ir.model,name:help_online.model_import_help_wizard +msgid "import.help.wizard" +msgstr "" + +#. module: help_online +#: model:ir.model,name:help_online.model_ir_model_data +msgid "ir.model.data" +msgstr "" + +#. module: help_online +#: model:ir.ui.view,arch_db:help_online.export_help_wizard_view +#: model:ir.ui.view,arch_db:help_online.import_help_wizard_view msgid "or" msgstr "ali" diff --git a/help_online/models/__init__.py b/help_online/models/__init__.py index 615fa9cc8d00..e98044c5a9bd 100644 --- a/help_online/models/__init__.py +++ b/help_online/models/__init__.py @@ -1,24 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Nemry Jonathan -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import help_online -from . import export_help_wizard -from . import import_help_wizard from . import ir_model diff --git a/help_online/models/help_online.py b/help_online/models/help_online.py index 25e34fbb3089..4eb4fd865fa2 100644 --- a/help_online/models/help_online.py +++ b/help_online/models/help_online.py @@ -1,25 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Laurent Mignon -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, exceptions -from openerp.tools.translate import _ +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, exceptions +from odoo.tools.translate import _ class HelpOnline(models.TransientModel): @@ -34,9 +18,9 @@ def _get_view_name(self, model, view_type, domain=None, context=None): name = '%s-%s' % (page_prefix, model.replace('.', '-')) return name - def page_exists(self, name): - website_model = self.env['website'] - return website_model.page_exists(name) + def get_existing_pages(self, name, limit=None): + website = self.env['website'] + return website.search_pages(needle=name, limit=limit) def get_page_url(self, model, view_type, domain=None, context=None): user_model = self.env['res.users'] @@ -48,8 +32,9 @@ def get_page_url(self, model, view_type, domain=None, context=None): if res: description = res[0][1] name = self._get_view_name(model, view_type, domain, context) - if self.page_exists(name): - url = '/page/%s' % name + pages = self.get_existing_pages(name, limit=1) + if pages: + url = pages[0]['loc'] if view_type: url = url + '#' + view_type title = _('Help on %s') % description diff --git a/help_online/models/import_help_wizard.py b/help_online/models/import_help_wizard.py deleted file mode 100644 index bb0717845b5e..000000000000 --- a/help_online/models/import_help_wizard.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# All Rights Reserved -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsibility of assessing all potential -# consequences resulting from its eventual inadequacies and bugs. -# End users who are looking for a ready-to-use solution with commercial -# guarantees and support are strongly advised to contact a Free Software -# Service Company. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, fields, api -from openerp.tools import convert - -import base64 -from cStringIO import StringIO - - -class ImportHelpWizard(models.TransientModel): - _name = "import.help.wizard" - - source_file = fields.Binary('Source File') - - @api.one - def import_help(self): - source_file = base64.decodestring(self.source_file) - convert.convert_xml_import(self.env.cr, - self._module, - StringIO(source_file), - idref=None, - mode='init', - noupdate=False, - report=None) diff --git a/help_online/models/ir_model.py b/help_online/models/ir_model.py index fa9df3967d8e..8a136c12af09 100644 --- a/help_online/models/ir_model.py +++ b/help_online/models/ir_model.py @@ -1,29 +1,13 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Cédric Pigeon -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, api +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, api from lxml import etree as ET -class ir_model_data(models.Model): +class IrModelData(models.Model): _inherit = 'ir.model.data' @api.model @@ -38,14 +22,14 @@ def _update(self, model, module, values, xml_id=False, store=True, xml_str = self.manageImageReferences(values['arch'], module) values['arch'] = xml_str - return super(ir_model_data, self)._update(model, - module, - values, - xml_id=xml_id, - store=store, - noupdate=noupdate, - mode=mode, - res_id=res_id) + return super(IrModelData, self)._update(model, + module, + values, + xml_id=xml_id, + store=store, + noupdate=noupdate, + mode=mode, + res_id=res_id) def manageImageReferences(self, xml_str, module): parser = ET.XMLParser(remove_blank_text=True) diff --git a/help_online/security/help_online_groups.xml b/help_online/security/help_online_groups.xml index fd981bf1b769..971582cee638 100644 --- a/help_online/security/help_online_groups.xml +++ b/help_online/security/help_online_groups.xml @@ -1,16 +1,16 @@ - - - - Help reader - - - - Help writer - - - - - \ No newline at end of file + + + + Help reader + + + + Help writer + + + + + diff --git a/help_online/security/help_online_rules.xml b/help_online/security/help_online_rules.xml index 08880d9ce482..31576c2536d8 100644 --- a/help_online/security/help_online_rules.xml +++ b/help_online/security/help_online_rules.xml @@ -1,32 +1,30 @@ - - - - Online Help Hidden by Default - - [ - '|', - ('type', '!=', 'qweb'), - ('name','not like','help-%'), - ] - - - - - - - Online Help for Help Reader - - [(1, '=', 1)] - - - - - - + + + Online Help Hidden by Default + + [ + '|', + ('type', '!=', 'qweb'), + ('name','not like','help-%'), + ] + + + + + + + Online Help for Help Reader + + [(1, '=', 1)] + + + + + diff --git a/help_online/static/description/icon.png b/help_online/static/description/icon.png index ab8d478d6a88..92efa71b0c0b 100644 Binary files a/help_online/static/description/icon.png and b/help_online/static/description/icon.png differ diff --git a/help_online/static/src/css/help_online.css b/help_online/static/src/css/help_online.css index 5878bfe0110b..638deb76a412 100644 --- a/help_online/static/src/css/help_online.css +++ b/help_online/static/src/css/help_online.css @@ -1,12 +1,3 @@ -li.oe_help_online_not_found { +a.o_help_online_not_found { background-color: #df3f3f; -} - -.openerp .oe_view_manager .oe_view_manager_switch .oe_list_button_help_online:after { - font-size: 28px; - content: "?"; - text-align: center; - margin: 3px auto 4px; - position: relative; - display: inline-block; -} +} \ No newline at end of file diff --git a/help_online/static/src/js/help_online.js b/help_online/static/src/js/help_online.js index c660a110e24a..c2977dc521c5 100644 --- a/help_online/static/src/js/help_online.js +++ b/help_online/static/src/js/help_online.js @@ -1,115 +1,86 @@ -openerp.help_online = function (instance) { - var QWeb = instance.web.qweb; - var _t = instance.web._t; - var _lt = instance.web._lt; +odoo.define('oca.HelpOnline', function (require) { + "use strict"; - instance.web.ListView.include({ - load_list: function () { - var self = this; - var add_button = false; - if (!this.$buttons) { - add_button = true; - } + var core = require('web.core'); + var QWeb = core.qweb; + var _t = core._t; + var ViewManager = require('web.ViewManager'); + var ControlPanel = require('web.ControlPanel'); + var Dialog = require('web.Dialog'); + + ControlPanel.include({ + start: function(){ this._super.apply(this, arguments); - this.$buttons.on('click', '.oe_list_button_help_online', function() { - self.do_action({ - type: 'ir.actions.act_url', - url: '/partner_mobile', - target: 'self', - }); - }); - }, - }); - - openerp.web.TreeView.include({ - view_loading: function(r) { - var ret = this._super(r); - if(! _.isUndefined(this.ViewManager.load_help_buttons)){ - this.ViewManager.load_help_buttons(); - } - return ret - }, - }); - - openerp.web.ListView.include({ - view_loading: function(r) { - var ret = this._super(r); - if(! _.isUndefined(this.ViewManager.load_help_buttons)){ - this.ViewManager.load_help_buttons(); - } - return ret + this._toggle_visibility(true); + this.nodes = _.extend( + this.nodes, + {$help_online_buttons: this.$('.o_help_online_buttons')}); + this._toggle_visibility(false); }, }); - - openerp.web.FormView.include({ - view_loading: function(r) { - var ret = this._super(r); - if(!_.isUndefined(this.ViewManager.clean_help_buttons)){ - this.ViewManager.clean_help_buttons(); - } - return ret - }, - - do_show: function (options){ - var ret = this._super(options); - if(! _.isUndefined(this.ViewManager.load_help_buttons)){ - this.ViewManager.load_help_buttons(); + + ViewManager.include({ + + /** + * This function render the help button with the informations received + * from the call to the method build_url from the help_online controller + */ + render_help_button: function(url_info){ + var $helpButton = $(QWeb.render("HelpOnline.Button", {'view_manager':this, 'url_info': url_info})); + $helpButton.tooltip(); + if (url_info.exists === false) { + $helpButton.on('click', function (event) { + var evt = event; + evt.preventDefault(); + Dialog.confirm( + self, + _t('Page does not exist. Do you want to create?'), + {confirm_callback: function() { + var form = $("
"); + form.attr({ + id : "formform", + // The location given in the link itself + action : evt.target.href, + method : "GET", + // Open in new window/tab + target : evt.target.target + }); + $("body").append(form); + $("#formform").submit(); + $("#formform").remove(); + return false; + } + }); + }); } - return ret + return $helpButton; }, - }); - openerp.web.ViewManager.include({ - clean_help_buttons:function() { - this.$el.find("div.oe_help_online_buttons").first().remove(); - }, - - load_help_buttons:function() { - var self = this; - this.rpc('/help_online/build_url', {model: this.dataset.model, view_type: this.active_view}).then(function(result) { - self.clean_help_buttons(); + /** + * This function render the help buttons container on the view. + * It should be called after start() by render_view_control_elements. + * @param {control_elements} the list of control elements to display into the ControlPanel + */ + render_help_buttons: function(control_elements){ + if (! control_elements.$help_online_buttons){ + control_elements.$help_online_buttons = $('
'); + } + var self = this; + this.rpc('/help_online/build_url', {model: this.dataset.model, view_type: this.active_view.type}).then(function(result) { if (result && ! _.isEmpty(result)) { - self.$helpButtonsEl = $(QWeb.render("HelpOnline.Buttons", {'view_manager':self, 'url_info': result})); - self.$el.find("ul.oe_view_manager_switch.oe_button_group.oe_right").first().before(self.$helpButtonsEl); - self.$helpButtonsEl.find('a.oe_list_button_help_online').tooltip(); - if (result.exists === false) { - self.$helpButtonsEl.find('li').addClass('oe_help_online_not_found') - self.$helpButtonsEl.find('a.oe_list_button_help_online').on('click', function (event) { - var evt = event; - evt.preventDefault(); - var dialog = new instance.web.Dialog(this, { - title: _t('Confirm'), - buttons: [ - {text: _t("Cancel"), click: function() { - this.parents('.modal').modal('hide'); - return false; - } - }, - {text: _t("Ok"), click: function() { - this.parents('.modal').modal('hide'); - var form = $("
"); - form.attr( - { - id : "formform", - // The location given in the link itself - action : evt.target.href, - method : "GET", - // Open in new window/tab - target : evt.target.target - }); - $("body").append(form); - $("#formform").submit(); - $("#formform").remove(); - return false; - } - } - ], - }, $('
').text(_t('Page does not exist. Do you want to create?'))).open(); - }); - } + var $helpButton = self.render_help_button(result); + control_elements.$help_online_buttons = $helpButton; + // update the control panel with the new help button + self.update_control_panel({cp_content: _.extend({}, self.searchview_elements, control_elements)}, {clear: false}); } }); }, + render_view_control_elements: function() { + var control_elements = this._super.apply(this, arguments); + this.render_help_buttons(control_elements); + return control_elements; + }, + }); -} +}); diff --git a/help_online/static/src/js/website_help_online.editor.js b/help_online/static/src/js/website_help_online.editor.js deleted file mode 100644 index 0dc2f3d1ae8c..000000000000 --- a/help_online/static/src/js/website_help_online.editor.js +++ /dev/null @@ -1,21 +0,0 @@ -(function () { - 'use strict'; - - var website = openerp.website; - var _t = openerp._t; - website.RTE.include({ - _config: function () { - // add anchor button - var config = this._super(); - config.plugins = config.plugins.concat(',link'); - _.each(config.toolbar, function (tb) { - if (tb.name === 'span'){ - tb.items.unshift('Anchor'); - } - }); - return config; - }, - }); -})(); - - diff --git a/help_online/static/src/xml/help_online.xml b/help_online/static/src/xml/help_online.xml index fb55b85b6ef8..bc987ef85c56 100644 --- a/help_online/static/src/xml/help_online.xml +++ b/help_online/static/src/xml/help_online.xml @@ -1,13 +1,36 @@ + - -
-
    -
  • - -
  • -
+ + + + + + + + - + + + + + + + + + + + + + + + + +
+ +
+
+
+ diff --git a/help_online/tests/__init__.py b/help_online/tests/__init__.py index cc5a18f0a592..24fd5c2eb173 100644 --- a/help_online/tests/__init__.py +++ b/help_online/tests/__init__.py @@ -1,27 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from . import test_export_help_wizard - -fast_suite = [ -] +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -checks = [ - test_export_help_wizard, -] +from . import test_help_online +from . import test_export_help_wizard +from . import test_import_help_wizard diff --git a/help_online/tests/common.py b/help_online/tests/common.py new file mode 100644 index 000000000000..a2d5e84249b4 --- /dev/null +++ b/help_online/tests/common.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import os +import sys +from lxml import etree as ET + +from odoo.tools.convert import convert_xml_import + + +class TestWizardCommon(object): + _data_files = ('data/help_test_data.xml',) + + _module_ns = 'help_online' + + def createPage(self, pageName, imgXmlId=False): + imgId = False + if imgXmlId: + imgId = self.ref(imgXmlId) + + rootNode = ET.Element('t') + rootNode.attrib['name'] = pageName + rootNode.attrib['t-name'] = "website.%s" % pageName + tNode = ET.SubElement(rootNode, + 't', + attrib={'t-call': 'website.layout'}) + structDivNode = ET.SubElement(tNode, + 'div', + attrib={'class': 'oe_structure oe_empty', + 'id': 'wrap'}) + sectionNode = ET.SubElement(structDivNode, + 'section', + attrib={'class': 'mt16 mb16'}) + containerNode = ET.SubElement(sectionNode, + 'div', + attrib={'class': 'container'}) + rowNode = ET.SubElement(containerNode, + 'div', + attrib={'class': 'row'}) + bodyDivNode = ET.SubElement(rowNode, + 'div', + attrib={'class': 'col-md-12 ' + 'text-center mt16 mb32'}) + style = "font-family: 'Helvetica Neue', Helvetica,"\ + " Arial, sans-serif; color: rgb(51, 51, 51);"\ + " text-align: left;" + h2Node = ET.SubElement(bodyDivNode, + 'h2', + attrib={'style': style}) + h2Node.text = "Test Sample Title" + if imgId: + imgDivNode = ET.SubElement(bodyDivNode, + 'div', + attrib={'style': 'text-align: left;'}) + src = "/website/image?field=datas&"\ + "model=ir.attachment&id=%s" % str(imgId) + ET.SubElement(imgDivNode, + 'img', + attrib={'class': 'img-thumbnail', + 'src': src}) + imgDivNode = ET.SubElement(bodyDivNode, + 'div', + attrib={'style': 'text-align: left;'}) + src = "/website/image/ir.attachment/%s_ccc838d/datas" % str(imgId) + ET.SubElement(imgDivNode, + 'img', + attrib={'class': 'img-thumbnail', + 'src': src}) + imgDivNode = ET.SubElement(bodyDivNode, + 'div', + attrib={'style': 'text-align: left;'}) + src = "/web/image/%s" % str(imgId) + ET.SubElement(imgDivNode, + 'img', + attrib={'class': 'img-thumbnail', + 'src': src}) + arch = ET.tostring(rootNode, encoding='utf-8', xml_declaration=False) + vals = { + 'name': pageName, + 'type': 'qweb', + 'arch': arch, + 'page': True, + } + view_id = self.env['ir.ui.view'].create(vals) + return view_id.id + + def setUp(self): + super(TestWizardCommon, self).setUp() + self.pageName = False + self.imgXmlId = False + self.pageTemplate = False + # Loads the data file before + module = sys.modules[self.__class__.__module__] + base_path = os.path.dirname(module.__file__) + for path in self._data_files: + path = path.split('/') + path.insert(0, base_path) + path = os.path.join(*path) + convert_xml_import(self.cr, self._module_ns, path) diff --git a/help_online/tests/data/help_test_data.xml b/help_online/tests/data/help_test_data.xml index 3d939d21fb30..cfc8b03884d8 100644 --- a/help_online/tests/data/help_test_data.xml +++ b/help_online/tests/data/help_test_data.xml @@ -1,5 +1,5 @@ - + iVBORw0KGgoAAAANSUhEUgAAANwAAAAzCAIAAABzKvGBAAAOOUlEQVR42u1beVRU5xWfYcZh3wao @@ -75,4 +75,4 @@ YFBaQ6YYbTbt679Y0nIRIfKXS1d/8J7oqRWRGxO2b92S+NyzK2n3aAwoCf/7jpEfsQAoxU3nESI/ image/png - \ No newline at end of file + diff --git a/help_online/tests/test_export_help_wizard.py b/help_online/tests/test_export_help_wizard.py index 097e03b2a2eb..933ca3cb54b9 100644 --- a/help_online/tests/test_export_help_wizard.py +++ b/help_online/tests/test_export_help_wizard.py @@ -1,105 +1,17 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Cédric Pigeon -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -import logging +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + import base64 from lxml import etree as ET -from anybox.testing.openerp import SharedSetupTransactionCase - -_logger = logging.getLogger(__name__) - - -class test_export_help_wizard(object): - _data_files = ('data/help_test_data.xml',) +import odoo.tests.common as common +from .common import TestWizardCommon - _module_ns = 'help_online' - def createPage(self, pageName, imgXmlId=False): - imgId = False - if imgXmlId: - imgId = self.ref('%s.%s' % (self._module_ns, imgXmlId)) - - rootNode = ET.Element('t') - rootNode.attrib['name'] = pageName - rootNode.attrib['t-name'] = "website.%s" % pageName - tNode = ET.SubElement(rootNode, - 't', - attrib={'t-call': 'website.layout'}) - structDivNode = ET.SubElement(tNode, - 'div', - attrib={'class': 'oe_structure oe_empty', - 'id': 'wrap'}) - sectionNode = ET.SubElement(structDivNode, - 'section', - attrib={'class': 'mt16 mb16'}) - containerNode = ET.SubElement(sectionNode, - 'div', - attrib={'class': 'container'}) - rowNode = ET.SubElement(containerNode, - 'div', - attrib={'class': 'row'}) - bodyDivNode = ET.SubElement(rowNode, - 'div', - attrib={'class': 'col-md-12 ' - 'text-center mt16 mb32'}) - style = "font-family: 'Helvetica Neue', Helvetica,"\ - " Arial, sans-serif; color: rgb(51, 51, 51);"\ - " text-align: left;" - h2Node = ET.SubElement(bodyDivNode, - 'h2', - attrib={'style': style}) - h2Node.text = "Test Sample Title" - if imgId: - imgDivNode = ET.SubElement(bodyDivNode, - 'div', - attrib={'style': 'text-align: left;'}) - src = "/website/image?field=datas&"\ - "model=ir.attachment&id=%s" % str(imgId) - ET.SubElement(imgDivNode, - 'img', - attrib={'class': 'img-thumbnail', - 'src': src}) - imgDivNode = ET.SubElement(bodyDivNode, - 'div', - attrib={'style': 'text-align: left;'}) - src = "/website/image/ir.attachment/%s_ccc838d/datas" % str(imgId) - ET.SubElement(imgDivNode, - 'img', - attrib={'class': 'img-thumbnail', - 'src': src}) - arch = ET.tostring(rootNode, encoding='utf-8', xml_declaration=False) - vals = { - 'name': pageName, - 'type': 'qweb', - 'arch': arch, - 'page': True, - } - view_id = self.env['ir.ui.view'].create(vals) - return view_id.id - - def setUp(self): - super(test_export_help_wizard, self).setUp() - self.pageName = False - self.imgXmlId = False - self.pageTemplate = False +class TestExportHelpWizard(TestWizardCommon): + pageName = None + imgXmlId = None def test_export_help(self): """ @@ -115,7 +27,7 @@ def test_export_help(self): parser = ET.XMLParser(remove_blank_text=True) rootXml = ET.XML(xmlData, parser=parser) - xPath = ".//template[@id='website.%s']" % self.pageName + xPath = ".//template[@id='__export__.%s']" % self.pageName templateNodeList = rootXml.findall(xPath) self.assertEqual(len(templateNodeList), 1) self.assertNotIn("website.", templateNodeList[0].attrib['name']) @@ -123,7 +35,8 @@ def test_export_help(self): if self.imgXmlId: xPath = ".//record[@id='%s']" % self.imgXmlId imgNodeList = rootXml.findall(xPath) - self.assertEqual(len(imgNodeList), 2) + self.assertEqual(len(imgNodeList), 1, + 'The same image should be exported only once') for imgElem in templateNodeList[0].iter('img'): imgSrc = imgElem.get('src') @@ -131,29 +44,27 @@ def test_export_help(self): self.assertIn("/ir.attachment/%s|" % self.imgXmlId, imgSrc) else: - self.assertIn("id=%s" % self.imgXmlId, imgSrc) + self.assertIn("/web/image/%s" % self.imgXmlId, imgSrc) if self.pageTemplate: - xPath = ".//template[@id='website.%s_snippet']" % self.pageName + xPath = ".//template[@id='__export__.%s_snippet']" % self.pageName templateNodeList = rootXml.findall(xPath) self.assertEqual(len(templateNodeList), 1) self.assertNotIn("website.", templateNodeList[0].attrib['name']) -class test_export_help_with_image(test_export_help_wizard, - SharedSetupTransactionCase): +class TestExportHelpWithImage(TestExportHelpWizard, common.TransactionCase): def setUp(self): - super(test_export_help_with_image, self).setUp() + super(TestExportHelpWithImage, self).setUp() parameter_model = self.env['ir.config_parameter'] page_prefix = parameter_model.get_param('help_online_page_prefix') self.pageName = '%stest-page' % page_prefix - self.imgXmlId = 'test_img_1' + self.imgXmlId = '%s.test_img_1' % self._module_ns -class test_export_help_template(test_export_help_wizard, - SharedSetupTransactionCase): +class TestExportHelpTemplate(TestExportHelpWizard, common.TransactionCase): def setUp(self): - super(test_export_help_template, self).setUp() + super(TestExportHelpTemplate, self).setUp() parameter_model = self.env['ir.config_parameter'] param = 'help_online_template_prefix' template_prefix = parameter_model.get_param(param) diff --git a/help_online/tests/test_help_online.py b/help_online/tests/test_help_online.py new file mode 100644 index 000000000000..8c9635765aad --- /dev/null +++ b/help_online/tests/test_help_online.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import mock + +import odoo.tests.common as common +from .common import TestWizardCommon + + +class TestHelpOnline(TestWizardCommon, common.TransactionCase): + + def test_get_page_url(self): + model = 'res.partner' + help_online = self.env['help.online'] + user = self.env.user + group_writer = self.env.ref('help_online.help_online_group_writer') + group_reader = self.env.ref('help_online.help_online_group_reader') + self.assertTrue(user.has_group('help_online.help_online_group_writer')) + website = self.env['website'] + with mock.patch.object(website.__class__, + 'search_pages') as search_pages: + # The expected page dosn't exist + search_pages.return_value = [] + info = help_online.get_page_url(model, 'form') + self.assertDictEqual( + {'exists': False, + 'title': 'Create Help page for Partner', + 'url': 'website/add/help-res-partner'}, info, + "If the user is member of help_online_group_writer " + "and the page doesn't exist, the module should return an url " + "to create the page") + # remove user of group writer. + group_writer.write({'users': [(3, self.env.user.id)]}) + info = help_online.get_page_url(model, 'form') + self.assertDictEqual( + {}, info, + "If the user is not member of help_online_group_writer " + "and the page doesn't exist, the module should return an " + "empty dict") + # The expected page exists + search_pages.return_value = [{'loc': 'pages/help-res-partner'}] + self.assertTrue( + user.has_group('help_online.help_online_group_reader')) + info = help_online.get_page_url(model, 'form') + self.assertDictEqual( + {'exists': True, + 'title': 'Help on Partner', + 'url': 'pages/help-res-partner#form'}, info, + "If the user is member of help_online_group_reader " + "and the page exists, the module should return an url " + "to the page") + # remove user from group reader + group_reader.write({'users': [(3, self.env.user.id)]}) + info = help_online.get_page_url(model, 'form') + self.assertDictEqual( + {}, info, + "If the user is not member of help_online_group_reader " + "and the page exists, the module should return an empty dict") diff --git a/help_online/tests/test_import_help_wizard.py b/help_online/tests/test_import_help_wizard.py new file mode 100644 index 000000000000..d9b64e868178 --- /dev/null +++ b/help_online/tests/test_import_help_wizard.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import base64 + +import odoo.tests.common as common +from .common import TestWizardCommon + + +class TestImportHelpWizard(TestWizardCommon, common.TransactionCase): + + def setUp(self): + super(TestImportHelpWizard, self).setUp() + self.page_name = "export_import_help" + self.img_xml_id = '%s.test_img_1' % self._module_ns + self.img_name = self.env.ref(self.img_xml_id).name + self.ir_attchement = self.env['ir.attachment'] + self.ir_ui_view = self.env['ir.ui.view'] + self.export_help_wizard = self.env['export.help.wizard'] + self.import_help_wizard = self.env['import.help.wizard'] + + def _do_check_resources(self, expected=1): + pages = self.ir_ui_view.search([('name', '=', self.page_name)]) + self.assertEqual(expected, len(pages)) + attachments = self.ir_attchement.search( + [('name', '=', self.img_name)]) + self.assertEqual(expected, len(attachments)) + + def test_import_help(self): + self.createPage(pageName=self.page_name, imgXmlId=self.img_xml_id) + self._do_check_resources() + wizard = self.export_help_wizard.create({}) + wizard.export_help() + xmlData = base64.decodestring(wizard.data) + self.env.ref(self.img_xml_id).unlink() + self.ir_ui_view.search([('name', '=', self.page_name)]).unlink() + self._do_check_resources(0) + wizard = self.import_help_wizard.create({ + 'source_file': base64.encodestring(xmlData) + }) + wizard.import_help() + self._do_check_resources() + + def test_import_export_help(self): + """Check that exported data are not ducplicated by export / import + """ + self.createPage(pageName=self.page_name, imgXmlId=self.img_xml_id) + self._do_check_resources() + # export + wizard = self.export_help_wizard.create({}) + wizard.export_help() + xmlData = base64.decodestring(wizard.data) + self._do_check_resources() + wizard = self.import_help_wizard.create({ + 'source_file': base64.encodestring(xmlData) + }) + wizard.import_help() + self._do_check_resources() diff --git a/help_online/views/export_help_wizard_view.xml b/help_online/views/export_help_wizard_view.xml deleted file mode 100644 index a97884386051..000000000000 --- a/help_online/views/export_help_wizard_view.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - export.help.wizard.view - export.help.wizard - form - -
- - - - -

- This wizard allow you to export all QWeb views - related to help online. The result will be an Odoo - data xml file. -

-
- - - -
- -
-
-
-
- - - Export Help - export.help.wizard - - form - form - new - ir.actions.act_window - -
-
\ No newline at end of file diff --git a/help_online/views/help_online_view.xml b/help_online/views/help_online_view.xml index b4c9137a27bf..7e5e024d518c 100644 --- a/help_online/views/help_online_view.xml +++ b/help_online/views/help_online_view.xml @@ -1,28 +1,24 @@ - - - - - - - Website Pages - ir.ui.view - - form - tree,form - {"search_default_website":1} - - - - - - - - - + + + + + Website Pages + ir.ui.view + + form + tree,form + {"search_default_website":1} + + + + + + + + diff --git a/help_online/views/import_help_wizard_view.xml b/help_online/views/import_help_wizard_view.xml deleted file mode 100644 index 15aa93c350f5..000000000000 --- a/help_online/views/import_help_wizard_view.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - import.help.wizard.view - import.help.wizard - form - -
- -

- This wizard allow you to import QWeb views - related to help online. The required file format is an Odoo - data xml file. -

-
- - - -
- -
-
-
-
- - - Import Help - import.help.wizard - - form - form - new - ir.actions.act_window - - -
-
\ No newline at end of file diff --git a/help_online/views/ir_ui_view_view.xml b/help_online/views/ir_ui_view_view.xml index de42f9ca8f98..fa1ae16da476 100644 --- a/help_online/views/ir_ui_view_view.xml +++ b/help_online/views/ir_ui_view_view.xml @@ -1,28 +1,24 @@ - - + + + ir.ui.view search (help_online) + + ir.ui.view + + + + + + - - ir.ui.view search (help_online) - - ir.ui.view - - - - - - - - - ir.ui.view form (help_online) - - ir.ui.view - - - - - - - - - + + ir.ui.view form (help_online) + + ir.ui.view + + + + + + + diff --git a/help_online/views/website_help_online.xml b/help_online/views/website_help_online.xml deleted file mode 100644 index ae504364adff..000000000000 --- a/help_online/views/website_help_online.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/help_online/wizards/__init__.py b/help_online/wizards/__init__.py new file mode 100644 index 000000000000..d3b6f54726ed --- /dev/null +++ b/help_online/wizards/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import export_help_wizard +from . import import_help_wizard diff --git a/help_online/models/export_help_wizard.py b/help_online/wizards/export_help_wizard.py similarity index 54% rename from help_online/models/export_help_wizard.py rename to help_online/wizards/export_help_wizard.py index 810631841c27..e7c7da9179b2 100644 --- a/help_online/models/export_help_wizard.py +++ b/help_online/wizards/export_help_wizard.py @@ -1,31 +1,18 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Authors: Cédric Pigeon -# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + import logging import base64 import time import copy - +import urlparse +from werkzeug.routing import Map, Rule from lxml import etree as ET -from openerp import models, fields, api, exceptions -from openerp.tools.translate import _ +from odoo import models, fields, api, exceptions +from odoo.tools.translate import _ +from odoo.addons.web.controllers.main import Binary +from odoo.addons.website.controllers.main import WebsiteBinary _logger = logging.getLogger(__name__) @@ -43,94 +30,114 @@ class ExportHelpWizard(models.TransientModel): data = fields.Binary('XML', readonly=True) export_filename = fields.Char('Export XML Filename', size=128) - def _manage_images_on_page(self, page_node, data_node, images_reference): + binary = Binary() + websiteBinary = WebsiteBinary() + + img_url_map = Map([ + Rule('/web/image'), + Rule('/web/image/'), + Rule('/web/image//'), + Rule('/web/image//x'), + Rule('/web/image//x/' + ''), + Rule('/web/image///'), + Rule('/web/image////' + ''), + Rule('/web/image////' + 'x'), + Rule('/web/image////' + 'x/'), + Rule('/web/image/'), + Rule('/web/image//'), + Rule('/web/image//x'), + Rule('/web/image//x/'), + Rule('/web/image/-'), + Rule('/web/image/-/'), + Rule('/web/image/-/x'), + Rule('/web/image/-/x' + '/'), + Rule('/website/image'), + Rule('/website/image/'), + Rule('/website/image//x'), + Rule('/website/image//'), + Rule('/website/image///x'), + Rule('/website/image///'), + Rule('/website/image////x') + ]) + + def _manage_images_on_page(self, page_node, data_node, exported_resources): """ - - Extract images from page and generate a xml node + - Extract images from page and generate an xml node - Replace db id in url with xml id """ - - def get_attach_id(images_reference, - img_model, img_src, generated_xml_id=False): - attach_id = False - if 'id=' in img_src: - id_pos = img_src.index('id=') + 3 - attach_id = img_src[id_pos:] - else: - fragments = img_src.split('ir.attachment/') - attach_id, _ = fragments[1].split('_', 1) - - if attach_id in images_reference: - xml_id = images_reference[attach_id] - else: - ir_data = self.env['ir.model.data'].search( - [('model', '=', img_model), - ('res_id', '=', attach_id)]) - xml_id = generated_xml_id - if ir_data: - xml_id = ir_data[0].name - images_reference[attach_id] = xml_id - - return attach_id, xml_id - - def substitute_id_by_xml_id(img_src, attach_id, xml_id): - new_src = False - if 'id=' in img_src: - new_src = img_src.replace(attach_id, xml_id) - else: - fragments = img_src.split('ir.attachment/') - _, trail = fragments[1].split('_', 1) - new_src = "/website/image/ir.attachment/%s|%s" % \ - (xml_id, trail) - return new_src - - i_img = 0 img_model = 'ir.attachment' + urls = self.img_url_map.bind("dummy.org", "/") for img_elem in page_node.iter('img'): img_src = img_elem.get('src') - if img_model in img_src: - i_img += 1 - generated_xml_id = "%s_img_%s" % \ - (page_node.attrib['name'], str(i_img).rjust(2, '0')) - attach_id, xml_id = get_attach_id(images_reference, - img_model, - img_src, - generated_xml_id) - - new_src = substitute_id_by_xml_id(img_src, attach_id, xml_id) - - if not attach_id: - continue - - image = self.env[img_model].browse(int(attach_id)) - if not image: - continue - + parse_result = urlparse.urlparse(img_src) + path = parse_result.path + query_args = parse_result.query + if urls.test(parse_result.path, "GET"): + endpoint, kwargs = urls.match(path, "GET", + query_args=query_args) + kwargs.update(dict(urlparse.parse_qsl(query_args))) + image = None + # get the binary object + xml_id = kwargs.get('xmlid') + if xml_id: + image = self.env.ref(xml_id, False) + else: + _id = kwargs.get('id') + model = kwargs.get('model', 'ir.attachment') + if _id and model: + _id, _, unique = str(_id).partition('_') + image = self.env[model].browse(int(_id)) + if (not image or + not image.exists() or + image._name != img_model): + raise exceptions.UserError( + _('Only images from ir.attachment are supported when ' + 'exporting help pages')) + exported_data = image.export_data( + ['id', + 'datas', + 'datas_fname', + 'name', + 'res_model', + 'mimetype'], + raw_data=False)['datas'][0] + xml_id = exported_data[0] + new_src = '/web/image/%s' % xml_id img_elem.attrib['src'] = new_src - img_node = ET.SubElement(data_node, - 'record', - attrib={'id': xml_id, - 'model': img_model}) + if xml_id in exported_resources: + continue + img_node = ET.SubElement( + data_node, + 'record', + attrib={'id': xml_id, + 'model': image._name}) field_node = ET.SubElement(img_node, 'field', attrib={'name': 'datas'}) - field_node.text = str(image.datas) + field_node.text = str(exported_data[1]) field_node = ET.SubElement(img_node, 'field', attrib={'name': 'datas_fname'}) - field_node.text = image.datas_fname + field_node.text = exported_data[2] field_node = ET.SubElement(img_node, 'field', attrib={'name': 'name'}) - field_node.text = image.name + field_node.text = exported_data[3] field_node = ET.SubElement(img_node, 'field', attrib={'name': 'res_model'}) - field_node.text = image.res_model + field_node.text = exported_data[4] field_node = ET.SubElement(img_node, 'field', attrib={'name': 'mimetype'}) - field_node.text = image.mimetype + field_node.text = exported_data[5] data_node.append(img_node) + exported_resources.add(xml_id) def _clean_href_urls(self, page_node, page_prefix, template_prefix): """ @@ -216,39 +223,71 @@ def _get_qweb_views_data(self): ('name', 'like', '%s%%' % page_prefix), ('name', 'like', '%s%%' % template_prefix)] - view_data_list = self.env['ir.ui.view'].search_read(domain, - ['arch', 'name'], - order='name') - xml_to_export = ET.Element('openerp') + ir_ui_views = self.env['ir.ui.view'].search(domain, order='name') + xml_to_export = ET.Element('odoo') data_node = ET.SubElement(xml_to_export, 'data') - images_reference = {} - for view_data in view_data_list: + exported_resources = set() + for ir_ui_view in ir_ui_views: parser = ET.XMLParser(remove_blank_text=True) - root = ET.XML(view_data['arch'], parser=parser) - + root = ET.XML(ir_ui_view.arch, parser=parser) root.tag = 'template' - template_id = root.attrib.pop('t-name') - root.attrib['name'] = view_data['name'].replace('website.', '') - root.attrib['id'] = template_id + xml_id = self._get_ir_ui_view_xml_id( + ir_ui_view, root.attrib.pop('t-name')) + root.attrib['name'] = ir_ui_view.name.replace('website.', '') + root.attrib['id'] = xml_id root.attrib['page'] = 'True' - self._manage_images_on_page(root, data_node, images_reference) + self._manage_images_on_page(root, data_node, exported_resources) self._clean_href_urls(root, page_prefix, template_prefix) data_node.append(root) if root.attrib['name'].startswith(template_prefix): snippet = self._generate_snippet_from_template(root, - template_id, + xml_id, template_prefix) data_node.append(snippet) - if len(view_data_list) > 0: + if len(ir_ui_views) > 0: return ET.tostring(xml_to_export, encoding='utf-8', xml_declaration=True, pretty_print=True) else: return False + @api.model + def _get_ir_ui_view_xml_id(self, ir_ui_view, template_name): + """This method check if an xml_id exists for the given ir.ui.view + If no xml_id exists, a new one is created with template name as + value to ensure that the import of the generated file will update + the existing view in place of creating new copies. + """ + ir_model_data = self.sudo().env['ir.model.data'] + data = ir_model_data.search([('model', '=', ir_ui_view._name), + ('res_id', '=', ir_ui_view.id)]) + if data: + if data[0].module: + return '%s.%s' % (data[0].module, data[0].name) + else: + return data[0].name + else: + module, name = template_name.split('.') + # always use __export__ as module by convention to + # avoid the removal by odoo of the exported pages on system + # update (-u ) + module = "__export__" + postfix = ir_model_data.search_count( + [('module', '=', module), + ('name', 'like', name)]) + if postfix: + name = '%s_%s' % (name, postfix) + ir_model_data.create({ + 'model': ir_ui_view._name, + 'res_id': ir_ui_view.id, + 'module': module, + 'name': name, + }) + return module + '.' + name + @api.multi def export_help(self): """ diff --git a/help_online/wizards/export_help_wizard_view.xml b/help_online/wizards/export_help_wizard_view.xml new file mode 100644 index 000000000000..3b2812008bd3 --- /dev/null +++ b/help_online/wizards/export_help_wizard_view.xml @@ -0,0 +1,50 @@ + + + + export.help.wizard.view + export.help.wizard + form + +
+ + + + +

+ This wizard allow you to export all QWeb views + related to help online. The result will be an Odoo + data xml file. +

+
+ + + +
+ +
+
+
+
+ + + Export Help + export.help.wizard + + form + form + new + ir.actions.act_window + +
diff --git a/help_online/wizards/import_help_wizard.py b/help_online/wizards/import_help_wizard.py new file mode 100644 index 000000000000..07517d50ef7a --- /dev/null +++ b/help_online/wizards/import_help_wizard.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import base64 +from cStringIO import StringIO +from lxml import etree +import logging +import os + +from odoo import api, fields, models +from odoo.tools import convert, misc +from odoo.tools.config import config + +_logger = logging.getLogger(__name__) + + +class XmlImport(convert.xml_import): + """Override base xml_import to be able to import record with an exported + xml_id ('__export__.XXX-XXX') + """ + + def _test_xml_id(self, xml_id): + if '.' in xml_id: + module, _id = xml_id.split('.') + if module == '__export__': + return True + super(XmlImport, self)._test_xml_id(xml_id) + + +class ImportHelpWizard(models.TransientModel): + _name = "import.help.wizard" + + source_file = fields.Binary('Source File') + + @api.multi + def import_help(self): + for this in self: + xmlfile = StringIO(base64.decodestring(this.source_file)) + doc = etree.parse(xmlfile) + relaxng = etree.RelaxNG( + etree.parse( + os.path.join(config['root_path'], 'import_xml.rng'))) + try: + relaxng.assert_(doc) + except Exception: + _logger.info('The XML file does not fit the required schema !', + exc_info=True) + _logger.info(misc.ustr(relaxng.error_log.last_error)) + raise + obj = XmlImport(self.env.cr, self._module, idref={}, mode='init', + report=None, noupdate=False, xml_filename=None) + obj.parse(doc.getroot(), mode='init') diff --git a/help_online/wizards/import_help_wizard_view.xml b/help_online/wizards/import_help_wizard_view.xml new file mode 100644 index 000000000000..75f4b6013f9b --- /dev/null +++ b/help_online/wizards/import_help_wizard_view.xml @@ -0,0 +1,43 @@ + + + + import.help.wizard.view + import.help.wizard + form + +
+ +

+ This wizard allow you to import QWeb views + related to help online. The required file format is an Odoo + data xml file. +

+
+ + + +
+ +
+
+
+
+ + + Import Help + import.help.wizard + + form + form + new + ir.actions.act_window + +
diff --git a/setup/help_online/odoo/__init__.py b/setup/help_online/odoo/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/help_online/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/help_online/odoo/addons/__init__.py b/setup/help_online/odoo/addons/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/help_online/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/help_online/odoo/addons/help_online b/setup/help_online/odoo/addons/help_online new file mode 120000 index 000000000000..7b3896423544 --- /dev/null +++ b/setup/help_online/odoo/addons/help_online @@ -0,0 +1 @@ +../../../../help_online \ No newline at end of file diff --git a/setup/help_online/setup.py b/setup/help_online/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/help_online/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/web_chatter_paste/odoo/__init__.py b/setup/web_chatter_paste/odoo/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_chatter_paste/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_chatter_paste/odoo/addons/__init__.py b/setup/web_chatter_paste/odoo/addons/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_chatter_paste/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_chatter_paste/odoo/addons/web_chatter_paste b/setup/web_chatter_paste/odoo/addons/web_chatter_paste new file mode 120000 index 000000000000..46cfd16ec8c7 --- /dev/null +++ b/setup/web_chatter_paste/odoo/addons/web_chatter_paste @@ -0,0 +1 @@ +../../../../web_chatter_paste \ No newline at end of file diff --git a/setup/web_chatter_paste/setup.py b/setup/web_chatter_paste/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_chatter_paste/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/web_hide_db_manager_link/odoo/__init__.py b/setup/web_hide_db_manager_link/odoo/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_hide_db_manager_link/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_hide_db_manager_link/odoo/addons/__init__.py b/setup/web_hide_db_manager_link/odoo/addons/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_hide_db_manager_link/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_hide_db_manager_link/odoo/addons/web_hide_db_manager_link b/setup/web_hide_db_manager_link/odoo/addons/web_hide_db_manager_link new file mode 120000 index 000000000000..ad4e177e32d2 --- /dev/null +++ b/setup/web_hide_db_manager_link/odoo/addons/web_hide_db_manager_link @@ -0,0 +1 @@ +../../../../web_hide_db_manager_link \ No newline at end of file diff --git a/setup/web_hide_db_manager_link/setup.py b/setup/web_hide_db_manager_link/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_hide_db_manager_link/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/web_search_with_and/odoo/__init__.py b/setup/web_search_with_and/odoo/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_search_with_and/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_search_with_and/odoo/addons/__init__.py b/setup/web_search_with_and/odoo/addons/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_search_with_and/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_search_with_and/odoo/addons/web_search_with_and b/setup/web_search_with_and/odoo/addons/web_search_with_and new file mode 120000 index 000000000000..d32981712daa --- /dev/null +++ b/setup/web_search_with_and/odoo/addons/web_search_with_and @@ -0,0 +1 @@ +../../../../web_search_with_and \ No newline at end of file diff --git a/setup/web_search_with_and/setup.py b/setup/web_search_with_and/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_search_with_and/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/web_translate_dialog/odoo/__init__.py b/setup/web_translate_dialog/odoo/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_translate_dialog/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_translate_dialog/odoo/addons/__init__.py b/setup/web_translate_dialog/odoo/addons/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/setup/web_translate_dialog/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/web_translate_dialog/odoo/addons/web_translate_dialog b/setup/web_translate_dialog/odoo/addons/web_translate_dialog new file mode 120000 index 000000000000..a6d6ae992987 --- /dev/null +++ b/setup/web_translate_dialog/odoo/addons/web_translate_dialog @@ -0,0 +1 @@ +../../../../web_translate_dialog \ No newline at end of file diff --git a/setup/web_translate_dialog/setup.py b/setup/web_translate_dialog/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_translate_dialog/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_chatter_paste/README.rst b/web_chatter_paste/README.rst new file mode 100644 index 000000000000..77eafa8cbe78 --- /dev/null +++ b/web_chatter_paste/README.rst @@ -0,0 +1,67 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============= +Chatter Paste +============= + +Paste images and drop files (while composing a message) into the chatter and upload them directly as attachment. + +Configuration +============= + +No configuration is needed. + +Usage +===== + +To paste an image: + +#. Copy an image (e.g. a screenshot); +#. paste the image into the chatter's composer. + +To drop a file: + +#. Drag any file (multiple) from your file system; +#. drop them into the chatter's composer. + +.. 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 + +Known issues / Roadmap +====================== + +* Dropping files only works in Chrome. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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. + +Credits +======= + +Contributors +------------ + +* Dennis Sluijk + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/web_chatter_paste/__init__.py b/web_chatter_paste/__init__.py new file mode 100644 index 000000000000..cdd51248efbd --- /dev/null +++ b/web_chatter_paste/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import controllers diff --git a/web_chatter_paste/__manifest__.py b/web_chatter_paste/__manifest__.py new file mode 100644 index 000000000000..98c014d9f517 --- /dev/null +++ b/web_chatter_paste/__manifest__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Chatter Paste', + 'summary': """ + Paste images and drop files into the chatter and upload them directly + """, + 'version': '10.0.1.0.0', + 'category': 'Web', + 'author': 'Onestein,Odoo Community Association (OCA)', + 'website': 'http://www.onestein.eu', + 'license': 'AGPL-3', + 'depends': [ + 'base', + 'web' + ], + 'data': [ + 'templates/assets.xml' + ], + 'installable': True, + 'application': False, +} diff --git a/web_chatter_paste/controllers/__init__.py b/web_chatter_paste/controllers/__init__.py new file mode 100644 index 000000000000..12c570cca0ef --- /dev/null +++ b/web_chatter_paste/controllers/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import main diff --git a/web_chatter_paste/controllers/main.py b/web_chatter_paste/controllers/main.py new file mode 100644 index 000000000000..65b5761135df --- /dev/null +++ b/web_chatter_paste/controllers/main.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import http +from json import dumps + + +class ChatterPasteController(http.Controller): + + @http.route('/web_chatter_paste/upload_attachment', type='http', + auth="user") + def upload_attachment(self, callback, model, id, filename, mimetype, + content): + request = http.request + model_obj = request.env['ir.attachment'] + out = """""" + attachment = model_obj.create({ + 'name': filename, + 'datas': content, + 'datas_fname': filename, + 'res_model': model, + 'res_id': int(id) + }) + args = { + 'filename': filename, + 'mimetype': mimetype, + 'id': attachment.id + } + return out % (dumps(callback), dumps(args)) diff --git a/web_chatter_paste/static/src/js/web_chatter_paste.js b/web_chatter_paste/static/src/js/web_chatter_paste.js new file mode 100644 index 000000000000..be13f53cad3d --- /dev/null +++ b/web_chatter_paste/static/src/js/web_chatter_paste.js @@ -0,0 +1,110 @@ +/* Copyright 2017 Onestein +* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define('web_chatter_paste', function (require) { +"use strict"; + var core = require('web.core'), + composer = require('mail.composer'); + + composer.BasicComposer.include({ + start: function() { + var self = this; + var res = this._super.apply(this, arguments); + this.$('.o_composer_text_field').bind('drop', function(e) { + e.stopPropagation(); + e.preventDefault(); + var files = e.originalEvent.dataTransfer.files; + var i = 0; + + var next = function() { + $(window).off(self.fileupload_id, next); + i++; + upload(); + } + + var upload = function() { + if (files.length <= i) return; + var reader = new FileReader(); + reader.onload = function() { + $(window).on(self.fileupload_id, next); + self.add_as_attachment(reader.result, files[i].name); + } + reader.readAsDataURL(files[i]); + } + upload(); + }); + this.$('.o_composer_text_field').bind('paste', function(e) { + if (!e.originalEvent.clipboardData.items) return; + var items = e.originalEvent.clipboardData.items; + for (var i = 0; i < items.length; i++) { + var item = items[i]; + if (item.type != 'image/png') continue; + var reader = new FileReader(); + reader.onload = function() { + self.add_as_attachment(reader.result, _.uniqueId('pasted_file') + '.png'); + } + reader.readAsDataURL(item.getAsFile()); + } + }); + return res; + }, + add_as_attachment: function(data, filename, cb) { + //Fetch mimetype and base64 + var mimetype = data.substring(5, data.indexOf(';')); + var base64_data = data.substr(data.indexOf(',') + 1, data.length); + + //Change and submit form + this.prepare_form(); + this.$('form.o_form_binary_form input.filename').val(filename); + this.$('form.o_form_binary_form input.content').val(base64_data); + this.$('form.o_form_binary_form input.mimetype').val(mimetype); + + this.$('form.o_form_binary_form').submit(); + this.reverse_form(); + + var attachments = this.get('attachment_ids'); + this.$attachment_button.prop('disabled', true); + attachments.push({ + 'id': 0, + 'name': _.uniqueId('attachment_name'), + 'filename': filename, + 'url': filename, + 'upload': true, + 'mimetype': '', + }); + }, + prepare_form: function() { + //Change action + this.$('form.o_form_binary_form').attr('action', '/web_chatter_paste/upload_attachment'); + + //Remove ufile + this.$('form.o_form_binary_form input.o_form_input_file').remove(); + + //Add hidden input content + var $content = $(''); + this.$('form.o_form_binary_form').append($content); + + //Add hidden input filename + var $filename = $(''); + this.$('form.o_form_binary_form').append($filename); + + //Add hidden input filename + var $mimetype = $(''); + this.$('form.o_form_binary_form').append($mimetype); + }, + reverse_form: function() { + //Change action + this.$('form.o_form_binary_form').attr('action', '/web/binary/upload_attachment'); + + //Remove new input + this.$('form.o_form_binary_form input.content').remove(); + this.$('form.o_form_binary_form input.filename').remove(); + this.$('form.o_form_binary_form input.mimetype').remove(); + + //Restore old input + var $ufile = $(''); + this.$('form.o_form_binary_form').append($ufile); + + } + }); +}); diff --git a/web_chatter_paste/templates/assets.xml b/web_chatter_paste/templates/assets.xml new file mode 100644 index 000000000000..d0040869d37c --- /dev/null +++ b/web_chatter_paste/templates/assets.xml @@ -0,0 +1,12 @@ + + + + +