diff --git a/README.md b/README.md index 9674feef1db0..e8f14f78109e 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ addon | version | maintainers | summary [web_systray_button_init_action](web_systray_button_init_action/) | 18.0.1.0.2 | | Add a button to go to the user init action. [web_theme_classic](web_theme_classic/) | 18.0.1.1.0 | legalsylvain | Contrasted style on fields to improve the UI. [web_timeline](web_timeline/) | 18.0.1.0.1 | tarteo | Interactive visualization chart to show events in time +[web_touchscreen](web_touchscreen/) | 18.0.1.0.0 | yajo rafaelbn | UX improvements for touch screens [web_tree_dynamic_colored_field](web_tree_dynamic_colored_field/) | 18.0.1.0.1 | | Allows you to dynamically color fields on tree views [web_tree_many2one_clickable](web_tree_many2one_clickable/) | 18.0.1.0.1 | | Open the linked resource when clicking on their name [web_widget_bokeh_chart](web_widget_bokeh_chart/) | 18.0.1.0.1 | LoisRForgeFlow JasminSForgeFlow | This widget allows to display charts using Bokeh library. diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index 8bdd7c2188f0..cd8c8ce8d4aa 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "odoo-addons-oca-web" -version = "18.0.20251121.0" +version = "18.0.20251201.0" dependencies = [ "odoo-addon-web_calendar_slot_duration==18.0.*", "odoo-addon-web_chatter_position==18.0.*", @@ -38,6 +38,7 @@ dependencies = [ "odoo-addon-web_systray_button_init_action==18.0.*", "odoo-addon-web_theme_classic==18.0.*", "odoo-addon-web_timeline==18.0.*", + "odoo-addon-web_touchscreen==18.0.*", "odoo-addon-web_tree_dynamic_colored_field==18.0.*", "odoo-addon-web_tree_many2one_clickable==18.0.*", "odoo-addon-web_widget_bokeh_chart==18.0.*", diff --git a/web_dialog_size/i18n/tr.po b/web_dialog_size/i18n/tr.po new file mode 100644 index 000000000000..ed674c86b27c --- /dev/null +++ b/web_dialog_size/i18n/tr.po @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: tr\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_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "" diff --git a/web_touchscreen/README.rst b/web_touchscreen/README.rst new file mode 100644 index 000000000000..f64e15cb822c --- /dev/null +++ b/web_touchscreen/README.rst @@ -0,0 +1,141 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=============== +Web Touchscreen +=============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:112ec2050fedfe73c26285522f19b32b55988139474fb52cc81db70dd053aa03 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/18.0/web_touchscreen + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_touchscreen + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module prefers kanban sub-form views when using a tablet, or any +other device with a touch screen, no matter its size. + +For example, these screenshots showcase a sale order in a tablet: + +=================== ================ +Without this module With this module +=================== ================ +|Before| |After| +=================== ================ + +.. |Before| image:: https://github.com/OCA/web/assets/973709/caa0be55-ec6b-45e8-af94-7492df08dfcc + :target: https://github.com/OCA/web/assets/973709/caa0be55-ec6b-45e8-af94-7492df08dfcc +.. |After| image:: https://github.com/OCA/web/assets/973709/345c1139-879d-4eb5-a828-786b1e3bc7b8 + :target: https://github.com/OCA/web/assets/973709/345c1139-879d-4eb5-a828-786b1e3bc7b8 + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +This module was developed because Odoo optimizes views only for mobile +or desktop, but forgets about tablets. + +It will be useful for you if you usually use a tablet. + +If you need this module for those reasons, these might interest you too: + +- ``web_widget_numeric_step`` +- OCA's ``web_responsive``, or the Odoo EE alternative + ``web_enterprise`` (closed source). + +Usage +===== + +To use this module, you need to: + +1. Use a tablet. +2. Go to any form that contains a sub-view which can be optimized for + mobile. + +Known issues / Roadmap +====================== + +- Enable more mobile UI enhancements for tablets as they seem relevant. +- Allow setting per user or per session, with sane defaults. Just in + case you happen to use a tablet with a mouse. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Moduon + +Contributors +------------ + +- Jairo Llopis (`Moduon `__) +- David Vidal (`Moduon `__) + +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. + +.. |maintainer-yajo| image:: https://github.com/yajo.png?size=40px + :target: https://github.com/yajo + :alt: yajo +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn + +Current `maintainers `__: + +|maintainer-yajo| |maintainer-rafaelbn| + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_touchscreen/__init__.py b/web_touchscreen/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_touchscreen/__manifest__.py b/web_touchscreen/__manifest__.py new file mode 100644 index 000000000000..4ab5ff5e2a9a --- /dev/null +++ b/web_touchscreen/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2023 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +{ + "name": "Web Touchscreen", + "summary": "UX improvements for touch screens", + "version": "18.0.1.0.0", + "development_status": "Alpha", + "category": "Extra Tools", + "website": "https://github.com/OCA/web", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["yajo", "rafaelbn"], + "license": "LGPL-3", + "depends": ["web"], + "assets": { + "web.assets_backend": [ + "web_touchscreen/static/src/**/*", + ], + }, +} diff --git a/web_touchscreen/i18n/it.po b/web_touchscreen/i18n/it.po new file mode 100644 index 000000000000..73388557f6d5 --- /dev/null +++ b/web_touchscreen/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\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" diff --git a/web_touchscreen/i18n/web_touchscreen.pot b/web_touchscreen/i18n/web_touchscreen.pot new file mode 100644 index 000000000000..aadee09bfeda --- /dev/null +++ b/web_touchscreen/i18n/web_touchscreen.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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" diff --git a/web_touchscreen/pyproject.toml b/web_touchscreen/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_touchscreen/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_touchscreen/readme/CONTEXT.md b/web_touchscreen/readme/CONTEXT.md new file mode 100644 index 000000000000..a2465de1e3e8 --- /dev/null +++ b/web_touchscreen/readme/CONTEXT.md @@ -0,0 +1,9 @@ +This module was developed because Odoo optimizes views only for mobile or desktop, but +forgets about tablets. + +It will be useful for you if you usually use a tablet. + +If you need this module for those reasons, these might interest you too: + +- `web_widget_numeric_step` +- OCA's `web_responsive`, or the Odoo EE alternative `web_enterprise` (closed source). diff --git a/web_touchscreen/readme/CONTRIBUTORS.md b/web_touchscreen/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..dd452c4b6216 --- /dev/null +++ b/web_touchscreen/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Jairo Llopis ([Moduon](https://www.moduon.team/)) +- David Vidal ([Moduon](https://www.moduon.team/)) diff --git a/web_touchscreen/readme/DESCRIPTION.md b/web_touchscreen/readme/DESCRIPTION.md new file mode 100644 index 000000000000..85995ba131aa --- /dev/null +++ b/web_touchscreen/readme/DESCRIPTION.md @@ -0,0 +1,12 @@ +This module prefers kanban sub-form views when using a tablet, or any other +device with a touch screen, no matter its size. + +For example, these screenshots showcase a sale order in a tablet: + +| Without this module | With this module | +| --------------------- | ------------------- | +| [![Before][]][Before] | [![After][]][After] | + + +[Before]: https://github.com/OCA/web/assets/973709/caa0be55-ec6b-45e8-af94-7492df08dfcc +[After]: https://github.com/OCA/web/assets/973709/345c1139-879d-4eb5-a828-786b1e3bc7b8 diff --git a/web_touchscreen/readme/ROADMAP.md b/web_touchscreen/readme/ROADMAP.md new file mode 100644 index 000000000000..cb971ce7a79c --- /dev/null +++ b/web_touchscreen/readme/ROADMAP.md @@ -0,0 +1,3 @@ +- Enable more mobile UI enhancements for tablets as they seem relevant. +- Allow setting per user or per session, with sane defaults. Just in case you happen to + use a tablet with a mouse. diff --git a/web_touchscreen/readme/USAGE.md b/web_touchscreen/readme/USAGE.md new file mode 100644 index 000000000000..e3fd621276e1 --- /dev/null +++ b/web_touchscreen/readme/USAGE.md @@ -0,0 +1,4 @@ +To use this module, you need to: + +1. Use a tablet. +1. Go to any form that contains a sub-view which can be optimized for mobile. diff --git a/web_touchscreen/static/description/icon.png b/web_touchscreen/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/web_touchscreen/static/description/icon.png differ diff --git a/web_touchscreen/static/description/index.html b/web_touchscreen/static/description/index.html new file mode 100644 index 000000000000..b7b5ae29c816 --- /dev/null +++ b/web_touchscreen/static/description/index.html @@ -0,0 +1,488 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Web Touchscreen

+ +

Alpha License: LGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module prefers kanban sub-form views when using a tablet, or any +other device with a touch screen, no matter its size.

+

For example, these screenshots showcase a sale order in a tablet:

+ ++++ + + + + + + + + + + +
Without this moduleWith this module
BeforeAfter
+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

This module was developed because Odoo optimizes views only for mobile +or desktop, but forgets about tablets.

+

It will be useful for you if you usually use a tablet.

+

If you need this module for those reasons, these might interest you too:

+
    +
  • web_widget_numeric_step
  • +
  • OCA’s web_responsive, or the Odoo EE alternative +web_enterprise (closed source).
  • +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Use a tablet.
  2. +
  3. Go to any form that contains a sub-view which can be optimized for +mobile.
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Enable more mobile UI enhancements for tablets as they seem relevant.
  • +
  • Allow setting per user or per session, with sane defaults. Just in +case you happen to use a tablet with a mouse.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Moduon
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

Current maintainers:

+

yajo rafaelbn

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/web_touchscreen/static/src/fields.esm.js b/web_touchscreen/static/src/fields.esm.js new file mode 100644 index 000000000000..5beb5cc14a52 --- /dev/null +++ b/web_touchscreen/static/src/fields.esm.js @@ -0,0 +1,29 @@ +import {Field} from "@web/views/fields/field"; +import {hasTouch} from "@web/core/browser/feature_detection"; +import {patch} from "@web/core/utils/patch"; +import {utils} from "@web/core/ui/ui_service"; + +patch(Field, { + /** + * @override + * Whenever a x2many field loads a list we want to force the kanban view over the + * list one if both options are available and a touchscreen is being used. + */ + parseFieldNode(node) { + const fieldInfo = super.parseFieldNode(...arguments); + // If it's small, it's already handled in super. If the viewMode is already + // kanban, there's no need to do anything. And the same goes for no touch + // devices. + if (utils.isSmall() || fieldInfo.viewMode === "kanban" || !hasTouch()) { + return fieldInfo; + } + const viewMode = node.getAttribute("mode"); + const kanban_is_optional = + (viewMode && viewMode.split(",").includes("kanban")) || + (fieldInfo.views?.list && fieldInfo.views?.kanban); + if (fieldInfo.viewMode === "list" && kanban_is_optional) { + fieldInfo.viewMode = "kanban"; + } + return fieldInfo; + }, +});