diff --git a/web_shortcuts/LICENSE b/web_shortcut/LICENSE similarity index 86% rename from web_shortcuts/LICENSE rename to web_shortcut/LICENSE index ff64be44..20cf6ab4 100644 --- a/web_shortcuts/LICENSE +++ b/web_shortcut/LICENSE @@ -1,5 +1,5 @@ -OpenERP, Open Source Management Solution -Copyright © 2010-2011 OpenERP SA (). +Odoo, Open Source Management Solution +Copyright © 2010-2011 Odoo SA (). This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/web_shortcut/README.rst b/web_shortcut/README.rst new file mode 100644 index 00000000..5cd32a9c --- /dev/null +++ b/web_shortcut/README.rst @@ -0,0 +1,65 @@ +.. 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 + +============= +Shortcut Menu +============= + +Adds a button to the top menu which opens a menu containing the user's shortcuts. + +Configuration +============= + +To configure this module, you need to: + +#. Go to any view; +#. click on the star icon besides the title to add / remove a shortcut. + +Usage +===== + +To use this module, you need to: + +#. Click on the star icon in the right corner of the top menu; +#. click the shortcut you want. + +.. 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 + +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 +------------ + +* Adrien Peiffer +* Dennis Sluijk +* Odoo SA +* Thomas Binsfeld + +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. + +**This module is a port from Odoo SA and as such, it is not included in the OCA CLA. That means we do not have a copy of the copyright on it like all other OCA modules.** diff --git a/web_shortcut/__init__.py b/web_shortcut/__init__.py new file mode 100644 index 00000000..9069ef63 --- /dev/null +++ b/web_shortcut/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2010 Odoo SA (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/web_shortcut/__manifest__.py b/web_shortcut/__manifest__.py new file mode 100644 index 00000000..39c67709 --- /dev/null +++ b/web_shortcut/__manifest__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2010-2011 Odoo SA (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + 'name': 'Shortcut Menu', + 'version': '10.0.1.0.0', + 'category': 'Web', + 'author': 'Odoo SA,Odoo Community Association (OCA)', + 'website': 'http://openerp.com', + 'depends': [ + 'base', + 'web' + ], + 'data': [ + 'security/ir.model.access.csv', + 'templates/assets.xml', + ], + 'qweb': [ + 'static/src/xml/web_shortcut.xml' + ], + 'installable': True, + 'auto_install': False, + 'license': 'AGPL-3', +} diff --git a/web_shortcuts/i18n/ar.po b/web_shortcut/i18n/ar.po similarity index 90% rename from web_shortcuts/i18n/ar.po rename to web_shortcut/i18n/ar.po index 2829cfca..995eb495 100644 --- a/web_shortcuts/i18n/ar.po +++ b/web_shortcut/i18n/ar.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-27 05:39+0000\n" "X-Generator: Launchpad (build 16845)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "إضافة / إزالة مختَصَر" diff --git a/web_shortcuts/i18n/bs.po b/web_shortcut/i18n/bs.po similarity index 90% rename from web_shortcuts/i18n/bs.po rename to web_shortcut/i18n/bs.po index 1192b929..38d1b9cf 100644 --- a/web_shortcuts/i18n/bs.po +++ b/web_shortcut/i18n/bs.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Dodaj / Ukloni pračicu..." diff --git a/web_shortcuts/i18n/cs.po b/web_shortcut/i18n/cs.po similarity index 90% rename from web_shortcuts/i18n/cs.po rename to web_shortcut/i18n/cs.po index c470b1bb..deceda5b 100644 --- a/web_shortcuts/i18n/cs.po +++ b/web_shortcut/i18n/cs.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:21 #, python-format msgid "Add / Remove Shortcut..." msgstr "Přidat / Odebrat zkratku..." diff --git a/web_shortcuts/i18n/da.po b/web_shortcut/i18n/da.po similarity index 90% rename from web_shortcuts/i18n/da.po rename to web_shortcut/i18n/da.po index 8ca1fccb..3ffeaa76 100644 --- a/web_shortcuts/i18n/da.po +++ b/web_shortcut/i18n/da.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Tilføj/fjern genvej ..." diff --git a/web_shortcuts/i18n/de.po b/web_shortcut/i18n/de.po similarity index 90% rename from web_shortcuts/i18n/de.po rename to web_shortcut/i18n/de.po index 926b73f6..077f62ab 100644 --- a/web_shortcuts/i18n/de.po +++ b/web_shortcut/i18n/de.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Hinzufügen/Entfernen Lesezeichen ..." diff --git a/web_shortcuts/i18n/el.po b/web_shortcut/i18n/el.po similarity index 89% rename from web_shortcuts/i18n/el.po rename to web_shortcut/i18n/el.po index ddd90295..cfbbe9cc 100644 --- a/web_shortcuts/i18n/el.po +++ b/web_shortcut/i18n/el.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "" diff --git a/web_shortcuts/i18n/en_GB.po b/web_shortcut/i18n/en_GB.po similarity index 90% rename from web_shortcuts/i18n/en_GB.po rename to web_shortcut/i18n/en_GB.po index abb0ddc3..122033f1 100644 --- a/web_shortcuts/i18n/en_GB.po +++ b/web_shortcut/i18n/en_GB.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Add / Remove Shortcut..." diff --git a/web_shortcuts/i18n/es.po b/web_shortcut/i18n/es.po similarity index 90% rename from web_shortcuts/i18n/es.po rename to web_shortcut/i18n/es.po index 3167b349..06543176 100644 --- a/web_shortcuts/i18n/es.po +++ b/web_shortcut/i18n/es.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Añadir / Eliminar acceso directo..." diff --git a/web_shortcuts/i18n/fi.po b/web_shortcut/i18n/fi.po similarity index 90% rename from web_shortcuts/i18n/fi.po rename to web_shortcut/i18n/fi.po index 61b303fa..c4035ab8 100644 --- a/web_shortcuts/i18n/fi.po +++ b/web_shortcut/i18n/fi.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Lisää / Poista pikavalinta..." diff --git a/web_shortcuts/i18n/fr.po b/web_shortcut/i18n/fr.po similarity index 90% rename from web_shortcuts/i18n/fr.po rename to web_shortcut/i18n/fr.po index 4c22712f..17f85703 100644 --- a/web_shortcuts/i18n/fr.po +++ b/web_shortcut/i18n/fr.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Ajouter / supprimer un raccourci..." diff --git a/web_shortcuts/i18n/gl.po b/web_shortcut/i18n/gl.po similarity index 90% rename from web_shortcuts/i18n/gl.po rename to web_shortcut/i18n/gl.po index b6a61f50..382e6571 100644 --- a/web_shortcuts/i18n/gl.po +++ b/web_shortcut/i18n/gl.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2014-02-06 06:25+0000\n" "X-Generator: Launchpad (build 16916)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Engadir / Eliminar atallo..." diff --git a/web_shortcuts/i18n/hr.po b/web_shortcut/i18n/hr.po similarity index 90% rename from web_shortcuts/i18n/hr.po rename to web_shortcut/i18n/hr.po index 3bf7a375..3d78a6af 100644 --- a/web_shortcuts/i18n/hr.po +++ b/web_shortcut/i18n/hr.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Dodaj / ukloni prečac..." diff --git a/web_shortcuts/i18n/hu.po b/web_shortcut/i18n/hu.po similarity index 90% rename from web_shortcuts/i18n/hu.po rename to web_shortcut/i18n/hu.po index 9fad2e36..9abafaf5 100644 --- a/web_shortcuts/i18n/hu.po +++ b/web_shortcut/i18n/hu.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Billentyűkombináció hozzáadása/eltávolítása" diff --git a/web_shortcuts/i18n/it.po b/web_shortcut/i18n/it.po similarity index 90% rename from web_shortcuts/i18n/it.po rename to web_shortcut/i18n/it.po index 8a7d2d0e..754d58a7 100644 --- a/web_shortcuts/i18n/it.po +++ b/web_shortcut/i18n/it.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Aggiungi / Rimuovi Scorciatoia..." diff --git a/web_shortcuts/i18n/lt.po b/web_shortcut/i18n/lt.po similarity index 90% rename from web_shortcuts/i18n/lt.po rename to web_shortcut/i18n/lt.po index ae6c868d..14c0afeb 100644 --- a/web_shortcuts/i18n/lt.po +++ b/web_shortcut/i18n/lt.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Pridėti / pašalinti trumpinį..." diff --git a/web_shortcuts/i18n/mk.po b/web_shortcut/i18n/mk.po similarity index 90% rename from web_shortcuts/i18n/mk.po rename to web_shortcut/i18n/mk.po index ec0c16b9..4bb5668a 100644 --- a/web_shortcuts/i18n/mk.po +++ b/web_shortcut/i18n/mk.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Додади / Отстрани кратенка" diff --git a/web_shortcuts/i18n/mn.po b/web_shortcut/i18n/mn.po similarity index 90% rename from web_shortcuts/i18n/mn.po rename to web_shortcut/i18n/mn.po index 559d3edf..6d396ea6 100644 --- a/web_shortcuts/i18n/mn.po +++ b/web_shortcut/i18n/mn.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Шуут холбоосыг Нэмэх / Устгах ..." diff --git a/web_shortcuts/i18n/nl.po b/web_shortcut/i18n/nl.po similarity index 90% rename from web_shortcuts/i18n/nl.po rename to web_shortcut/i18n/nl.po index 655f634a..f4fd9341 100644 --- a/web_shortcuts/i18n/nl.po +++ b/web_shortcut/i18n/nl.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Toevoegen/verwijderen snelkoppeling" diff --git a/web_shortcuts/i18n/pl.po b/web_shortcut/i18n/pl.po similarity index 90% rename from web_shortcuts/i18n/pl.po rename to web_shortcut/i18n/pl.po index 4c08366b..c27171b5 100644 --- a/web_shortcuts/i18n/pl.po +++ b/web_shortcut/i18n/pl.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Dodaj / Usuń skrót" diff --git a/web_shortcuts/i18n/pt.po b/web_shortcut/i18n/pt.po similarity index 90% rename from web_shortcuts/i18n/pt.po rename to web_shortcut/i18n/pt.po index 92d27cb7..22609c27 100644 --- a/web_shortcuts/i18n/pt.po +++ b/web_shortcut/i18n/pt.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Adicionar / Remover atalho..." diff --git a/web_shortcuts/i18n/pt_BR.po b/web_shortcut/i18n/pt_BR.po similarity index 90% rename from web_shortcuts/i18n/pt_BR.po rename to web_shortcut/i18n/pt_BR.po index 4b71460a..a86519b7 100644 --- a/web_shortcuts/i18n/pt_BR.po +++ b/web_shortcut/i18n/pt_BR.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Adicionar / Remover atalho ..." diff --git a/web_shortcuts/i18n/ro.po b/web_shortcut/i18n/ro.po similarity index 90% rename from web_shortcuts/i18n/ro.po rename to web_shortcut/i18n/ro.po index 83732827..ac71aaf3 100644 --- a/web_shortcuts/i18n/ro.po +++ b/web_shortcut/i18n/ro.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Adauga / Sterge Shortcut..." diff --git a/web_shortcuts/i18n/ru.po b/web_shortcut/i18n/ru.po similarity index 90% rename from web_shortcuts/i18n/ru.po rename to web_shortcut/i18n/ru.po index 88cdc97a..ad748419 100644 --- a/web_shortcuts/i18n/ru.po +++ b/web_shortcut/i18n/ru.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Добавить / Удалить ярлык..." diff --git a/web_shortcuts/i18n/sl.po b/web_shortcut/i18n/sl.po similarity index 90% rename from web_shortcuts/i18n/sl.po rename to web_shortcut/i18n/sl.po index 47f764b0..1a5f4bf4 100644 --- a/web_shortcuts/i18n/sl.po +++ b/web_shortcut/i18n/sl.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Dodaj / Odstrani bližnjico..." diff --git a/web_shortcuts/i18n/sv.po b/web_shortcut/i18n/sv.po similarity index 90% rename from web_shortcuts/i18n/sv.po rename to web_shortcut/i18n/sv.po index 559b58f8..77a7d2fb 100644 --- a/web_shortcuts/i18n/sv.po +++ b/web_shortcut/i18n/sv.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Lägg till/ta bort genväg..." diff --git a/web_shortcuts/i18n/th.po b/web_shortcut/i18n/th.po similarity index 90% rename from web_shortcuts/i18n/th.po rename to web_shortcut/i18n/th.po index 546a300c..d996458a 100644 --- a/web_shortcuts/i18n/th.po +++ b/web_shortcut/i18n/th.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:21 #, python-format msgid "Add / Remove Shortcut..." msgstr "เพิ่ม / ลบ ทางลัด ..." diff --git a/web_shortcuts/i18n/tr.po b/web_shortcut/i18n/tr.po similarity index 90% rename from web_shortcuts/i18n/tr.po rename to web_shortcut/i18n/tr.po index 5db7dc1f..c6e44e79 100644 --- a/web_shortcuts/i18n/tr.po +++ b/web_shortcut/i18n/tr.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:21 #, python-format msgid "Add / Remove Shortcut..." msgstr "Kısayol Ekle/Kaldır..." diff --git a/web_shortcuts/i18n/vi.po b/web_shortcut/i18n/vi.po similarity index 90% rename from web_shortcuts/i18n/vi.po rename to web_shortcut/i18n/vi.po index a593830c..7c9570e5 100644 --- a/web_shortcuts/i18n/vi.po +++ b/web_shortcut/i18n/vi.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "Thêm / Xóa đường dẫn ...." diff --git a/web_shortcuts/i18n/web_shortcuts.pot b/web_shortcut/i18n/web_shortcut.pot similarity index 82% rename from web_shortcuts/i18n/web_shortcuts.pot rename to web_shortcut/i18n/web_shortcut.pot index 0b1a05dc..4992dfc2 100644 --- a/web_shortcuts/i18n/web_shortcuts.pot +++ b/web_shortcut/i18n/web_shortcut.pot @@ -1,6 +1,6 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * web_shortcuts +# * web_shortcut # msgid "" msgstr "" @@ -15,9 +15,9 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "" diff --git a/web_shortcuts/i18n/zh_CN.po b/web_shortcut/i18n/zh_CN.po similarity index 90% rename from web_shortcuts/i18n/zh_CN.po rename to web_shortcut/i18n/zh_CN.po index d100b714..91ec66d8 100644 --- a/web_shortcuts/i18n/zh_CN.po +++ b/web_shortcut/i18n/zh_CN.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-11-21 06:38+0000\n" "X-Generator: Launchpad (build 16831)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "添加/删除快捷方式..." diff --git a/web_shortcuts/i18n/zh_TW.po b/web_shortcut/i18n/zh_TW.po similarity index 90% rename from web_shortcuts/i18n/zh_TW.po rename to web_shortcut/i18n/zh_TW.po index c9bbf4f5..2c89e8e6 100644 --- a/web_shortcuts/i18n/zh_TW.po +++ b/web_shortcut/i18n/zh_TW.po @@ -17,9 +17,9 @@ msgstr "" "X-Launchpad-Export-Date: 2013-12-30 05:07+0000\n" "X-Generator: Launchpad (build 16877)\n" -#. module: web_shortcuts +#. module: web_shortcut #. openerp-web -#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#: code:addons/web_shortcut/static/src/xml/web_shortcut.xml:20 #, python-format msgid "Add / Remove Shortcut..." msgstr "新增/移除捷徑..." diff --git a/web_shortcut/models/__init__.py b/web_shortcut/models/__init__.py new file mode 100644 index 00000000..7cfb0f01 --- /dev/null +++ b/web_shortcut/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Acsone SA/NV (http://www.acsone.eu) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import web_shortcut +from . import ir_ui_menu diff --git a/web_shortcut/models/ir_ui_menu.py b/web_shortcut/models/ir_ui_menu.py new file mode 100644 index 00000000..8776294d --- /dev/null +++ b/web_shortcut/models/ir_ui_menu.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-today Odoo SA () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api + + +class IrUiView(models.Model): + _inherit = 'ir.ui.menu' + + @api.multi + def unlink(self): + res = super(IrUiView, self).unlink() + shortcuts = self.env['web.shortcut'].search([('menu_id', '=', False)]) + shortcuts.unlink() + return res diff --git a/web_shortcut/models/web_shortcut.py b/web_shortcut/models/web_shortcut.py new file mode 100644 index 00000000..aafddd9d --- /dev/null +++ b/web_shortcut/models/web_shortcut.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-today Odoo SA () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api + + +class WebShortcut(models.Model): + _name = 'web.shortcut' + + name = fields.Char('Shortcut Name', size=64) + menu_id = fields.Many2one('ir.ui.menu', ondelete='cascade') + user_id = fields.Many2one('res.users', 'User Ref.', required=True, + ondelete='cascade', index=True, + default=lambda self: self.env.user.id) + + _sql_constraints = [ + ('shortcut_unique', 'unique(menu_id,user_id)', + 'Shortcut for this menu already exists!'), + ] + + @api.model + def get_user_shortcuts(self): + shortcuts = self.search([('user_id', '=', self.env.user.id)]) + res = [] + for shortcut in shortcuts.filtered('menu_id'): + _name = shortcut.menu_id.name_get() + _name = _name[0][1] if len(_name) else '' + _id = shortcut.menu_id.id + res.append( + { + 'id': shortcut.id, + 'name': _name, + 'menu_id': (_id, _name) + } + ) + return res diff --git a/web_shortcuts/security/ir.model.access.csv b/web_shortcut/security/ir.model.access.csv similarity index 97% rename from web_shortcuts/security/ir.model.access.csv rename to web_shortcut/security/ir.model.access.csv index 65ede9fb..c8ce4ebf 100644 --- a/web_shortcuts/security/ir.model.access.csv +++ b/web_shortcut/security/ir.model.access.csv @@ -1,2 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_web_shortcut,access_web_shortcut,model_web_shortcut,,1,1,1,1 \ No newline at end of file +access_web_shortcut,access_web_shortcut,model_web_shortcut,,1,1,1,1 diff --git a/web_shortcuts/static/description/icon.png b/web_shortcut/static/description/icon.png similarity index 100% rename from web_shortcuts/static/description/icon.png rename to web_shortcut/static/description/icon.png diff --git a/web_shortcut/static/src/css/web_shortcut.css b/web_shortcut/static/src/css/web_shortcut.css new file mode 100644 index 00000000..13acbdbe --- /dev/null +++ b/web_shortcut/static/src/css/web_shortcut.css @@ -0,0 +1,34 @@ +.oe_shortcut_toggle { + height: 20px; + margin-top: 2px; + width: 24px; + cursor: pointer; + display: block; + font-size: 20px; + float: left; + color: #a8a8a8; +} + +.oe_shortcut_toggle:focus { + color: #a8a8a8; +} + +.oe_shortcut_toggle:hover { + color: #ffd700; +} + +.oe_shortcut_remove { + color: #ffd700; +} + +.oe_shortcut_remove:focus { + color: #ffd700; +} + +.o_control_panel .breadcrumb { + width: calc(50% - 24px); +} + +.o_control_panel.o_breadcrumb_full .breadcrumb { + width: calc(100% - 24px); +} \ No newline at end of file diff --git a/web_shortcut/static/src/js/web_shortcut.js b/web_shortcut/static/src/js/web_shortcut.js new file mode 100644 index 00000000..e1ab907a --- /dev/null +++ b/web_shortcut/static/src/js/web_shortcut.js @@ -0,0 +1,187 @@ +/* Copyright 2004-today Odoo SA () + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define('web.shortcut', function (require) { + var Widget = require('web.Widget'), + WebClient = require('web.WebClient'), + ViewManager = require('web.ViewManager'), + ActionManager = require('web.ActionManager'), + core = require('web.core'), + qweb = core.qweb, + DataModel = require('web.DataModel'), + session = require('web.session'), + SystrayMenu = require('web.SystrayMenu'); + + var ShortcutMenu = Widget.extend({ + template: 'Systray.ShortcutMenu', + init: function () { + this._super(); + this.on('load', this, this.load); + this.on('add', this, this.add); + this.on('display', this, this.display); + this.on('remove', this, this.remove); + this.model = new DataModel('web.shortcut'); + }, + start: function () { + var self = this; + this._super(); + this.trigger('load'); + this.$el.on('click', '.oe_systray_shortcut_menu a', function () { + self.click($(this)); + }); + }, + load: function () { + var self = this; + return this.model.call('get_user_shortcuts', []).done(function (shortcuts) { + self.$el.find('.oe_systray_shortcut_menu').empty(); + _.each(shortcuts, function (sc) { + self.trigger('display', sc); + }); + }); + }, + add: function (sc) { + var self = this; + this.model.call('create', [sc]).then(function (out) { + self.trigger('load'); + }); + }, + display: function (sc) { + var self = this; + this.$el.find('.oe_systray_shortcut_menu').append(); + var $sc = $(qweb.render('Systray.ShortcutMenu.Item', {shortcut: sc})); + $sc.appendTo(self.$el.find('.oe_systray_shortcut_menu')); + }, + remove: function (menu_id) { + var $shortcut = this.$el.find('.oe_systray_shortcut_menu li a[data-id=' + menu_id + ']'); + var shortcut_id = $shortcut.data('shortcut-id'); + $shortcut.remove(); + this.model.call('unlink', [shortcut_id]); + }, + click: function ($link) { + var self = this, + action_id = $link.data('id'); + new DataModel('ir.ui.menu').query(['action']).filter([['id', '=', action_id]]).context(null).all().then(function (menu) { + var action_str = menu[0].action; + var action_str_parts = action_str.split(','); + action_id = parseInt(action_str_parts[1]); + self.trigger('click', action_id); + }); + }, + has: function (menu_id) { + return !!this.$el.find('a[data-id=' + menu_id + ']').length; + } + }); + + + SystrayMenu.Items.push(ShortcutMenu); + + + WebClient.include({ + current_action_updated: function (action) { + if (this.menu.systray_menu) { + this.shortcut_menu = _.find(this.menu.systray_menu.widgets, function (item) { + return item instanceof ShortcutMenu; + }); + } + else { + this.shortcut_menu = _.find(this.systray_menu.widgets, function (item) { + return item instanceof ShortcutMenu; + }); + } + }, + show_application: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + if (self.menu.systray_menu) { + self.shortcut_menu = _.find(self.menu.systray_menu.widgets, function (item) { + return item instanceof ShortcutMenu; + }); + } + else { + self.shortcut_menu = _.find(self.systray_menu.widgets, function (item) { + return item instanceof ShortcutMenu; + }); + } + self.shortcut_menu.on('click', self, function (action_id) { + self.do_action(action_id, { + clear_breadcrumbs: true, + replace_breadcrumb: true + }); + }); + }); + } + }); + + + ViewManager.include({ + switch_mode: function (view_type, no_store) { + var self = this; + return this._super.apply(this, arguments).done(function () { + self.shortcut_check(self.views[view_type]); + }); + }, + shortcut_check: function (view) { + var self = this; + + // Child view managers + if (!this.action_manager) { + return; + } + + // display shortcuts if on the first view for the action + var $shortcut_toggle = this.action_manager.main_control_panel.$el.find('.oe_shortcut_toggle'); + if (!this.action.name || !(view.view_type === this.view_stack[0].view_type && + view.view_id === this.view_stack[0].view_id) + ) { + $shortcut_toggle.addClass('hidden'); + return; + } + $shortcut_toggle.removeClass('hidden'); + + // Anonymous users don't have user_menu + // Check whether it's the 'main' action_manager + var shortcuts_menu = this.action_manager.webclient && this.action_manager.webclient.shortcut_menu; + if (shortcuts_menu) { + $shortcut_toggle.toggleClass('oe_shortcut_remove', shortcuts_menu.has(self.session.active_id)); + $shortcut_toggle.unbind("click").click(function () { + var menu_id = session.active_id; + // In the case we come from a parent menu, no action is linked to the menu + // We must take the first child menu + if (self.action_manager.webclient.menu_data) { + for (var i = 0; i < self.action_manager.webclient.menu_data.children.length; i++) { + if (self.action_manager.webclient.menu_data.children[i].id === session.active_id) { + menu_temp = self.action_manager.webclient.menu_data.children[i].children[0]; + menu_id = menu_temp.id; + if (menu_temp.children[0]){ + menu_id = menu_temp.children[0].id + } + break; + } + } + } + if ($shortcut_toggle.hasClass("oe_shortcut_remove")) { + shortcuts_menu.trigger('remove', menu_id); + } + else { + shortcuts_menu.trigger('add', { + 'user_id': session.uid, + 'menu_id': menu_id, + 'name': session.name + }); + } + $shortcut_toggle.toggleClass("oe_shortcut_remove"); + }); + } + } + }); + + + ActionManager.include({ + do_action: function () { + this.main_control_panel.$el.find('.oe_shortcut_toggle').addClass('hidden'); + return this._super.apply(this, arguments); + } + }); + + return ShortcutMenu; +}); diff --git a/web_shortcut/static/src/xml/web_shortcut.xml b/web_shortcut/static/src/xml/web_shortcut.xml new file mode 100644 index 00000000..1b601239 --- /dev/null +++ b/web_shortcut/static/src/xml/web_shortcut.xml @@ -0,0 +1,25 @@ + + + + + + + +
  • + + + +
  • + + + + + + + +
    diff --git a/web_shortcut/templates/assets.xml b/web_shortcut/templates/assets.xml new file mode 100644 index 00000000..4937593e --- /dev/null +++ b/web_shortcut/templates/assets.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/web_shortcut/tests/__init__.py b/web_shortcut/tests/__init__.py new file mode 100644 index 00000000..cdafbd7b --- /dev/null +++ b/web_shortcut/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017-today Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_web_shortcut diff --git a/web_shortcut/tests/test_web_shortcut.py b/web_shortcut/tests/test_web_shortcut.py new file mode 100644 index 00000000..feb3fea0 --- /dev/null +++ b/web_shortcut/tests/test_web_shortcut.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Copyright 2017-today Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestWebShortcut(TransactionCase): + def setUp(self, *args, **kwargs): + super(TestWebShortcut, self).setUp(*args, **kwargs) + self.shortcut_obj = self.env['web.shortcut'] + self.menu_obj = self.env['ir.ui.menu'] + + self.menu = self.env.ref('base.menu_ir_property') + self.user = self.env.ref('base.user_root') + + self.shortcut_obj.search([('user_id', '=', self.user.id)]).unlink() + + def test_web_shortcut(self): + res = self.shortcut_obj.get_user_shortcuts() + self.assertEqual(len(res), 0) + self.shortcut_obj.create({ + 'name': 'Test', + 'menu_id': self.menu.id, + 'user_id': self.env.user.id + }) + res = self.shortcut_obj.get_user_shortcuts() + self.assertEqual(len(res), 1) + self.menu.unlink() + res = self.shortcut_obj.get_user_shortcuts() + self.assertEqual(len(res), 0) diff --git a/web_shortcuts/README.rst b/web_shortcuts/README.rst deleted file mode 100644 index e3e36f90..00000000 --- a/web_shortcuts/README.rst +++ /dev/null @@ -1,7 +0,0 @@ -Enable shortcuts feature in the web client. -=========================================== - -Add a Shortcut icon in the systray in order to access the user's shortcuts -(if any). - -Add a Shortcut icon besides the views title in order to add/remove a shortcut. \ No newline at end of file diff --git a/web_shortcuts/__init__.py b/web_shortcuts/__init__.py deleted file mode 100644 index 0c453b00..00000000 --- a/web_shortcuts/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2010 OpenERP s.a. (). -# -# 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 model diff --git a/web_shortcuts/__manifest__.py b/web_shortcuts/__manifest__.py deleted file mode 100644 index e9c28d98..00000000 --- a/web_shortcuts/__manifest__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2010-2011 OpenERP s.a. (). -# -# 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 . -# -############################################################################## -{ - 'name': 'Web Shortcuts', - 'version': '8.0.1.0.0', - 'category': 'Tools', - 'author': "OpenERP SA,Odoo Community Association (OCA)", - 'website': 'http://openerp.com', - 'depends': ['base'], - 'data': [ - 'security/ir.model.access.csv', - 'view/web_shortcuts.xml', - ], - 'qweb': ['static/src/xml/web_shortcuts.xml'], - 'installable': False, - 'auto_install': False, -} - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/web_shortcuts/model/__init__.py b/web_shortcuts/model/__init__.py deleted file mode 100644 index 0ff5f169..00000000 --- a/web_shortcuts/model/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# -# -# Authors: Adrien Peiffer -# 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 . import web_shortcut diff --git a/web_shortcuts/model/web_shortcut.py b/web_shortcuts/model/web_shortcut.py deleted file mode 100644 index 9065e2de..00000000 --- a/web_shortcuts/model/web_shortcut.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-today OpenERP SA () -# -# 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 - - -class WebShortcut(models.Model): - _name = 'web.shortcut' - - name = fields.Char('Shortcut Name', size=64) - menu_id = fields.Many2one('ir.ui.menu', ondelete='cascade') - user_id = fields.Many2one('res.users', 'User Ref.', required=True, - ondelete='cascade', select=True, - default=lambda obj, cr, uid, context: uid) - - _sql_constraints = [ - ('shortcut_unique', 'unique(menu_id,user_id)', - 'Shortcut for this menu already exists!'), - ] - - @api.model - def get_user_shortcuts(self, user_id): - shortcuts = self.search([('user_id', '=', user_id)]) - res = [] - for shortcut in shortcuts.filtered('menu_id'): - _name = shortcut.menu_id.name_get() - _name = _name[0][1] if len(_name) else '' - _id = shortcut.menu_id.id - res.append( - { - 'id': shortcut.id, - 'name': _name, - 'menu_id': (_id, _name) - } - ) - return res - - -class IrUiView(models.Model): - _inherit = 'ir.ui.menu' - - @api.multi - def unlink(self): - res = super(IrUiView, self).unlink() - shortcuts = self.env['web.shortcut'].search([('menu_id', '=', False)]) - for shortcut in shortcuts: - shortcut.unlink() - return res diff --git a/web_shortcuts/static/src/css/web_shortcuts.css b/web_shortcuts/static/src/css/web_shortcuts.css deleted file mode 100644 index ae5a3cef..00000000 --- a/web_shortcuts/static/src/css/web_shortcuts.css +++ /dev/null @@ -1,82 +0,0 @@ -/* Shortcuts*/ -.oe_systray_shortcuts .oe_star_off { - color: #eee; -} -.oe_shortcuts_toggle { - height: 20px; - margin-top: 3px; - padding: 0; - width: 24px; - cursor: pointer; - display: block; - background: url(/web/static/src/img/add-shortcut.png) no-repeat center center; - float: left; -} -.oe_shortcuts_remove{ - background: url(/web/static/src/img/remove-shortcut.png) no-repeat center center; -} -.oe_shortcuts { - position: absolute; - margin: 0; - padding: 6px 15px; - top: 37px; - left: 197px; - right: 0; - height: 17px; - line-height: 1.2; -} -.oe_shortcuts ul { - display: block; - overflow: hidden; - list-style: none; - white-space: nowrap; - padding: 0; - margin: 0; -} -.oe_shortcuts li { - cursor: pointer; - display: -moz-inline-stack; - display: inline-block; - display: inline; /*IE7 */ - color: #fff; - text-align: center; - border-left: 1px solid #909090; - padding: 0 4px; - font-size: 80%; - font-weight: normal; - vertical-align: top; -} - -.oe_shortcuts li:hover { - background-color: #666; -} -.oe_shortcuts li:first-child { - border-left: none; - padding-left: 0; -} - - -.openerp .oe_topbar .oe_topbar_item { - display: block; - padding: 5px 10px 7px; - line-height: 20px; - height: 20px; - text-decoration: none; - color: #eeeeee; - vertical-align: top; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -ms-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; -} -.openerp .oe_topbar .oe_topbar_item:hover { - background: rgba(0, 0, 0, 0.2); - text-shadow: black 0px 0px 3px; - color: white; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; -} - diff --git a/web_shortcuts/static/src/img/add-shortcut.png b/web_shortcuts/static/src/img/add-shortcut.png deleted file mode 100644 index 07b8ed40..00000000 Binary files a/web_shortcuts/static/src/img/add-shortcut.png and /dev/null differ diff --git a/web_shortcuts/static/src/js/web_shortcuts.js b/web_shortcuts/static/src/js/web_shortcuts.js deleted file mode 100644 index 943def16..00000000 --- a/web_shortcuts/static/src/js/web_shortcuts.js +++ /dev/null @@ -1,150 +0,0 @@ -/*############################################################################ -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011-2012 OpenERP SA (). -# -# 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 . -# -############################################################################*/ - -openerp.web_shortcuts = function (instance) { - -var QWeb = instance.web.qweb, - _t = instance.web._t; - -instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({ - template: 'Systray.Shortcuts', - - init: function() { - this._super(); - this.on('load', this, this.load); - this.on('add', this, this.add); - this.on('display', this, this.display); - this.on('remove', this, this.remove); - this.on('click', this, this.click); - this.model = new instance.web.Model('web.shortcut'); - }, - start: function() { - var self = this; - this._super(); - this.trigger('load'); - this.$el.on('click', '.oe_systray_shortcuts_items a', function() { - self.trigger('click', $(this)); - }); - }, - load: function() { - var self = this; - this.$el.find('.oe_systray_shortcuts_items').empty(); - return this.model.call('get_user_shortcuts', [ - instance.session.uid, - instance.web.pyeval.eval('context', {}) - ]).done(function(shortcuts) { - _.each(shortcuts, function(sc) { - self.trigger('display', sc); - }); - }); - }, - add: function (sc) { - var self = this; - this.model.call('create', [sc]).then(function(out){ - self.trigger('load'); - }); - }, - display: function(sc) { - var self = this; - this.$el.find('.oe_systray_shortcuts_items').append(); - var $sc = $(QWeb.render('Systray.Shortcuts.Item', {'shortcut': sc})); - $sc.appendTo(self.$el.find('.oe_systray_shortcuts_items')); - }, - remove: function (menu_id) { - var menu_id = this.session.active_id; - var $shortcut = this.$el.find('.oe_systray_shortcuts_items li a[data-id=' + menu_id + ']'); - var shortcut_id = $shortcut.data('shortcut-id'); - $shortcut.remove(); - this.model.call('unlink', [shortcut_id]); - }, - click: function($link) { - var self = this, - id = $link.data('id'); - self.session.active_id = id; - // TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'}) - new instance.web.Model('ir.ui.menu').query(['action']).filter([['id', '=', id]]).context(null).all().then(function(menu) { - var action_str = menu[0].action; - var action_str_parts = action_str.split(','); - var action_id = parseInt(action_str_parts[1]) - self.rpc('/web/action/load', {'action_id': action_id}).done(function(action) { - instance.webclient.on_menu_action({action_id: action.id}); - }); - }); - this.$el.find('.oe_systray_shortcuts').trigger('mouseout'); - }, - has: function(menu_id) { - return !!this.$el.find('a[data-id=' + menu_id + ']').length; - } -}); - -instance.web.UserMenu.include({ - do_update: function() { - var self = this; - this._super.apply(this, arguments); - this.update_promise.done(function() { - if (self.shortcuts) { - self.shortcuts.trigger('load'); - } else { - self.shortcuts = new instance.web_shortcuts.Shortcuts(self); - self.shortcuts.appendTo(instance.webclient.$el.find('.oe_systray')); - } - }); - }, -}); - -instance.web.ViewManagerAction.include({ - switch_mode: function (view_type, no_store) { - var self = this; - this._super.apply(this, arguments).done(function() { - self.shortcut_check(self.views[view_type]); - }); - }, - shortcut_check : function(view) { - var self = this; - var shortcuts_menu = instance.webclient.user_menu.shortcuts; - var grandparent = this.getParent() && this.getParent().getParent(); - // display shortcuts if on the first view for the action - var $shortcut_toggle = this.$el.find('.oe_shortcuts_toggle'); - if (!this.action.name || - !(view.view_type === this.views_src[0].view_type - && view.view_id === this.views_src[0].view_id)) { - $shortcut_toggle.hide(); - return; - } - // Anonymous users don't have user_menu - if (shortcuts_menu) { - $shortcut_toggle.toggleClass('oe_shortcuts_remove', shortcuts_menu.has(self.session.active_id)); - $shortcut_toggle.unbind("click").click(function() { - if ($shortcut_toggle.hasClass("oe_shortcuts_remove")) { - shortcuts_menu.trigger('remove', self.session.active_id); - } else { - shortcuts_menu.trigger('add', { - 'user_id': self.session.uid, - 'menu_id': self.session.active_id, - 'name': self.action.name - }); - } - $shortcut_toggle.toggleClass("oe_shortcuts_remove"); - }); - } - } -}); - -}; diff --git a/web_shortcuts/static/src/xml/web_shortcuts.xml b/web_shortcuts/static/src/xml/web_shortcuts.xml deleted file mode 100644 index 1aa7a8cd..00000000 --- a/web_shortcuts/static/src/xml/web_shortcuts.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - -
  • - - - -
  • -
    - - - - - -
    diff --git a/web_shortcuts/view/web_shortcuts.xml b/web_shortcuts/view/web_shortcuts.xml deleted file mode 100644 index bd27657c..00000000 --- a/web_shortcuts/view/web_shortcuts.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -