🤝 Merge branch '11.0' of github.com:OCA/web into 11-mig-web_widget_x2many_2d_matrix
pull/1298/head
-
2setup/_metapackage/VERSION.txt
-
7setup/_metapackage/setup.py
-
1setup/web_access_rule_buttons/odoo/addons/web_access_rule_buttons
-
0setup/web_access_rule_buttons/setup.cfg
-
0setup/web_access_rule_buttons/setup.py
-
1setup/web_drop_target/odoo/addons/web_drop_target
-
2setup/web_drop_target/setup.cfg
-
6setup/web_drop_target/setup.py
-
1setup/web_listview_invert_selection/odoo/addons/web_listview_invert_selection
-
2setup/web_listview_invert_selection/setup.cfg
-
6setup/web_listview_invert_selection/setup.py
-
1setup/web_view_transition/odoo/addons/web_view_transition
-
2setup/web_view_transition/setup.cfg
-
6setup/web_view_transition/setup.py
-
1setup/web_widget_datepicker_options/odoo/addons/web_widget_datepicker_options
-
1setup/web_widget_digitized_signature/odoo/addons/web_widget_digitized_signature
-
2setup/web_widget_digitized_signature/setup.cfg
-
6setup/web_widget_digitized_signature/setup.py
-
1setup/web_widget_timepicker/odoo/addons/web_widget_timepicker
-
2setup/web_widget_timepicker/setup.cfg
-
6setup/web_widget_timepicker/setup.py
-
83web_access_rule_buttons/README.rst
-
3web_access_rule_buttons/__init__.py
-
19web_access_rule_buttons/__manifest__.py
-
35web_access_rule_buttons/i18n/web_access_rule_buttons.pot
-
3web_access_rule_buttons/models/__init__.py
-
37web_access_rule_buttons/models/models.py
-
2web_access_rule_buttons/readme/CONTRIBUTORS.rst
-
2web_access_rule_buttons/readme/DESCRIPTION.rst
-
3web_access_rule_buttons/readme/USAGE.rst
-
0web_access_rule_buttons/static/description/icon.png
-
429web_access_rule_buttons/static/description/index.html
-
32web_access_rule_buttons/static/src/js/form_controller.js
-
3web_access_rule_buttons/tests/__init__.py
-
19web_access_rule_buttons/tests/test_access_rule_buttons.py
-
8web_access_rule_buttons/views/web_access_rule_buttons.xml
-
BINweb_disable_export_group/static/description/icon.png
-
102web_drop_target/README.rst
-
2web_drop_target/__init__.py
-
17web_drop_target/__manifest__.py
-
0web_drop_target/i18n/web_drop_target.pot
-
2web_drop_target/readme/CONTRIBUTORS.rst
-
5web_drop_target/readme/DESCRIPTION.rst
-
3web_drop_target/readme/DEVELOP.rst
-
5web_drop_target/readme/ROADMAP.rst
-
4web_drop_target/readme/USAGE.rst
-
BINweb_drop_target/static/description/icon.png
-
450web_drop_target/static/description/index.html
-
1web_drop_target/static/lib/base64js.min.js
-
0web_drop_target/static/src/css/web_drop_target.css
-
129web_drop_target/static/src/js/web_drop_target.js
-
10web_drop_target/views/templates.xml
-
99web_export_view/README.rst
-
4web_export_view/i18n/da.po
-
4web_export_view/i18n/de.po
-
4web_export_view/i18n/es.po
-
4web_export_view/i18n/hr.po
-
4web_export_view/i18n/nl_NL.po
-
4web_export_view/i18n/pt_BR.po
-
4web_export_view/i18n/web_export_view.pot
-
4web_export_view/i18n/zh_CN.po
-
2web_export_view/readme/CONFIGURATION.rst
-
9web_export_view/readme/CONTRIBUTORS.rst
-
11web_export_view/readme/DESCRIPTION.rst
-
9web_export_view/readme/ROADMAP.rst
-
3web_export_view/readme/USAGE.rst
-
456web_export_view/static/description/index.html
-
141web_export_view/static/src/js/web_export_view.js
-
64web_listview_invert_selection/README.rst
-
3web_listview_invert_selection/__init__.py
-
20web_listview_invert_selection/__manifest__.py
-
26web_listview_invert_selection/i18n/fr.po
-
22web_listview_invert_selection/i18n/web_listview_invert_selection.pot
-
BINweb_listview_invert_selection/static/description/after.png
-
BINweb_listview_invert_selection/static/description/before.png
-
BINweb_listview_invert_selection/static/description/icon.png
-
42web_listview_invert_selection/static/src/js/web_listview_invert_selection.js
-
5web_listview_invert_selection/static/src/less/web_listview_invert_selection.less
-
12web_listview_invert_selection/templates/assets.xml
-
BINweb_listview_range_select/static/description/icon.png
-
2web_responsive/__manifest__.py
-
6web_responsive/static/src/less/main.less
-
BINweb_send_message_popup/static/description/icon.png
-
BINweb_tree_resize_column/static/description/icon.png
-
78web_view_transition/README.rst
-
1web_view_transition/__init__.py
-
21web_view_transition/__manifest__.py
-
90web_view_transition/i18n/web_view_transition.pot
-
BINweb_view_transition/images/config.gif
-
5web_view_transition/models/__init__.py
-
16web_view_transition/models/inherited_ir_http.py
-
36web_view_transition/models/inherited_res_users.py
-
1web_view_transition/readme/DESCRIPTION.rst
-
6web_view_transition/readme/USAGE.rst
-
BINweb_view_transition/static/description/icon.png
-
419web_view_transition/static/description/index.html
-
142web_view_transition/static/src/css/transitions.less
-
20web_view_transition/static/src/js/view_manager.js
-
21web_view_transition/view/inherited_view_users_form_simple_modif.xml
-
9web_view_transition/view/web_view_transition.xml
@ -1 +1 @@ |
|||
11.0.20190227.0 |
|||
11.0.20190515.0 |
@ -0,0 +1 @@ |
|||
../../../../web_access_rule_buttons |
@ -0,0 +1 @@ |
|||
../../../../web_drop_target |
@ -0,0 +1,2 @@ |
|||
[bdist_wheel] |
|||
universal=1 |
@ -0,0 +1,6 @@ |
|||
import setuptools |
|||
|
|||
setuptools.setup( |
|||
setup_requires=['setuptools-odoo'], |
|||
odoo_addon=True, |
|||
) |
@ -0,0 +1 @@ |
|||
../../../../web_listview_invert_selection |
@ -0,0 +1,2 @@ |
|||
[bdist_wheel] |
|||
universal=1 |
@ -0,0 +1,6 @@ |
|||
import setuptools |
|||
|
|||
setuptools.setup( |
|||
setup_requires=['setuptools-odoo'], |
|||
odoo_addon=True, |
|||
) |
@ -0,0 +1 @@ |
|||
../../../../web_view_transition |
@ -0,0 +1,2 @@ |
|||
[bdist_wheel] |
|||
universal=1 |
@ -0,0 +1,6 @@ |
|||
import setuptools |
|||
|
|||
setuptools.setup( |
|||
setup_requires=['setuptools-odoo'], |
|||
odoo_addon=True, |
|||
) |
@ -1 +0,0 @@ |
|||
../../../../web_widget_datepicker_options |
@ -0,0 +1 @@ |
|||
../../../../web_widget_digitized_signature |
@ -0,0 +1,2 @@ |
|||
[bdist_wheel] |
|||
universal=1 |
@ -0,0 +1,6 @@ |
|||
import setuptools |
|||
|
|||
setuptools.setup( |
|||
setup_requires=['setuptools-odoo'], |
|||
odoo_addon=True, |
|||
) |
@ -0,0 +1 @@ |
|||
../../../../web_widget_timepicker |
@ -0,0 +1,2 @@ |
|||
[bdist_wheel] |
|||
universal=1 |
@ -0,0 +1,6 @@ |
|||
import setuptools |
|||
|
|||
setuptools.setup( |
|||
setup_requires=['setuptools-odoo'], |
|||
odoo_addon=True, |
|||
) |
@ -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. |
@ -0,0 +1,3 @@ |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|||
|
|||
from . import models |
@ -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, |
|||
} |
@ -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 "" |
|||
|
@ -0,0 +1,3 @@ |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|||
|
|||
from . import models |
@ -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 |
@ -0,0 +1,2 @@ |
|||
* Guewen Baconnier <guewen.baconnier@camptocamp.com> |
|||
* Antonio Esposito <a.esposito@onestein.nl> |
@ -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. |
@ -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. |
Before Width: 128 | Height: 128 | Size: 9.2 KiB After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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 <<a class="reference external" href="mailto:guewen.baconnier@camptocamp.com">guewen.baconnier@camptocamp.com</a>></li> |
|||
<li>Antonio Esposito <<a class="reference external" href="mailto:a.esposito@onestein.nl">a.esposito@onestein.nl</a>></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> |
@ -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); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
}); |
|||
}); |
@ -0,0 +1,3 @@ |
|||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). |
|||
|
|||
from . import test_access_rule_buttons |
@ -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']) |
@ -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> |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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. |
@ -0,0 +1,2 @@ |
|||
# Copyright 2018 Therp BV <https://therp.nl> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
@ -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,0 +1,2 @@ |
|||
* Holger Brunn <hbrunn@therp.nl> |
|||
* Akim Juillerat <akim.juillerat@camptocamp.com> |
@ -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. |
@ -0,0 +1,3 @@ |
|||
**Libraries** |
|||
|
|||
* `base64js <https://raw.githubusercontent.com/beatgammit/base64-js>`_. |
@ -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 |
@ -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 |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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&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 <<a class="reference external" href="mailto:hbrunn@therp.nl">hbrunn@therp.nl</a>></li> |
|||
<li>Akim Juillerat <<a class="reference external" href="mailto:akim.juillerat@camptocamp.com">akim.juillerat@camptocamp.com</a>></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> |
@ -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,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, |
|||
}; |
|||
}); |
@ -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> |
@ -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*. |
@ -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> |
@ -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. |
@ -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. |
@ -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. |
@ -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@tecnativa.com">pedro.baeza@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 > 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) <<a class="reference external" href="mailto:zhouhenry@live.com">zhouhenry@live.com</a>></li> |
|||
<li>Rodney <<a class="reference external" href="https://github.com/rv-clearcorp">https://github.com/rv-clearcorp</a>></li> |
|||
<li>Simone Orsi <<a class="reference external" href="mailto:simahawk@gmail.com">simahawk@gmail.com</a>></li> |
|||
<li>Lorenzo Battistini <<a class="reference external" href="mailto:lorenzo.battistini@agilebg.com">lorenzo.battistini@agilebg.com</a>></li> |
|||
<li>Stefan Rijnhart <<a class="reference external" href="mailto:stefan@therp.nl">stefan@therp.nl</a>></li> |
|||
<li>Leonardo Pistone <<a class="reference external" href="mailto:leonardo.pistone@camptocamp.com">leonardo.pistone@camptocamp.com</a>></li> |
|||
<li>Jose Maria Bernet <<a class="reference external" href="mailto:josemaria.bernet@guadaltech.es">josemaria.bernet@guadaltech.es</a>></li> |
|||
<li>David Vidal <<a class="reference external" href="mailto:david.vidal@tecnativa.com">david.vidal@tecnativa.com</a>></li> |
|||
<li>Alexandre Díaz <<a class="reference external" href="mailto:dev@redneboa.es">dev@redneboa.es</a>></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> |
@ -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. |
@ -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). |
@ -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, |
|||
} |
@ -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" |
@ -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 "" |
|||
|
After Width: 1850 | Height: 900 | Size: 123 KiB |
After Width: 1850 | Height: 900 | Size: 118 KiB |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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); |
|||
}, |
|||
|
|||
}); |
|||
}); |
@ -0,0 +1,5 @@ |
|||
.o_list_view { |
|||
.o_invert_selection { |
|||
padding-left: 2px; |
|||
} |
|||
} |
@ -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> |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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. |
@ -0,0 +1 @@ |
|||
from . import models |
@ -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, |
|||
} |
@ -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 "" |
|||
|
After Width: 1116 | Height: 762 | Size: 295 KiB |
@ -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 |
@ -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 |
@ -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']) |
@ -0,0 +1 @@ |
|||
This module adds transitions (CSS Animations) to display views. Configurable by user. |
@ -0,0 +1,6 @@ |
|||
Go to user menu > Preferences > View Transition Mode |
|||
|
|||
|config| |
|||
|
|||
|
|||
.. |config| image:: ./images/config.gif |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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 > Preferences > 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> |
@ -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; |
|||
} |
@ -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); |
|||
} |
|||
}, |
|||
}); |
|||
|
|||
}); |
@ -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> |
@ -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> |