Browse Source

🤝 Merge branch '11.0' of github.com:OCA/web into 11-mig-web_widget_x2many_2d_matrix

pull/1298/head
Vincent Hatakeyama 5 years ago
parent
commit
0c4d05497a
  1. 2
      setup/_metapackage/VERSION.txt
  2. 7
      setup/_metapackage/setup.py
  3. 1
      setup/web_access_rule_buttons/odoo/addons/web_access_rule_buttons
  4. 0
      setup/web_access_rule_buttons/setup.cfg
  5. 0
      setup/web_access_rule_buttons/setup.py
  6. 1
      setup/web_drop_target/odoo/addons/web_drop_target
  7. 2
      setup/web_drop_target/setup.cfg
  8. 6
      setup/web_drop_target/setup.py
  9. 1
      setup/web_listview_invert_selection/odoo/addons/web_listview_invert_selection
  10. 2
      setup/web_listview_invert_selection/setup.cfg
  11. 6
      setup/web_listview_invert_selection/setup.py
  12. 1
      setup/web_view_transition/odoo/addons/web_view_transition
  13. 2
      setup/web_view_transition/setup.cfg
  14. 6
      setup/web_view_transition/setup.py
  15. 1
      setup/web_widget_datepicker_options/odoo/addons/web_widget_datepicker_options
  16. 1
      setup/web_widget_digitized_signature/odoo/addons/web_widget_digitized_signature
  17. 2
      setup/web_widget_digitized_signature/setup.cfg
  18. 6
      setup/web_widget_digitized_signature/setup.py
  19. 1
      setup/web_widget_timepicker/odoo/addons/web_widget_timepicker
  20. 2
      setup/web_widget_timepicker/setup.cfg
  21. 6
      setup/web_widget_timepicker/setup.py
  22. 83
      web_access_rule_buttons/README.rst
  23. 3
      web_access_rule_buttons/__init__.py
  24. 19
      web_access_rule_buttons/__manifest__.py
  25. 35
      web_access_rule_buttons/i18n/web_access_rule_buttons.pot
  26. 3
      web_access_rule_buttons/models/__init__.py
  27. 37
      web_access_rule_buttons/models/models.py
  28. 2
      web_access_rule_buttons/readme/CONTRIBUTORS.rst
  29. 2
      web_access_rule_buttons/readme/DESCRIPTION.rst
  30. 3
      web_access_rule_buttons/readme/USAGE.rst
  31. 0
      web_access_rule_buttons/static/description/icon.png
  32. 429
      web_access_rule_buttons/static/description/index.html
  33. 32
      web_access_rule_buttons/static/src/js/form_controller.js
  34. 3
      web_access_rule_buttons/tests/__init__.py
  35. 19
      web_access_rule_buttons/tests/test_access_rule_buttons.py
  36. 8
      web_access_rule_buttons/views/web_access_rule_buttons.xml
  37. BIN
      web_disable_export_group/static/description/icon.png
  38. 102
      web_drop_target/README.rst
  39. 2
      web_drop_target/__init__.py
  40. 17
      web_drop_target/__manifest__.py
  41. 0
      web_drop_target/i18n/web_drop_target.pot
  42. 2
      web_drop_target/readme/CONTRIBUTORS.rst
  43. 5
      web_drop_target/readme/DESCRIPTION.rst
  44. 3
      web_drop_target/readme/DEVELOP.rst
  45. 5
      web_drop_target/readme/ROADMAP.rst
  46. 4
      web_drop_target/readme/USAGE.rst
  47. BIN
      web_drop_target/static/description/icon.png
  48. 450
      web_drop_target/static/description/index.html
  49. 1
      web_drop_target/static/lib/base64js.min.js
  50. 0
      web_drop_target/static/src/css/web_drop_target.css
  51. 129
      web_drop_target/static/src/js/web_drop_target.js
  52. 10
      web_drop_target/views/templates.xml
  53. 99
      web_export_view/README.rst
  54. 4
      web_export_view/i18n/da.po
  55. 4
      web_export_view/i18n/de.po
  56. 4
      web_export_view/i18n/es.po
  57. 4
      web_export_view/i18n/hr.po
  58. 4
      web_export_view/i18n/nl_NL.po
  59. 4
      web_export_view/i18n/pt_BR.po
  60. 4
      web_export_view/i18n/web_export_view.pot
  61. 4
      web_export_view/i18n/zh_CN.po
  62. 2
      web_export_view/readme/CONFIGURATION.rst
  63. 9
      web_export_view/readme/CONTRIBUTORS.rst
  64. 11
      web_export_view/readme/DESCRIPTION.rst
  65. 9
      web_export_view/readme/ROADMAP.rst
  66. 3
      web_export_view/readme/USAGE.rst
  67. 456
      web_export_view/static/description/index.html
  68. 141
      web_export_view/static/src/js/web_export_view.js
  69. 64
      web_listview_invert_selection/README.rst
  70. 3
      web_listview_invert_selection/__init__.py
  71. 20
      web_listview_invert_selection/__manifest__.py
  72. 26
      web_listview_invert_selection/i18n/fr.po
  73. 22
      web_listview_invert_selection/i18n/web_listview_invert_selection.pot
  74. BIN
      web_listview_invert_selection/static/description/after.png
  75. BIN
      web_listview_invert_selection/static/description/before.png
  76. BIN
      web_listview_invert_selection/static/description/icon.png
  77. 42
      web_listview_invert_selection/static/src/js/web_listview_invert_selection.js
  78. 5
      web_listview_invert_selection/static/src/less/web_listview_invert_selection.less
  79. 12
      web_listview_invert_selection/templates/assets.xml
  80. BIN
      web_listview_range_select/static/description/icon.png
  81. 2
      web_responsive/__manifest__.py
  82. 6
      web_responsive/static/src/less/main.less
  83. BIN
      web_send_message_popup/static/description/icon.png
  84. BIN
      web_tree_resize_column/static/description/icon.png
  85. 78
      web_view_transition/README.rst
  86. 1
      web_view_transition/__init__.py
  87. 21
      web_view_transition/__manifest__.py
  88. 90
      web_view_transition/i18n/web_view_transition.pot
  89. BIN
      web_view_transition/images/config.gif
  90. 5
      web_view_transition/models/__init__.py
  91. 16
      web_view_transition/models/inherited_ir_http.py
  92. 36
      web_view_transition/models/inherited_res_users.py
  93. 1
      web_view_transition/readme/DESCRIPTION.rst
  94. 6
      web_view_transition/readme/USAGE.rst
  95. BIN
      web_view_transition/static/description/icon.png
  96. 419
      web_view_transition/static/description/index.html
  97. 142
      web_view_transition/static/src/css/transitions.less
  98. 20
      web_view_transition/static/src/js/view_manager.js
  99. 21
      web_view_transition/view/inherited_view_users_form_simple_modif.xml
  100. 9
      web_view_transition/view/web_view_transition.xml

2
setup/_metapackage/VERSION.txt

@ -1 +1 @@
11.0.20190227.0
11.0.20190515.0

7
setup/_metapackage/setup.py

@ -8,11 +8,13 @@ setuptools.setup(
description="Meta package for oca-web Odoo addons",
version=version,
install_requires=[
'odoo11-addon-web_access_rule_buttons',
'odoo11-addon-web_action_conditionable',
'odoo11-addon-web_advanced_search',
'odoo11-addon-web_decimal_numpad_dot',
'odoo11-addon-web_dialog_size',
'odoo11-addon-web_disable_export_group',
'odoo11-addon-web_drop_target',
'odoo11-addon-web_editor_background_color',
'odoo11-addon-web_environment_ribbon',
'odoo11-addon-web_export_view',
@ -20,6 +22,7 @@ setuptools.setup(
'odoo11-addon-web_group_expand',
'odoo11-addon-web_ir_actions_act_multi',
'odoo11-addon-web_ir_actions_act_view_reload',
'odoo11-addon-web_listview_invert_selection',
'odoo11-addon-web_listview_range_select',
'odoo11-addon-web_m2x_options',
'odoo11-addon-web_no_bubble',
@ -34,13 +37,15 @@ setuptools.setup(
'odoo11-addon-web_tree_image',
'odoo11-addon-web_tree_many2one_clickable',
'odoo11-addon-web_tree_resize_column',
'odoo11-addon-web_view_transition',
'odoo11-addon-web_widget_bokeh_chart',
'odoo11-addon-web_widget_color',
'odoo11-addon-web_widget_datepicker_options',
'odoo11-addon-web_widget_digitized_signature',
'odoo11-addon-web_widget_domain_editor_dialog',
'odoo11-addon-web_widget_image_download',
'odoo11-addon-web_widget_image_url',
'odoo11-addon-web_widget_many2many_tags_multi_selection',
'odoo11-addon-web_widget_timepicker',
'odoo11-addon-web_widget_url_advanced',
'odoo11-addon-web_widget_x2many_2d_matrix',
'odoo11-addon-web_widget_x2many_2d_matrix_example',

1
setup/web_access_rule_buttons/odoo/addons/web_access_rule_buttons

@ -0,0 +1 @@
../../../../web_access_rule_buttons

0
setup/web_widget_datepicker_options/setup.cfg → setup/web_access_rule_buttons/setup.cfg

0
setup/web_widget_datepicker_options/setup.py → setup/web_access_rule_buttons/setup.py

1
setup/web_drop_target/odoo/addons/web_drop_target

@ -0,0 +1 @@
../../../../web_drop_target

2
setup/web_drop_target/setup.cfg

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

6
setup/web_drop_target/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

1
setup/web_listview_invert_selection/odoo/addons/web_listview_invert_selection

@ -0,0 +1 @@
../../../../web_listview_invert_selection

2
setup/web_listview_invert_selection/setup.cfg

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

6
setup/web_listview_invert_selection/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

1
setup/web_view_transition/odoo/addons/web_view_transition

@ -0,0 +1 @@
../../../../web_view_transition

2
setup/web_view_transition/setup.cfg

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

6
setup/web_view_transition/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

1
setup/web_widget_datepicker_options/odoo/addons/web_widget_datepicker_options

@ -1 +0,0 @@
../../../../web_widget_datepicker_options

1
setup/web_widget_digitized_signature/odoo/addons/web_widget_digitized_signature

@ -0,0 +1 @@
../../../../web_widget_digitized_signature

2
setup/web_widget_digitized_signature/setup.cfg

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

6
setup/web_widget_digitized_signature/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

1
setup/web_widget_timepicker/odoo/addons/web_widget_timepicker

@ -0,0 +1 @@
../../../../web_widget_timepicker

2
setup/web_widget_timepicker/setup.cfg

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

6
setup/web_widget_timepicker/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

83
web_access_rule_buttons/README.rst

@ -0,0 +1,83 @@
========================
Web Access Rules Buttons
========================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/11.0/web_access_rule_buttons
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_access_rule_buttons
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/11.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This addon disables the Edit button on the form views if the user
cannot edit the current record according to the record access rules.
**Table of contents**
.. contents::
:local:
Usage
=====
When using Odoo, even if a user has no rights to edit a record, the Edit button
is shown. The user can edit the record but won't be able to save his changes.
Now, the user won't be able to click on the Edit button.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_access_rule_buttons%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Camptocamp
* Onestein
Contributors
~~~~~~~~~~~~
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Antonio Esposito <a.esposito@onestein.nl>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/11.0/web_access_rule_buttons>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

3
web_access_rule_buttons/__init__.py

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models

19
web_access_rule_buttons/__manifest__.py

@ -0,0 +1,19 @@
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Web Access Rules Buttons",
"summary": "Disable Edit button if access rules prevent this action",
"version": "11.0.1.0.0",
"author": "Camptocamp, Onestein, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Web",
"depends": [
"web",
],
"website": "https://github.com/OCA/web/tree/11.0/web_access_rule_buttons",
"data": [
"views/web_access_rule_buttons.xml",
],
"installable": True,
}

35
web_access_rule_buttons/i18n/web_access_rule_buttons.pot

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_access_rule_buttons
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: web_access_rule_buttons
#: model:ir.model.fields,field_description:web_access_rule_buttons.field_ir_cron_channel_ids
msgid "Add Channels"
msgstr ""
#. module: web_access_rule_buttons
#: model:ir.model.fields,field_description:web_access_rule_buttons.field_ir_cron_partner_ids
msgid "Add Followers"
msgstr ""
#. module: web_access_rule_buttons
#: model:ir.model.fields,field_description:web_access_rule_buttons.field_ir_cron_template_id
msgid "Email Template"
msgstr ""
#. module: web_access_rule_buttons
#: model:ir.model,name:web_access_rule_buttons.model_base
msgid "base"
msgstr ""

3
web_access_rule_buttons/models/__init__.py

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models

37
web_access_rule_buttons/models/models.py

@ -0,0 +1,37 @@
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models, api, exceptions
class Base(models.AbstractModel):
""" The base model, which is implicitly inherited by all models. """
_inherit = 'base'
@api.multi
def check_access_rule_all(self, operations=None):
"""Verifies that the operation given by ``operations`` is allowed for
the user according to ir.rules.
If ``operations`` is empty, it returns the result for all actions.
:param operation: a list of ``read``, ``create``, ``write``, ``unlink``
:return: {operation: access} (access is a boolean)
"""
if not operations or not any(operations):
operations = ['read', 'create', 'write', 'unlink']
result = {}
for operation in operations:
if self.is_transient() or not self.ids:
# If we call check_access_rule() without id, it will try to
# run a SELECT without ID which will crash, so we just blindly
# allow the operations
result[operation] = True
continue
try:
self.check_access_rule(operation)
except exceptions.AccessError:
result[operation] = False
else:
result[operation] = True
return result

2
web_access_rule_buttons/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Antonio Esposito <a.esposito@onestein.nl>

2
web_access_rule_buttons/readme/DESCRIPTION.rst

@ -0,0 +1,2 @@
This addon disables the Edit button on the form views if the user
cannot edit the current record according to the record access rules.

3
web_access_rule_buttons/readme/USAGE.rst

@ -0,0 +1,3 @@
When using Odoo, even if a user has no rights to edit a record, the Edit button
is shown. The user can edit the record but won't be able to save his changes.
Now, the user won't be able to click on the Edit button.

0
web_widget_datepicker_options/static/description/icon.png → web_access_rule_buttons/static/description/icon.png

Before

Width: 128  |  Height: 128  |  Size: 9.2 KiB

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

429
web_access_rule_buttons/static/description/index.html

@ -0,0 +1,429 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Web Access Rules Buttons</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="web-access-rules-buttons">
<h1 class="title">Web Access Rules Buttons</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_access_rule_buttons"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_access_rule_buttons"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This addon disables the Edit button on the form views if the user
cannot edit the current record according to the record access rules.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>When using Odoo, even if a user has no rights to edit a record, the Edit button
is shown. The user can edit the record but won’t be able to save his changes.
Now, the user won’t be able to click on the Edit button.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_access_rule_buttons%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Camptocamp</li>
<li>Onestein</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<li>Antonio Esposito &lt;<a class="reference external" href="mailto:a.esposito&#64;onestein.nl">a.esposito&#64;onestein.nl</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_access_rule_buttons">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

32
web_access_rule_buttons/static/src/js/form_controller.js

@ -0,0 +1,32 @@
/* Copyright 2016 Camptocamp SA
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */
odoo.define("web_access_rule_buttons.main", function (require) {
"use strict";
var FormController = require("web.FormController");
FormController.include({
_update: function (state) {
return this._super(state).then(this.show_hide_buttons(state));
},
show_hide_buttons : function (state) {
var self = this;
return self._rpc({
model: this.modelName,
method: 'check_access_rule_all',
args: [[state.data.id], ["write"]],
}).then(function (accesses) {
self.show_hide_edit_button(accesses.write);
});
},
show_hide_edit_button : function (access) {
if (this.$buttons) {
var button = this.$buttons.find(".o_form_button_edit");
if (button) {
button.prop("disabled", !access);
}
}
},
});
});

3
web_access_rule_buttons/tests/__init__.py

@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import test_access_rule_buttons

19
web_access_rule_buttons/tests/test_access_rule_buttons.py

@ -0,0 +1,19 @@
# Copyright 2019 Onestein BV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestAccessRuleButtons(TransactionCase):
def setUp(self):
super(TestAccessRuleButtons, self).setUp()
self.curr_obj = self.env['res.currency']
self.curr_record = self.env.ref('base.USD')
def test_check_access_rule_1(self):
res = self.curr_obj.check_access_rule_all(['write'])
self.assertTrue(res['write'])
def test_check_access_rule_2(self):
res = self.curr_record.check_access_rule_all(['write'])
self.assertTrue(res['write'])

8
web_access_rule_buttons/views/web_access_rule_buttons.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="assets_backend" name="web_access_rule_buttons assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_access_rule_buttons/static/src/js/form_controller.js"></script>
</xpath>
</template>
</odoo>

BIN
web_disable_export_group/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

102
web_drop_target/README.rst

@ -0,0 +1,102 @@
===================
Drop target support
===================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/11.0/web_drop_target
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_drop_target
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/11.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module extends the functionality of the web client to support dropping local files into the web client.
By default, an attachment will be created when dropping a file on a form.
Further, this module is meant as a base drag&drop module supporting other actions after some file is dropped so that other modules can add more features.
**Table of contents**
.. contents::
:local:
Usage
=====
To use this module, you need to:
#. drag a file from your local computer onto an Odoo form view
#. it should become an attachment of the currently opened record
Development
===========
**Libraries**
* `base64js <https://raw.githubusercontent.com/beatgammit/base64-js>`_.
Known issues / Roadmap
======================
* dropping on list or kanban views would be nice too
* handle multiple files
* add an upload progress meter for huge files
* trigger custom events about different stages of the drop operation for other addons to hook in
* Install document module to display attachments in the sidebar
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_drop_target%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Therp BV
Contributors
~~~~~~~~~~~~
* Holger Brunn <hbrunn@therp.nl>
* Akim Juillerat <akim.juillerat@camptocamp.com>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/11.0/web_drop_target>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

2
web_drop_target/__init__.py

@ -0,0 +1,2 @@
# Copyright 2018 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

17
web_drop_target/__manifest__.py

@ -0,0 +1,17 @@
# Copyright 2018 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Drop target support",
"version": "11.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"license": "AGPL-3",
"category": "Usability",
"summary": "Allows to drag files into Odoo",
"depends": [
'web',
],
"data": [
'views/templates.xml',
],
}

0
web_widget_datepicker_options/i18n/web_widget_datepicker_options.pot → web_drop_target/i18n/web_drop_target.pot

2
web_drop_target/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* Holger Brunn <hbrunn@therp.nl>
* Akim Juillerat <akim.juillerat@camptocamp.com>

5
web_drop_target/readme/DESCRIPTION.rst

@ -0,0 +1,5 @@
This module extends the functionality of the web client to support dropping local files into the web client.
By default, an attachment will be created when dropping a file on a form.
Further, this module is meant as a base drag&drop module supporting other actions after some file is dropped so that other modules can add more features.

3
web_drop_target/readme/DEVELOP.rst

@ -0,0 +1,3 @@
**Libraries**
* `base64js <https://raw.githubusercontent.com/beatgammit/base64-js>`_.

5
web_drop_target/readme/ROADMAP.rst

@ -0,0 +1,5 @@
* dropping on list or kanban views would be nice too
* handle multiple files
* add an upload progress meter for huge files
* trigger custom events about different stages of the drop operation for other addons to hook in
* Install document module to display attachments in the sidebar

4
web_drop_target/readme/USAGE.rst

@ -0,0 +1,4 @@
To use this module, you need to:
#. drag a file from your local computer onto an Odoo form view
#. it should become an attachment of the currently opened record

BIN
web_drop_target/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

450
web_drop_target/static/description/index.html

@ -0,0 +1,450 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Drop target support</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="drop-target-support">
<h1 class="title">Drop target support</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_drop_target"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_drop_target"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of the web client to support dropping local files into the web client.</p>
<p>By default, an attachment will be created when dropping a file on a form.</p>
<p>Further, this module is meant as a base drag&amp;drop module supporting other actions after some file is dropped so that other modules can add more features.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#development" id="id2">Development</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>drag a file from your local computer onto an Odoo form view</li>
<li>it should become an attachment of the currently opened record</li>
</ol>
</div>
<div class="section" id="development">
<h1><a class="toc-backref" href="#id2">Development</a></h1>
<p><strong>Libraries</strong></p>
<ul class="simple">
<li><a class="reference external" href="https://raw.githubusercontent.com/beatgammit/base64-js">base64js</a>.</li>
</ul>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>dropping on list or kanban views would be nice too</li>
<li>handle multiple files</li>
<li>add an upload progress meter for huge files</li>
<li>trigger custom events about different stages of the drop operation for other addons to hook in</li>
<li>Install document module to display attachments in the sidebar</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_drop_target%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id5">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id6">Authors</a></h2>
<ul class="simple">
<li>Therp BV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
<ul class="simple">
<li>Holger Brunn &lt;<a class="reference external" href="mailto:hbrunn&#64;therp.nl">hbrunn&#64;therp.nl</a>&gt;</li>
<li>Akim Juillerat &lt;<a class="reference external" href="mailto:akim.juillerat&#64;camptocamp.com">akim.juillerat&#64;camptocamp.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_drop_target">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

1
web_drop_target/static/lib/base64js.min.js

@ -0,0 +1 @@
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function r(e,n,t){function o(i,a){if(!n[i]){if(!e[i]){var u=typeof require=="function"&&require;if(!a&&u)return u(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[i]={exports:{}};e[i][0].call(c.exports,function(r){var n=e[i][1][r];return o(n?n:r)},c,c.exports,r,e,n,t)}return n[i].exports}var f=typeof require=="function"&&require;for(var i=0;i<t.length;i++)o(t[i]);return o}return r}()({"/":[function(r,e,n){"use strict";n.byteLength=c;n.toByteArray=v;n.fromByteArray=s;var t=[];var o=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var a=0,u=i.length;a<u;++a){t[a]=i[a];o[i.charCodeAt(a)]=a}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function d(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return r[e-2]==="="?2:r[e-1]==="="?1:0}function c(r){return r.length*3/4-d(r)}function v(r){var e,n,t,i,a;var u=r.length;i=d(r);a=new f(u*3/4-i);n=i>0?u-4:u;var c=0;for(e=0;e<n;e+=4){t=o[r.charCodeAt(e)]<<18|o[r.charCodeAt(e+1)]<<12|o[r.charCodeAt(e+2)]<<6|o[r.charCodeAt(e+3)];a[c++]=t>>16&255;a[c++]=t>>8&255;a[c++]=t&255}if(i===2){t=o[r.charCodeAt(e)]<<2|o[r.charCodeAt(e+1)]>>4;a[c++]=t&255}else if(i===1){t=o[r.charCodeAt(e)]<<10|o[r.charCodeAt(e+1)]<<4|o[r.charCodeAt(e+2)]>>2;a[c++]=t>>8&255;a[c++]=t&255}return a}function l(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[r&63]}function h(r,e,n){var t;var o=[];for(var f=e;f<n;f+=3){t=(r[f]<<16&16711680)+(r[f+1]<<8&65280)+(r[f+2]&255);o.push(l(t))}return o.join("")}function s(r){var e;var n=r.length;var o=n%3;var f="";var i=[];var a=16383;for(var u=0,d=n-o;u<d;u+=a){i.push(h(r,u,u+a>d?d:u+a))}if(o===1){e=r[n-1];f+=t[e>>2];f+=t[e<<4&63];f+="=="}else if(o===2){e=(r[n-2]<<8)+r[n-1];f+=t[e>>10];f+=t[e>>4&63];f+=t[e<<2&63];f+="="}i.push(f);return i.join("")}},{}]},{},[])("/")});

0
web_drop_target/static/src/css/web_drop_target.css

129
web_drop_target/static/src/js/web_drop_target.js

@ -0,0 +1,129 @@
//Copyright 2018 Therp BV <https://therp.nl>
//License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
/*global Uint8Array base64js*/
odoo.define('web_drop_target', function(require) {
var FormController = require('web.FormController');
// this is the main contribution of this addon: A mixin you can use
// to make some widget a drop target. Read on how to use this yourself
var DropTargetMixin = {
// add the mime types you want to support here, leave empty for
// all types. For more control, override _get_drop_item in your class
_drop_allowed_types: [],
// a class being applied when the user drags something we can handle
_drag_over_class: 'o_drag_over',
start: function() {
var result = this._super.apply(this, arguments);
this.$el.on('drop.widget_events', this.proxy('_on_drop'));
this.$el.on('dragenter.widget_events', this.proxy('_on_dragenter'));
this.$el.on('dragover.widget_events', this.proxy('_on_dragenter'));
this.$el.on('dragleave.widget_events', this.proxy('_on_dragleave'));
return result;
},
_on_drop: function(e) {
var drop_item = this._get_drop_item(e);
if(!drop_item) {
return;
}
jQuery(e.delegateTarget).removeClass(this._drag_over_class);
var reader = new FileReader();
reader.onloadend = this.proxy(
_.partial(this._handle_file_drop, drop_item.getAsFile())
);
reader.readAsArrayBuffer(drop_item.getAsFile());
e.preventDefault();
},
_on_dragenter: function(e) {
if(this._get_drop_item(e)) {
e.preventDefault();
jQuery(e.delegateTarget).addClass(this._drag_over_class);
return false;
}
},
_on_dragleave: function(e) {
jQuery(e.delegateTarget).removeClass(this._drag_over_class);
},
_get_drop_item: function(e) {
var self = this,
dataTransfer = e.originalEvent.dataTransfer,
drop_item = null;
_.each(dataTransfer.items, function(item) {
if(
_.contains(self._drop_allowed_types, item.type) ||
_.isEmpty(self._drop_allowed_types)
) {
drop_item = item;
}
});
return drop_item;
},
// eslint-disable-next-line no-unused-vars
_handle_file_drop: function(drop_file, e) {
// do something here, for example call the helper function below
// e is the on_load_end handler for the FileReader above,
// so e.target.result contains an ArrayBuffer of the data
},
_handle_file_drop_attach: function(
drop_file, e, res_model, res_id, extra_data
) {
// helper to upload an attachment and update the sidebar
var self = this;
return this._rpc({
model: 'ir.attachment',
method: 'create',
args: [{
'name': drop_file.name,
'datas': base64js.fromByteArray(
new Uint8Array(e.target.result)
),
'datas_fname': drop_file.name,
'res_model': res_model,
'res_id': res_id,
}],
})
.then(function() {
// try to find a sidebar and update it if we found one
var p = self;
while(p && !p.sidebar) {
p = p.getParent ? p.getParent() : null;
}
if(p) {
var sidebar = p.sidebar;
if(sidebar && _.isFunction(sidebar._onFileUploaded)) {
sidebar._onFileUploaded();
}
}
});
}
};
// and here we apply the mixin to form views, allowing any files and
// adding them as attachment
FormController.include(_.extend(DropTargetMixin, {
_get_drop_file: function() {
// disable drag&drop when we're on an unsaved record
if(!this.datarecord.id) {
return null;
}
return this._super.apply(this, arguments);
},
_handle_file_drop: function(drop_file, e) {
return this._handle_file_drop_attach(
drop_file, e, this.renderer.state.model, this.renderer.state.res_id
);
}
}));
return {
'DropTargetMixin': DropTargetMixin,
};
});

10
web_drop_target/views/templates.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="assets_backend" name="web_drop_target assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_drop_target/static/lib/base64js.min.js"></script>
<script type="text/javascript" src="/web_drop_target/static/src/js/web_drop_target.js"></script>
<link rel="stylesheet" href="/web_drop_target/static/src/css/web_drop_target.css"/>
</xpath>
</template>
</odoo>

99
web_export_view/README.rst

@ -1,8 +1,29 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License
Export Current View
===================
=======================
Web Export Current View
=======================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/11.0/web_export_view
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_export_view
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/11.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
One of the best Odoo's features is exporting custom data to CSV/XLS. You can
do it by clicking on the export link in the sidebar. The export action allows
@ -16,11 +37,10 @@ A lot of customers want simply to export the tree view they are looking to.
If you miss this feature as us, probably you'll find an answer into our
web_export_view module.
Configuration
=============
**Table of contents**
If we wanted to disallow users to use the features provided by this module, we
can add them to the group *Disallow Export View Data to Excel*.
.. contents::
:local:
Usage
=====
@ -29,11 +49,10 @@ After you installed it, you'll find an additional link 'Export current view'
right on the sidebar. By clicking on it you'll get a XLS file contains
the same data of the tree view you are looking at, headers included.
Known issues / Roadmap
======================
Known Issues
============
Pedro M. Baeza (pedro.baeza@gmail.com):
Pedro M. Baeza (pedro.baeza@tecnativa.com):
When you have groups, they are not exported to Excel. It would be desirable to have this option.
One of the problems with this module is that you can't export data from a view with mode="tree".
Changing the approach to have the button always visible (we should relocate it also to another place,
@ -43,39 +62,51 @@ to locate the feature, as it's hidden now by default and users don't think about
The behavior will be: nothing selected > you export all (including groups).
Something or all selected: export the selection.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/web/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_export_view%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Henry Zhou
* Agile Business Group
Contributors
------------
~~~~~~~~~~~~
* Henry Zhou (MAXodoo) <zhouhenry@live.com>
* Rodney <https://github.com/rv-clearcorp>
* Simone Orsi <simahawk@gmail.com>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Stefan Rijnhart <stefan@therp.nl>
* Leonardo Pistone <leonardo.pistone@camptocamp.com>
* Jose Maria Bernet <josemaria.bernet@guadaltech.es>
* David Vidal <david.vidal@tecnativa.com>
* Alexandre Díaz <dev@redneboa.es>
* Henry Zhou (MAXodoo) <zhouhenry@live.com>
* Rodney <https://github.com/rv-clearcorp>
* Simone Orsi <simahawk@gmail.com>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Stefan Rijnhart <stefan@therp.nl>
* Leonardo Pistone <leonardo.pistone@camptocamp.com>
* Jose Maria Bernet <josemaria.bernet@guadaltech.es>
* David Vidal <david.vidal@tecnativa.com>
Maintainers
~~~~~~~~~~~
Maintainer
----------
This module is maintained by the OCA.
.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
: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.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/11.0/web_export_view>`_ project on GitHub.
To contribute to this module, please visit http://odoo-community.org.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

4
web_export_view/i18n/da.po

@ -28,14 +28,14 @@ msgstr ""
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr ""
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr ""

4
web_export_view/i18n/de.po

@ -32,14 +32,14 @@ msgstr "Exportiere xls"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr "Falsch"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr "Richtig"

4
web_export_view/i18n/es.po

@ -32,14 +32,14 @@ msgstr "Exportar XLS"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr "Falso"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr "Verdadero"

4
web_export_view/i18n/hr.po

@ -33,14 +33,14 @@ msgstr "Izvoz u XLS"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr "NE"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr "DA"

4
web_export_view/i18n/nl_NL.po

@ -33,14 +33,14 @@ msgstr "Exporteer xls"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr "Fout"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr "Waar"

4
web_export_view/i18n/pt_BR.po

@ -34,14 +34,14 @@ msgstr "Exportar xls"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr "Falso"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr "Verdadeiro"

4
web_export_view/i18n/web_export_view.pot

@ -27,14 +27,14 @@ msgstr ""
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr ""
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr ""

4
web_export_view/i18n/zh_CN.po

@ -33,14 +33,14 @@ msgstr "导出 xls"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "False"
msgstr "否"
#. module: web_export_view
#. openerp-web
#: code:addons/web_export_view/static/src/js/web_export_view.js:76
#: code:addons/web_export_view/static/src/js/web_export_view.js:90
#, python-format
msgid "True"
msgstr "是"

2
web_export_view/readme/CONFIGURATION.rst

@ -0,0 +1,2 @@
If we wanted to disallow users to use the features provided by this module, we
can add them to the group *Disallow Export View Data to Excel*.

9
web_export_view/readme/CONTRIBUTORS.rst

@ -0,0 +1,9 @@
* Henry Zhou (MAXodoo) <zhouhenry@live.com>
* Rodney <https://github.com/rv-clearcorp>
* Simone Orsi <simahawk@gmail.com>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Stefan Rijnhart <stefan@therp.nl>
* Leonardo Pistone <leonardo.pistone@camptocamp.com>
* Jose Maria Bernet <josemaria.bernet@guadaltech.es>
* David Vidal <david.vidal@tecnativa.com>
* Alexandre Díaz <dev@redneboa.es>

11
web_export_view/readme/DESCRIPTION.rst

@ -0,0 +1,11 @@
One of the best Odoo's features is exporting custom data to CSV/XLS. You can
do it by clicking on the export link in the sidebar. The export action allows
us to configure what to be exported by selecting fields, etc, and allows you
to save your export as a template so that you can export it once again without
having to configure it again.
That feature is as great and advanced as limited for an everyday experience.
A lot of customers want simply to export the tree view they are looking to.
If you miss this feature as us, probably you'll find an answer into our
web_export_view module.

9
web_export_view/readme/ROADMAP.rst

@ -0,0 +1,9 @@
Pedro M. Baeza (pedro.baeza@tecnativa.com):
When you have groups, they are not exported to Excel. It would be desirable to have this option.
One of the problems with this module is that you can't export data from a view with mode="tree".
Changing the approach to have the button always visible (we should relocate it also to another place,
as the current location is not visible for these views), and digging correctly in the DOM elements
for this view (very similar to the normal tree view one) will do the trick. This will also help users
to locate the feature, as it's hidden now by default and users don't think about selecting records.
The behavior will be: nothing selected > you export all (including groups).
Something or all selected: export the selection.

3
web_export_view/readme/USAGE.rst

@ -0,0 +1,3 @@
After you installed it, you'll find an additional link 'Export current view'
right on the sidebar. By clicking on it you'll get a XLS file contains
the same data of the tree view you are looking at, headers included.

456
web_export_view/static/description/index.html

@ -0,0 +1,456 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Web Export Current View</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="web-export-current-view">
<h1 class="title">Web Export Current View</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_export_view"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_export_view"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>One of the best Odoo’s features is exporting custom data to CSV/XLS. You can
do it by clicking on the export link in the sidebar. The export action allows
us to configure what to be exported by selecting fields, etc, and allows you
to save your export as a template so that you can export it once again without
having to configure it again.</p>
<p>That feature is as great and advanced as limited for an everyday experience.
A lot of customers want simply to export the tree view they are looking to.</p>
<p>If you miss this feature as us, probably you’ll find an answer into our
web_export_view module.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>After you installed it, you’ll find an additional link ‘Export current view’
right on the sidebar. By clicking on it you’ll get a XLS file contains
the same data of the tree view you are looking at, headers included.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h1>
<p>Pedro M. Baeza (<a class="reference external" href="mailto:pedro.baeza&#64;tecnativa.com">pedro.baeza&#64;tecnativa.com</a>):
When you have groups, they are not exported to Excel. It would be desirable to have this option.
One of the problems with this module is that you can’t export data from a view with mode=”tree”.
Changing the approach to have the button always visible (we should relocate it also to another place,
as the current location is not visible for these views), and digging correctly in the DOM elements
for this view (very similar to the normal tree view one) will do the trick. This will also help users
to locate the feature, as it’s hidden now by default and users don’t think about selecting records.
The behavior will be: nothing selected &gt; you export all (including groups).
Something or all selected: export the selection.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_export_view%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple">
<li>Henry Zhou</li>
<li>Agile Business Group</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li>Henry Zhou (MAXodoo) &lt;<a class="reference external" href="mailto:zhouhenry&#64;live.com">zhouhenry&#64;live.com</a>&gt;</li>
<li>Rodney &lt;<a class="reference external" href="https://github.com/rv-clearcorp">https://github.com/rv-clearcorp</a>&gt;</li>
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simahawk&#64;gmail.com">simahawk&#64;gmail.com</a>&gt;</li>
<li>Lorenzo Battistini &lt;<a class="reference external" href="mailto:lorenzo.battistini&#64;agilebg.com">lorenzo.battistini&#64;agilebg.com</a>&gt;</li>
<li>Stefan Rijnhart &lt;<a class="reference external" href="mailto:stefan&#64;therp.nl">stefan&#64;therp.nl</a>&gt;</li>
<li>Leonardo Pistone &lt;<a class="reference external" href="mailto:leonardo.pistone&#64;camptocamp.com">leonardo.pistone&#64;camptocamp.com</a>&gt;</li>
<li>Jose Maria Bernet &lt;<a class="reference external" href="mailto:josemaria.bernet&#64;guadaltech.es">josemaria.bernet&#64;guadaltech.es</a>&gt;</li>
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li>Alexandre Díaz &lt;<a class="reference external" href="mailto:dev&#64;redneboa.es">dev&#64;redneboa.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_export_view">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

141
web_export_view/static/src/js/web_export_view.js

@ -1,5 +1,5 @@
odoo.define('web_export_view', function (require) {
"use strict";
"use strict";
var core = require('web.core');
var Sidebar = require('web.Sidebar');
@ -15,33 +15,37 @@ odoo.define('web_export_view', function (require) {
_redraw: function () {
var self = this;
this._super.apply(this, arguments);
if (self.getParent().renderer.viewType == 'list') {
session.user_has_group('web_export_view.group_disallow_export_view_data_excel').then(function (has_group) {
if (!has_group) {
self.$el.find('.o_dropdown').last().append(QWeb.render('WebExportTreeViewXls', { widget: self }));
self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls);
}
});
if (self.getParent().renderer.viewType === 'list') {
session.user_has_group(
'web_export_view.group_disallow_export_view_data_excel')
.then(function (has_group) {
if (!has_group) {
self.$el.find('.o_dropdown')
.last().append(QWeb.render(
'WebExportTreeViewXls', {widget: self}));
self.$el.find('.export_treeview_xls').on('click',
self.on_sidebar_export_treeview_xls);
}
});
}
},
on_sidebar_export_treeview_xls: function () {
// Select the first list of the current (form) view
// or assume the main view is a list view and use that
var self = this,
view = this.getParent(),
var view = this.getParent(),
children = view.getChildren();
var c = crash_manager;
if (children) {
children.every(function (child) {
if (child.field && child.field.type == 'one2many') {
if (child.field && child.field.type === 'one2many') {
view = child.viewmanager.views.list.controller;
return false; // break out of the loop
return false;
}
if (child.field && child.field.type == 'many2many') {
if (child.field && child.field.type === 'many2many') {
view = child.list_view;
return false; // break out of the loop
return false;
}
return true;
});
@ -49,70 +53,83 @@ odoo.define('web_export_view', function (require) {
var export_columns_keys = [];
var export_columns_names = [];
var column_index = 0;
var column_header_selector;
var column_header_selector = '';
var isGrouped = view.renderer.state.groupedBy.length > 0;
$.each(view.renderer.columns, function () {
if (this.tag == 'field' && (this.attrs.widget === undefined || this.attrs.widget != 'handle')) {
// non-fields like `_group` or buttons
if (this.tag === 'field' &&
(this.attrs.widget === undefined ||
this.attrs.widget !== 'handle')) {
export_columns_keys.push(column_index);
column_header_selector = '.o_list_view > thead > tr> th:not([class*="o_list_record_selector"]):eq('+column_index+')';
export_columns_names.push(view.$el.find(column_header_selector)[0].textContent);
var css_selector_index = isGrouped
? column_index+1 : column_index;
column_header_selector = '.o_list_view > thead > tr> ' +
'th:not([class*="o_list_record_selector"]):eq(' +
css_selector_index + ')';
export_columns_names.push(
view.$el.find(column_header_selector)[0].textContent);
}
column_index ++;
++column_index;
});
var export_rows = [];
$.blockUI();
if (children) {
// find only rows with data
view.$el.find('.o_list_view > tbody > tr.o_data_row:has(.o_list_record_selector input:checkbox:checked)')
.each(function () {
var $row = $(this);
var export_row = [];
$.each(export_columns_keys, function () {
var $cell = $row.find('td.o_data_cell:eq('+this+')')
var $cellcheckbox = $cell.find('.o_checkbox input:checkbox');
if ($cellcheckbox.length) {
export_row.push(
$cellcheckbox.is(":checked")
? _t("True") : _t("False")
);
}
else {
var text = $cell.text().trim();
var is_number = (
$cell.hasClass('o_list_number') &&
!$cell.hasClass('o_float_time_cell')
);
if (is_number) {
export_row.push(parseFloat(
text
// Remove thousands separator
.split(_t.database.parameters.thousands_sep)
.join("")
// Always use a `.` as decimal separator
.replace(_t.database.parameters.decimal_point, ".")
// Remove non-numeric characters
.replace(/[^\d\.-]/g, "")
));
// Find only rows with data
view.$el.find('.o_list_view > tbody > tr.o_data_row:' +
'has(.o_list_record_selector input:checkbox:checked)')
.each(function () {
var $row = $(this);
var export_row = [];
$.each(export_columns_keys, function () {
var $cell = $row.find(
'td.o_data_cell:eq('+this+')');
var $cellcheckbox = $cell.find(
'.o_checkbox input:checkbox');
if ($cellcheckbox.length) {
export_row.push(
$cellcheckbox.is(":checked")
? _t("True") : _t("False")
);
} else {
export_row.push(text);
var text = $cell.text().trim();
var is_number =
$cell.hasClass('o_list_number') &&
!$cell.hasClass('o_float_time_cell');
if (is_number) {
var db_params = _t.database.parameters;
export_row.push(parseFloat(
text
// Remove thousands separator
.split(db_params.thousands_sep)
.join("")
// Always use a `.` as decimal
// separator
.replace(db_params.decimal_point,
".")
// Remove non-numeric characters
.replace(/[^\d.-]/g, "")
));
} else {
export_row.push(text);
}
}
}
});
export_rows.push(export_row);
});
export_rows.push(export_row);
});
}
session.get_file({
url: '/web/export/xls_view',
data: {data: JSON.stringify({
model: view.modelName,
headers: export_columns_names,
rows: export_rows
})},
data: {
data: JSON.stringify({
model: view.modelName,
headers: export_columns_names,
rows: export_rows,
}),
},
complete: $.unblockUI,
error: c.rpc_error.bind(c)
error: c.rpc_error.bind(c),
});
}
},
});
});

64
web_listview_invert_selection/README.rst

@ -0,0 +1,64 @@
.. 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
=====================
List Invert Selection
=====================
Allow to invert the current selection of a list of records.
Configuration
=============
No configuration is needed.
Usage
=====
.. figure:: static/description/before.png
:alt: Before
.. figure:: static/description/after.png
:alt: After
To use this module, you need to:
#. Go on any selectable list view;
#. Click on the "Invert Selection" button on the list header;
.. 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
<https://github.com/OCA/web/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Antonio Esposito <a.esposito@onestein.nl>
* Meet Dholakia <meetcomputer009@gmail.com>
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.

3
web_listview_invert_selection/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

20
web_listview_invert_selection/__manifest__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'List Invert Selection',
'summary': 'Invert current selection of list of records',
'version': '11.0.1.0.0',
'category': 'Web',
'author': 'Onestein,Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/web',
'license': 'AGPL-3',
'depends': [
'web',
],
'data': [
'templates/assets.xml'
],
'installable': True,
}

26
web_listview_invert_selection/i18n/fr.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_listview_invert_selection
#
# Translators:
# Quentin THEURET <odoo@kerpeo.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-26 02:44+0000\n"
"PO-Revision-Date: 2017-07-26 02:44+0000\n"
"Last-Translator: Quentin THEURET <odoo@kerpeo.com>, 2017\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: web_listview_invert_selection
#. openerp-web
#: code:addons/web_listview_invert_selection/static/src/js/web_listview_invert_selection.js:35
#, python-format
msgid "Invert Selection"
msgstr "Inverser la sélection"

22
web_listview_invert_selection/i18n/web_listview_invert_selection.pot

@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_listview_invert_selection
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: web_listview_invert_selection
#. openerp-web
#: code:addons/web_listview_invert_selection/static/src/js/web_listview_invert_selection.js:35
#, python-format
msgid "Invert Selection"
msgstr ""

BIN
web_listview_invert_selection/static/description/after.png

After

Width: 1850  |  Height: 900  |  Size: 123 KiB

BIN
web_listview_invert_selection/static/description/before.png

After

Width: 1850  |  Height: 900  |  Size: 118 KiB

BIN
web_listview_invert_selection/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

42
web_listview_invert_selection/static/src/js/web_listview_invert_selection.js

@ -0,0 +1,42 @@
/* Copyright 2017 Onestein
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define("web_listview_invert_selection", function (require) {
"use strict";
var core = require('web.core');
var _t = core._t;
var ListRenderer = require('web.ListRenderer');
ListRenderer.include(/** @lends instance.web.ListView# */{
events: _.extend({}, ListRenderer.prototype.events, {
'click .o_invert_selection': '_onInvertSelection',
}),
_onInvertSelection: function (event) {
event.stopPropagation();
var checked = self.$("tbody .o_list_record_selector input:checked");
var unchecked = self.$("tbody .o_list_record_selector input:not(:checked)");
checked.prop("checked", false);
unchecked.prop("checked", true);
this._updateSelection();
},
_renderHeader: function (isGrouped) {
var $header = this._super.apply(this, arguments);
if (this.hasSelectors) {
$header.find('th.o_list_record_selector').prepend(this._renderInvertSelection('span'));
}
return $header;
},
_renderInvertSelection: function (tag) {
var $icon = $('<i>', {class: 'fa fa-refresh o_invert_selection_btn', name: 'Invert Selection',
'aria-label': _t('Invert Selection'), 'title': _t('Invert Selection')});
return $('<' + tag + '>')
.addClass('o_invert_selection')
.append($icon);
},
});
});

5
web_listview_invert_selection/static/src/less/web_listview_invert_selection.less

@ -0,0 +1,5 @@
.o_list_view {
.o_invert_selection {
padding-left: 2px;
}
}

12
web_listview_invert_selection/templates/assets.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Onestein
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="assets_backend" name="web_listview_invert_selection backend assets" inherit_id="web.assets_backend">
<xpath expr=".">
<script type="text/javascript" src="/web_listview_invert_selection/static/src/js/web_listview_invert_selection.js"/>
<link rel="stylesheet" type="text/less" href="/web_listview_invert_selection/static/src/less/web_listview_invert_selection.less"/>
</xpath>
</template>
</odoo>

BIN
web_listview_range_select/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

2
web_responsive/__manifest__.py

@ -6,7 +6,7 @@
"name": "Web Responsive",
"summary": "It provides a mobile compliant interface for Odoo Community "
"web",
"version": "11.0.2.0.2",
"version": "11.0.2.0.3",
"category": "Website",
"website": "https://github.com/OCA/web",
"author": "LasLabs, Tecnativa, Alexandre Díaz, "

6
web_responsive/static/src/less/main.less

@ -1,6 +1,8 @@
/* Copyright 2016 LasLabs Inc.
* Copyright 2019 Alexandre Díaz
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
body {
width: 100%;
height: 100%;
@ -55,6 +57,10 @@ main {
}
}
>.o_loading {
z-index: 10;
}
>.o_main {
overflow: auto;
> .o_main_content {

BIN
web_send_message_popup/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

BIN
web_tree_resize_column/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

78
web_view_transition/README.rst

@ -0,0 +1,78 @@
===================
Web View Transition
===================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/11.0/web_view_transition
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_view_transition
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/11.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module adds transitions (CSS Animations) to display views. Configurable by user.
**Table of contents**
.. contents::
:local:
Usage
=====
Go to user menu > Preferences > View Transition Mode
|config|
.. |config| image:: ./images/config.gif
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_view_transition%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Alexandre Díaz
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/11.0/web_view_transition>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

1
web_view_transition/__init__.py

@ -0,0 +1 @@
from . import models

21
web_view_transition/__manifest__.py

@ -0,0 +1,21 @@
# Odoo, Open Source Web View Transition
# Copyright (C) 2019 Alexandre Díaz <dev@redneboa.es>
#
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).#
{
'name': "Web View Transition",
'category': "web",
'version': "11.0.1.0.0",
'author': "Alexandre Díaz, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/Web',
'depends': ['base', 'web'],
'summary': 'This module adds transitions to display views',
'data': [
'view/web_view_transition.xml',
'view/inherited_view_users_form_simple_modif.xml',
],
'license': 'AGPL-3',
'auto_install': False,
'installable': True,
}

90
web_view_transition/i18n/web_view_transition.pot

@ -0,0 +1,90 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_view_transition
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Circle-In"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Fade-In"
msgstr ""
#. module: web_view_transition
#: model:ir.model,name:web_view_transition.model_ir_http
msgid "HTTP routing"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Rotate X"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Rotate X Top (3D)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Rotate Y (3D)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Scale (Back-Top)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Scale (Top-Back)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Skew"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Translate (Down-Top)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Translate (Left-Right)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Translate (Right-Left)"
msgstr ""
#. module: web_view_transition
#: selection:res.users,view_transition_mode:0
msgid "Translate (Top-Down)"
msgstr ""
#. module: web_view_transition
#: model:ir.model,name:web_view_transition.model_res_users
msgid "Users"
msgstr ""
#. module: web_view_transition
#: model:ir.model.fields,field_description:web_view_transition.field_res_users_view_transition_mode
msgid "View Transition Mode"
msgstr ""

BIN
web_view_transition/images/config.gif

After

Width: 1116  |  Height: 762  |  Size: 295 KiB

5
web_view_transition/models/__init__.py

@ -0,0 +1,5 @@
# Copyright 2018 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import inherited_res_users
from . import inherited_ir_http

16
web_view_transition/models/inherited_ir_http.py

@ -0,0 +1,16 @@
# Copyright 2019 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.http import request
class Http(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
vals = super().session_info()
vals.update({
'view_transition_mode': request.env.user.view_transition_mode,
})
return vals

36
web_view_transition/models/inherited_res_users.py

@ -0,0 +1,36 @@
# Copyright 2019 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class ResUsers(models.Model):
_inherit = 'res.users'
view_transition_mode = fields.Selection([
('scale-back-top', 'Scale (Back-Top)'),
('scale-top-back', 'Scale (Top-Back)'),
('skew', 'Skew'),
('translate-left-right', 'Translate (Left-Right)'),
('translate-right-left', 'Translate (Right-Left)'),
('translate-top-down', 'Translate (Top-Down)'),
('translate-down-top', 'Translate (Down-Top)'),
('fade-in', 'Fade-In'),
('circle-in', 'Circle-In'),
('rotate-x-3d', 'Rotate X Top (3D)'),
('rotate-y-3d', 'Rotate Y (3D)'),
('rotate-x-2d', 'Rotate X'),
], string="View Transition Mode")
def __init__(self, pool, cr):
""" Override of __init__ to add access rights.
Access rights are disabled by default, but allowed on some specific
fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
"""
super().__init__(pool, cr)
# duplicate list to avoid modifying the original reference
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
type(self).SELF_WRITEABLE_FIELDS.extend(['view_transition_mode'])
# duplicate list to avoid modifying the original reference
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend(['view_transition_mode'])

1
web_view_transition/readme/DESCRIPTION.rst

@ -0,0 +1 @@
This module adds transitions (CSS Animations) to display views. Configurable by user.

6
web_view_transition/readme/USAGE.rst

@ -0,0 +1,6 @@
Go to user menu > Preferences > View Transition Mode
|config|
.. |config| image:: ./images/config.gif

BIN
web_view_transition/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

419
web_view_transition/static/description/index.html

@ -0,0 +1,419 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Web View Transition</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="web-view-transition">
<h1 class="title">Web View Transition</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_view_transition"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_view_transition"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds transitions (CSS Animations) to display views. Configurable by user.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>Go to user menu &gt; Preferences &gt; View Transition Mode</p>
<blockquote>
<img alt="config" src="./images/config.gif" /></blockquote>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_view_transition%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Alexandre Díaz</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_view_transition">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

142
web_view_transition/static/src/css/transitions.less

@ -0,0 +1,142 @@
@keyframes o-view-transition-scale-back-top-animation {
from { transform: scale(0.1); }
to { transform: scale(1.0); }
}
@keyframes o-view-transition-scale-top-back-animation {
from { transform: scale(2.0); }
to { transform: scale(1.0); }
}
@keyframes o-view-transition-skew-animation {
from { transform: skewX(89deg); }
to { transform: skewX(0deg); }
}
@keyframes o-view-transition-translate-left-right-animation {
from { transform: translate(-100vw, 0); }
to { transform: translate(0, 0); }
}
@keyframes o-view-transition-translate-right-left-animation {
from { transform: translate(100vw,0); }
to { transform: translate(0, 0); }
}
@keyframes o-view-transition-translate-top-down-animation {
from { transform: translate(0, -100vh); }
to { transform: translate(0, 0); }
}
@keyframes o-view-transition-translate-down-top-animation {
from { transform: translate(0, 100vh); }
to { transform: translate(0, 0); }
}
@keyframes o-view-transition-fade-in-animation {
from { opacity: 0.0; }
to { opacity: 1.0; }
}
@keyframes o-view-transition-circle-in-animation {
0% {
overflow: hidden;
border-radius: 100%;
width: 0;
height: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
99.9% {
overflow: hidden;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
100% {
width: 100%;
height: 100%;
transform: translate(0, 0);
border-radius: 0;
overflow: auto;
}
}
@keyframes o-view-transition-rotate-x-3d-animation {
from {
transform: perspective(400px) rotateX(-90deg);
transform-origin: top center;
}
to {
transform: rotateX(0);
transform-origin: top center;
}
}
@keyframes o-view-transition-rotate-x-2d-animation {
from {
transform: rotateX(-90deg);
}
to {
transform: rotateX(0);
}
}
@keyframes o-view-transition-rotate-y-3d-animation {
from {
transform: perspective(400px) rotateY(-40deg) translateZ(-288px);
}
to {
transform: rotateY(0) translateZ(0);
}
}
.o-view-transition-scale-back-top {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-scale-back-top-animation;
}
.o-view-transition-scale-top-back {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-scale-top-back-animation;
}
.o-view-transition-skew {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-skew-animation;
}
.o-view-transition-translate-left-right {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-translate-left-right-animation;
}
.o-view-transition-translate-right-left {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-translate-right-left-animation;
}
.o-view-transition-translate-top-down {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-translate-top-down-animation;
}
.o-view-transition-translate-down-top {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-translate-down-top-animation;
}
.o-view-transition-fade-in {
animation: 0.3s cubic-bezier(.68,-0.55,.27,1.55) o-view-transition-fade-in-animation;
}
.o-view-transition-circle-in {
animation: 0.3s cubic-bezier(.6,.04,.98,.34) o-view-transition-circle-in-animation;
}
.o-view-transition-rotate-x-3d {
animation: 0.3s cubic-bezier(.65,.05,.36,1) o-view-transition-rotate-x-3d-animation;
}
.o-view-transition-rotate-y-3d {
animation: 0.3s cubic-bezier(.65,.05,.36,1) o-view-transition-rotate-y-3d-animation;
}
.o-view-transition-rotate-x-2d {
animation: 0.3s cubic-bezier(.65,.05,.36,1) o-view-transition-rotate-x-2d-animation;
}

20
web_view_transition/static/src/js/view_manager.js

@ -0,0 +1,20 @@
// Copyright 2019 Alexandre Díaz <dev@redneboa.es>
// License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
odoo.define('web_view_transitions.ViewManager', function (require) {
"use strict";
var ViewManager = require('web.ViewManager');
var session = require('web.session');
ViewManager.include({
_display_view: function () {
this._super.apply(this, arguments);
if (this.active_view && session.view_transition_mode) {
this.active_view.$fragment.addClass(
'o-view-transition-' + session.view_transition_mode);
}
},
});
});

21
web_view_transition/view/inherited_view_users_form_simple_modif.xml

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!--
Copyright 2019
@author Alexanre Díaz <dev@redneboa.es>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
-->
<odoo>
<record id="view_users_form_simple_modif" model="ir.ui.view">
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="after">
<field name="view_transition_mode" readonly="0" />
</xpath>
</field>
</record>
</odoo>

9
web_view_transition/view/web_view_transition.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="assets_backend" name="web_view_transition_assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_view_transition/static/src/css/transitions.less"/>
<script type="text/javascript" src="/web_view_transition/static/src/js/view_manager.js"></script>
</xpath>
</template>
</odoo>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save