diff --git a/odoo-bringout-oca-web-web_action_conditionable/README.md b/odoo-bringout-oca-web-web_action_conditionable/README.md new file mode 100644 index 0000000..d189879 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/README.md @@ -0,0 +1,47 @@ +# web_action_conditionable + +Odoo addon: web_action_conditionable + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_action_conditionable +``` + +## Dependencies + +This addon depends on: +- base +- web + +## Manifest Information + +- **Name**: web_action_conditionable +- **Version**: 16.0.1.0.0 +- **Category**: N/A +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_action_conditionable`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_action_conditionable/doc/ARCHITECTURE.md new file mode 100644 index 0000000..6f261d0 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_action_conditionable Module - web_action_conditionable + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_action_conditionable/doc/CONFIGURATION.md new file mode 100644 index 0000000..d58c35e --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_action_conditionable. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_action_conditionable/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_action_conditionable/doc/DEPENDENCIES.md new file mode 100644 index 0000000..17a01ac --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/DEPENDENCIES.md @@ -0,0 +1,6 @@ +# Dependencies + +This addon depends on: + +- base +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/FAQ.md b/odoo-bringout-oca-web-web_action_conditionable/doc/FAQ.md new file mode 100644 index 0000000..aaeaa70 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_action_conditionable or install in UI. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/INSTALL.md b/odoo-bringout-oca-web-web_action_conditionable/doc/INSTALL.md new file mode 100644 index 0000000..0cb88ed --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_action_conditionable" +# or +uv pip install odoo-bringout-oca-web-web_action_conditionable" +``` diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/MODELS.md b/odoo-bringout-oca-web-web_action_conditionable/doc/MODELS.md new file mode 100644 index 0000000..9346e5e --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/MODELS.md @@ -0,0 +1,11 @@ +# Models + +Detected core models and extensions in web_action_conditionable. + +```mermaid +classDiagram +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_action_conditionable/doc/OVERVIEW.md new file mode 100644 index 0000000..b6f1e66 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_action_conditionable. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_action_conditionable +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/REPORTS.md b/odoo-bringout-oca-web-web_action_conditionable/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/SECURITY.md b/odoo-bringout-oca-web-web_action_conditionable/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_action_conditionable/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/USAGE.md b/odoo-bringout-oca-web-web_action_conditionable/doc/USAGE.md new file mode 100644 index 0000000..afe7c60 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_action_conditionable +``` diff --git a/odoo-bringout-oca-web-web_action_conditionable/doc/WIZARDS.md b/odoo-bringout-oca-web-web_action_conditionable/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_action_conditionable/pyproject.toml b/odoo-bringout-oca-web-web_action_conditionable/pyproject.toml new file mode 100644 index 0000000..fa0656e --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/pyproject.toml @@ -0,0 +1,43 @@ +[project] +name = "odoo-bringout-oca-web-web_action_conditionable" +version = "16.0.0" +description = "web_action_conditionable - Odoo addon" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-base>=16.0.0", + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_action_conditionable"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/README.rst b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/README.rst new file mode 100644 index 0000000..e939676 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/README.rst @@ -0,0 +1,104 @@ +======================== +web_action_conditionable +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:4bc330cf2cd18ff1c39c729eeae66a68dde8f3252b6825de70919e0f45dcc9fc + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_action_conditionable + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_action_conditionable + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Add support for conditions on create and delete actions on One2Many fields. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Odoo by default support: + +:: + + + +with this module you can: + +:: + + + +It works in any tree view, so you can use it in One2many. + +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 +~~~~~~~ + +* Cristian Salamea + +Contributors +~~~~~~~~~~~~ + +* Cristian Salamea +* André Paramés (https://www.acsone.eu/) +* Alexandre Díaz +* Sudhir Arya +* Jasper Jumelet +* `Trobz `_: + * Nguyễn Minh Chiến + +Other credits +~~~~~~~~~~~~~ + +The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/__init__.py b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/__manifest__.py b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/__manifest__.py new file mode 100644 index 0000000..1eee3d4 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/__manifest__.py @@ -0,0 +1,16 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "web_action_conditionable", + "version": "16.0.1.0.0", + "depends": ["base", "web"], + "data": [], + "author": "Cristian Salamea,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "license": "AGPL-3", + "assets": { + "web.assets_backend": [ + "web_action_conditionable/static/src/components/*", + ], + }, + "installable": True, +} diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/es.po b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/es.po new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/hr.po b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/hr.po new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/it.po b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/it.po new file mode 100644 index 0000000..7338855 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/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/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/web_action_conditionable.pot b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/web_action_conditionable.pot new file mode 100644 index 0000000..78d58d5 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/web_action_conditionable.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 16.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/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/zh_CN.po b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/i18n/zh_CN.po new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..2006ed4 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Cristian Salamea +* André Paramés (https://www.acsone.eu/) +* Alexandre Díaz +* Sudhir Arya +* Jasper Jumelet +* `Trobz `_: + * Nguyễn Minh Chiến diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/CREDITS.rst b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/CREDITS.rst new file mode 100644 index 0000000..70bc307 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/CREDITS.rst @@ -0,0 +1 @@ +The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/DESCRIPTION.rst new file mode 100644 index 0000000..c788d29 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Add support for conditions on create and delete actions on One2Many fields. diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/USAGE.rst b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/USAGE.rst new file mode 100644 index 0000000..8c56b16 --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/readme/USAGE.rst @@ -0,0 +1,13 @@ +Odoo by default support: + +:: + + + +with this module you can: + +:: + + + +It works in any tree view, so you can use it in One2many. diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/description/icon.png b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/description/index.html b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/description/index.html new file mode 100644 index 0000000..ba26bcb --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/description/index.html @@ -0,0 +1,451 @@ + + + + + + +web_action_conditionable + + + +
+

web_action_conditionable

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

Add support for conditions on create and delete actions on One2Many fields.

+

Table of contents

+ +
+

Usage

+

Odoo by default support:

+
+<tree delete="false" create="false">
+
+

with this module you can:

+
+<tree delete="state=='draft'" create="state!='sent'">
+
+

It works in any tree view, so you can use it in One2many.

+
+
+

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

+
    +
  • Cristian Salamea
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp

+
+
+

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.

+

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/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/src/components/field_one2many.esm.js b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/src/components/field_one2many.esm.js new file mode 100644 index 0000000..4d5da3a --- /dev/null +++ b/odoo-bringout-oca-web-web_action_conditionable/web_action_conditionable/static/src/components/field_one2many.esm.js @@ -0,0 +1,37 @@ +/** @odoo-module **/ +import {X2ManyField} from "@web/views/fields/x2many/x2many_field"; +import {XMLParser} from "@web/core/utils/xml"; +import {evaluateExpr} from "@web/core/py_js/py"; +import {patch} from "@web/core/utils/patch"; + +patch(X2ManyField.prototype, "web_action_conditionable_FieldOne2Many", { + get rendererProps() { + this.updateActiveActions(); + return this._super(...arguments); + }, + updateActiveActions() { + if (this.viewMode === "list" && this.activeActions.type === "one2many") { + const self = this; + const parser = new XMLParser(); + const archInfo = this.activeField.views[this.viewMode]; + const xmlDoc = parser.parseXML(archInfo.__rawArch); + ["create", "delete"].forEach(function (item) { + if (self.activeActions[item] && _.has(xmlDoc.attributes, item)) { + const expr = xmlDoc.getAttribute(item); + try { + self.activeActions[item] = evaluateExpr( + expr, + self.props.record.data + ); + } catch (ignored) { + console.log( + "[web_action_conditionable] unrecognized expr '" + + expr + + "', ignoring" + ); + } + } + }); + } + }, +}); diff --git a/odoo-bringout-oca-web-web_advanced_search/README.md b/odoo-bringout-oca-web-web_advanced_search/README.md new file mode 100644 index 0000000..eb90fbc --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/README.md @@ -0,0 +1,46 @@ +# Advanced search + +Odoo addon: web_advanced_search + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_advanced_search +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Advanced search +- **Version**: 16.0.1.0.6 +- **Category**: Usability +- **License**: AGPL-3 +- **Installable**: False + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_advanced_search`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_advanced_search/doc/ARCHITECTURE.md new file mode 100644 index 0000000..769d1cd --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_advanced_search Module - web_advanced_search + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_advanced_search/doc/CONFIGURATION.md new file mode 100644 index 0000000..2202440 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_advanced_search. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_advanced_search/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_advanced_search/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/FAQ.md b/odoo-bringout-oca-web-web_advanced_search/doc/FAQ.md new file mode 100644 index 0000000..19e468f --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_advanced_search or install in UI. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/INSTALL.md b/odoo-bringout-oca-web-web_advanced_search/doc/INSTALL.md new file mode 100644 index 0000000..e5e53e6 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_advanced_search" +# or +uv pip install odoo-bringout-oca-web-web_advanced_search" +``` diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/MODELS.md b/odoo-bringout-oca-web-web_advanced_search/doc/MODELS.md new file mode 100644 index 0000000..9a50cf7 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/MODELS.md @@ -0,0 +1,11 @@ +# Models + +Detected core models and extensions in web_advanced_search. + +```mermaid +classDiagram +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_advanced_search/doc/OVERVIEW.md new file mode 100644 index 0000000..baf0534 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_advanced_search. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_advanced_search +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/REPORTS.md b/odoo-bringout-oca-web-web_advanced_search/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/SECURITY.md b/odoo-bringout-oca-web-web_advanced_search/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_advanced_search/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/USAGE.md b/odoo-bringout-oca-web-web_advanced_search/doc/USAGE.md new file mode 100644 index 0000000..da3c454 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_advanced_search +``` diff --git a/odoo-bringout-oca-web-web_advanced_search/doc/WIZARDS.md b/odoo-bringout-oca-web-web_advanced_search/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_advanced_search/pyproject.toml b/odoo-bringout-oca-web-web_advanced_search/pyproject.toml new file mode 100644 index 0000000..205e7a3 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_advanced_search" +version = "16.0.0" +description = "Advanced search - Easier and more powerful searching tools" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_advanced_search"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/README.rst b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/README.rst new file mode 100644 index 0000000..c0d8bcb --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/README.rst @@ -0,0 +1,193 @@ +=============== +Advanced search +=============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:65c79a6f6afe59fa74b84abd881a95cb2ab25a8f4adcbf84af205873d9302d23 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_advanced_search + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_advanced_search + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +More powerful and easy to use search, especially for related fields. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +* Open *Filters* in a search view +* Select any relational field +* Select operator `is equal to` or `is not equal to` +* The text field changes to a relational selection field where you + can search for the record in question +* Click *Apply* + +To search for properties of linked records (ie invoices for customers +with a credit limit higher than X): + +* Open *Filters* in a search view +* Select *Add Advanced Filter* +* Edit the advanced filter +* Click *Save* + +Note that you can stack searching for properties: Simply add another +advanced search in the selection search window. You can do +this indefinetely, so it is possible to search for moves belonging +to a journal which has a user who is member of a certain group etc. + +Note also the domain dialog offers an editable preview in debug mode: + .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_advanced_search/static/img/debug_mode.png + +Known issues / Roadmap +====================== + +Improvements to the ``domain`` widget, not exclusively related to this addon: + +* Use relational widgets when filtering a relational field +* Allow to filter field names + +Improvements to the search view in this addon: + +* Use widgets ``one2many_tags`` when searching ``one2many`` fields +* Use widgets ``many2many_tags`` when searching ``many2many`` fields +* Allow to edit current full search using the advanced domain editor + +Issues: + +* Grouped totals can show incorrect values. See https://github.com/odoo/odoo/issues/47950 + +Changelog +========= + +11.0.1.0.2 (2018-10-31) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Fix initialization of 1st domain node + + Sometime the dialog is not ready yet, like on EE version. + Hence when you inject the 1st domain node + the dialog must be already opened. + + [simahawk] + + +11.0.1.0.1 (2018-09-18) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Fix `undefined` in x2m fields + + Before this patch, when searching with the "equals to" operator in any + x2many field, the searched parameter was always `undefined`. + + The problem was that the underlying field manager implementation was + treating those fields as x2many, while the widget used was the `one2many` + one. + + This patch simply mocks the underlying fake record to make think that + any relational field is always a `one2many`. This sets all pieces in + place and makes the field manager work as expected, and thus you can + search as expected too. + +* Make linter happy + + [Yajo] + + +11.0.1.0.0 (2018-07-20) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Rename, refactor, migrate to v11 + + [Yajo] + +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 +~~~~~~~ + +* Therp BV +* Tecnativa +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn +* Rami Alwafaie +* Jose Mª Bernet +* Simone Orsi +* Dennis Sluijk +* `Tecnativa `_: + + * Vicent Cubells + * Jairo Llopis + * Alexandre Díaz + +* `DynApps NV `_: + + * Raf Ven + +* `Camptocamp `_ + + * Iván Todorovich + +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-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px + :target: https://github.com/ivantodorovich + :alt: ivantodorovich + +Current `maintainer `__: + +|maintainer-ivantodorovich| + +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/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/__init__.py b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/__manifest__.py b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/__manifest__.py new file mode 100644 index 0000000..09b8772 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2015 Therp BV +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2018 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Advanced search", + "summary": "Easier and more powerful searching tools", + "version": "16.0.1.0.6", + "author": "Therp BV, Tecnativa, Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "maintainers": ["ivantodorovich"], + "license": "AGPL-3", + "category": "Usability", + "depends": ["web"], + "assets": { + "web.assets_backend": [ + "web_advanced_search/static/src/js/**/*", + "web_advanced_search/static/src/legacy/**/*", + "web_advanced_search/static/src/search/**/*", + ] + }, +} diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/bs.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/bs.po new file mode 100644 index 0000000..fbb6ecf --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/bs.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " i " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " nije " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " ili " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Dodaj napredni filter" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "Domena nije postavljena ispravno" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "Greška sintakse" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/da.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/da.po new file mode 100644 index 0000000..83bdff0 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/da.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2018-09-01 05:03+0000\n" +"Last-Translator: Hans Henrik Gabelgaard \n" +"Language-Team: none\n" +"Language: da\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" +"X-Generator: Weblate 3.1.1\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Tilføj avanceret filter" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/de.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/de.po new file mode 100644 index 0000000..0787652 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/de.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# Rudolf Schnapka , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2023-06-20 11:09+0000\n" +"Last-Translator: Nils Coenen \n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " und " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " ist nicht " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " oder " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Erweitertes Filter hinzufügen" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" + +#~ msgid "is in selection" +#~ msgstr "Ist in Auswahl" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/es.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/es.po new file mode 100644 index 0000000..911dd33 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/es.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2023-09-02 20:35+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " y " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " no es " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " o " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Añadir un Filtro Avanzado" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" + +#~ msgid "is in selection" +#~ msgstr "está en la selección" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/fr.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/fr.po new file mode 100644 index 0000000..4546a73 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/fr.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2023-11-06 17:37+0000\n" +"Last-Translator: Rémi \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " et " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " n'est pas " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " ou " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Ajouter un filtre avancé" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" + +#~ msgid "is in selection" +#~ msgstr "parmi la sélection" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/hr.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/hr.po new file mode 100644 index 0000000..264805b --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/hr.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2024-12-12 11:06+0000\n" +"Last-Translator: vladimiruvid \n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " i " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " nije " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " ili " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Dodaj napredni filter" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "Domena nije postavljena ispravno" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "Greška sintakse" + +#~ msgid "is in selection" +#~ msgstr "je u odabiru" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/it.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/it.po new file mode 100644 index 0000000..6ca474b --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/it.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-10-17 15:06+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " e " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " non è " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " o " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Aggiungi Filtro Avanzato" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "Dominio formattato non correttamente" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "Errore di sintassi" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/nl.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/nl.po new file mode 100644 index 0000000..e068732 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/nl.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2023-08-07 16:10+0000\n" +"Last-Translator: \"Jan Tapper [Onestein]\" \n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " en " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " is niet " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " of " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Voeg Geavanceerde Filter Toe" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" + +#~ msgid "is in selection" +#~ msgstr "is in selectie" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/nl_NL.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/nl_NL.po new file mode 100644 index 0000000..8adcefc --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/nl_NL.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2023-05-05 11:22+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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" +"X-Generator: Weblate 4.14.1\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " en " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " is niet " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " of " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Voeg geavanceerde filter toe" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" + +#~ msgid "is in selection" +#~ msgstr "Is in selectie" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pl.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pl.po new file mode 100644 index 0000000..657f9f7 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pl.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-08-11 13:07+0000\n" +"Last-Translator: Jacek Michalski \n" +"Language-Team: none\n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " oraz " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " nie jest " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " lub " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Dodaj Filtr Zaawansowany" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pt.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pt.po new file mode 100644 index 0000000..4c604b4 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pt.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-08-12 11:44+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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" +"X-Generator: Weblate 3.7.1\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Adicionar Filtro Avançado" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pt_BR.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pt_BR.po new file mode 100644 index 0000000..972672a --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/pt_BR.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_x2x +# +# Translators: +# Rodrigo de Almeida Sottomaior Macedo , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2024-11-13 17:06+0000\n" +"Last-Translator: Rodrigo Sottomaior Macedo " +"\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" +"23907/pt_BR/)\n" +"Language: pt_BR\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" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " e " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " não é " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " ou " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Adicionar filtro avançado" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "Domínio não formado corretamente" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "Erro de sintaxe" + +#~ msgid "is in selection" +#~ msgstr "Está em seleção" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/tr.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/tr.po new file mode 100644 index 0000000..1317e59 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/tr.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-01-29 22:06+0000\n" +"Last-Translator: Ahmet Yiğit Budak \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" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr " ve " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr " değildir " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr " veya " + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "Gelişmiş Filtre Ekle" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "Filtre düzgün şekilde yazılmadı" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "Sözdizimi hatası" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/web_advanced_search.pot b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/web_advanced_search.pot new file mode 100644 index 0000000..3f892bc --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/web_advanced_search.pot @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/zh_CN.po b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/zh_CN.po new file mode 100644 index 0000000..352e965 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/i18n/zh_CN.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 12:52+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " and " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " is not " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 +#, python-format +msgid " or " +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 +#, python-format +msgid "Add Advanced Filter" +msgstr "添加高级过滤器" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Domain not properly formed" +msgstr "" + +#. module: web_advanced_search +#. odoo-javascript +#: code:addons/web_advanced_search/static/src/js/DomainSelector.esm.js:0 +#, python-format +msgid "Syntax error" +msgstr "" diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..07528e2 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/CONTRIBUTORS.rst @@ -0,0 +1,18 @@ +* Holger Brunn +* Rami Alwafaie +* Jose Mª Bernet +* Simone Orsi +* Dennis Sluijk +* `Tecnativa `_: + + * Vicent Cubells + * Jairo Llopis + * Alexandre Díaz + +* `DynApps NV `_: + + * Raf Ven + +* `Camptocamp `_ + + * Iván Todorovich diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/DESCRIPTION.rst new file mode 100644 index 0000000..bd4c29f --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +More powerful and easy to use search, especially for related fields. diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/HISTORY.rst b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/HISTORY.rst new file mode 100644 index 0000000..7b791ed --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/HISTORY.rst @@ -0,0 +1,40 @@ +11.0.1.0.2 (2018-10-31) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Fix initialization of 1st domain node + + Sometime the dialog is not ready yet, like on EE version. + Hence when you inject the 1st domain node + the dialog must be already opened. + + [simahawk] + + +11.0.1.0.1 (2018-09-18) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Fix `undefined` in x2m fields + + Before this patch, when searching with the "equals to" operator in any + x2many field, the searched parameter was always `undefined`. + + The problem was that the underlying field manager implementation was + treating those fields as x2many, while the widget used was the `one2many` + one. + + This patch simply mocks the underlying fake record to make think that + any relational field is always a `one2many`. This sets all pieces in + place and makes the field manager work as expected, and thus you can + search as expected too. + +* Make linter happy + + [Yajo] + + +11.0.1.0.0 (2018-07-20) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Rename, refactor, migrate to v11 + + [Yajo] diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/ROADMAP.rst b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/ROADMAP.rst new file mode 100644 index 0000000..b71b3c3 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/ROADMAP.rst @@ -0,0 +1,14 @@ +Improvements to the ``domain`` widget, not exclusively related to this addon: + +* Use relational widgets when filtering a relational field +* Allow to filter field names + +Improvements to the search view in this addon: + +* Use widgets ``one2many_tags`` when searching ``one2many`` fields +* Use widgets ``many2many_tags`` when searching ``many2many`` fields +* Allow to edit current full search using the advanced domain editor + +Issues: + +* Grouped totals can show incorrect values. See https://github.com/odoo/odoo/issues/47950 diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/USAGE.rst b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/USAGE.rst new file mode 100644 index 0000000..76f224a --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/readme/USAGE.rst @@ -0,0 +1,24 @@ +To use this module, you need to: + +* Open *Filters* in a search view +* Select any relational field +* Select operator `is equal to` or `is not equal to` +* The text field changes to a relational selection field where you + can search for the record in question +* Click *Apply* + +To search for properties of linked records (ie invoices for customers +with a credit limit higher than X): + +* Open *Filters* in a search view +* Select *Add Advanced Filter* +* Edit the advanced filter +* Click *Save* + +Note that you can stack searching for properties: Simply add another +advanced search in the selection search window. You can do +this indefinetely, so it is possible to search for moves belonging +to a journal which has a user who is member of a certain group etc. + +Note also the domain dialog offers an editable preview in debug mode: + .. image:: ../static/img/debug_mode.png diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/description/icon.png b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/description/icon.png new file mode 100644 index 0000000..1ab5d1e Binary files /dev/null and b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/description/index.html b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/description/index.html new file mode 100644 index 0000000..5408f24 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/description/index.html @@ -0,0 +1,551 @@ + + + + + +Advanced search + + + + + + diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/img/debug_mode.png b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/img/debug_mode.png new file mode 100644 index 0000000..e9a4b46 Binary files /dev/null and b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/img/debug_mode.png differ diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/DomainSelector.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/DomainSelector.esm.js new file mode 100644 index 0000000..1cf9ed9 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/DomainSelector.esm.js @@ -0,0 +1,57 @@ +/** @odoo-module **/ + +import {patch} from "@web/core/utils/patch"; +import {_t} from "web.core"; +import Domain from "web.Domain"; +import DomainSelector from "web.DomainSelector"; +import basic_fields from "web.basic_fields"; +/** + * The redraw in the Debug Field does not trigger correctly + * so we overwrite it with the v14 Version + * + */ +patch(DomainSelector.prototype, "web.DomainSelector", { + /** + * @override + */ + _onDebugInputChange(e) { + if (!$(".o_add_advanced_search").length) { + return this._super(...arguments); + } + const rawDomain = e.currentTarget.value; + try { + Domain.prototype.stringToArray(rawDomain); + } catch (err) { + // If there is a syntax error, just ignore the change + this.displayNotification({ + title: _t("Syntax error"), + message: _t("Domain not properly formed"), + type: "danger", + }); + return; + } + this._redraw(Domain.prototype.stringToArray(rawDomain)).then( + function () { + this.trigger_up("domain_changed", { + child: this, + alreadyRedrawn: true, + }); + }.bind(this) + ); + }, +}); + +patch(basic_fields.FieldDomain.prototype, "web.basic_fields", { + /** + * Odoo restricts re-rendering the domain from the debug editor for supposedly + * performance reasons. We didn't ever came up with those and in v17 it's supported + * in the new advanced search. + * @override + */ + // eslint-disable-next-line + _onDomainSelectorValueChange(event) { + this._super(...arguments); + // Deactivate all debug conditions that cripple the functionality + this.debugEdition = false; + }, +}); diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/RecordPicker.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/RecordPicker.esm.js new file mode 100644 index 0000000..fa725f6 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/RecordPicker.esm.js @@ -0,0 +1,202 @@ +/** @odoo-module **/ + +import BasicModel from "web.BasicModel"; +import {ComponentAdapter} from "web.OwlCompatibility"; +import {Dropdown} from "@web/core/dropdown/dropdown"; +import FieldManagerMixin from "web.FieldManagerMixin"; +import {FieldMany2One} from "web.relational_fields"; +import {SelectCreateDialog} from "web.view_dialogs"; +import {patch} from "@web/core/utils/patch"; +import {session} from "@web/session"; + +const {Component, xml} = owl; + +patch(Dropdown.prototype, "dropdown", { + onWindowClicked(ev) { + // This patch is created to prevent the closing of the Filter menu + // when a selection is made in the RecordPicker + if ($(ev.target.closest("ul.dropdown-menu")).attr("id") !== undefined) { + const dropdown = $("body > ul.dropdown-menu"); + for (let i = 0; i < dropdown.length; i++) { + if ( + $(ev.target.closest("ul.dropdown-menu")).attr("id") === + $(dropdown[i]).attr("id") + ) { + return; + } + } + } + this._super(ev); + }, +}); + +export const FakeMany2oneFieldWidget = FieldMany2One.extend(FieldManagerMixin, { + supportedFieldTypes: ["many2many", "many2one", "one2many"], + /** + * @override + */ + init: function (parent) { + this.componentAdapter = parent; + const options = this.componentAdapter.props.attrs; + // Create a dummy record with only a dummy m2o field to search on + const model = new BasicModel("dummy"); + const params = { + fieldNames: ["dummy"], + modelName: "dummy", + context: {}, + type: "record", + viewType: "default", + fieldsInfo: {default: {dummy: {}}}, + fields: { + dummy: { + string: options.string, + relation: options.model, + context: options.context, + domain: options.domain, + type: "many2one", + }, + }, + }; + // Emulate `model.load()`, without RPC-calling `default_get()` + this.dataPointID = model._makeDataPoint(params).id; + model.generateDefaultValues(this.dataPointID, {}); + this._super(this.componentAdapter, "dummy", this._get_record(model), { + mode: "edit", + attrs: { + options: { + no_create_edit: true, + no_create: true, + no_open: true, + no_quick_create: true, + }, + }, + }); + FieldManagerMixin.init.call(this, model); + }, + /** + * Get record + * + * @param {BasicModel} model + * @returns {String} + */ + _get_record: function (model) { + return model.get(this.dataPointID); + }, + /** + * @override + */ + _confirmChange: function (id, fields, event) { + this.componentAdapter.trigger("change", event.data.changes[fields[0]]); + this.dataPointID = id; + return this.reset(this._get_record(this.model), event); + }, + /** + * Stop propagation of the 'Search more..' dialog click event. + * Otherwise, the filter's dropdown will be closed after a selection. + * + * @override + */ + _searchCreatePopup: function (view, ids, context, dynamicFilters) { + const options = this._getSearchCreatePopupOptions( + view, + ids, + context, + dynamicFilters + ); + const dialog = new SelectCreateDialog( + this, + _.extend({}, this.nodeOptions, options) + ); + // Hack to stop click event propagation + dialog._opened.then(() => + dialog.$el + .get(0) + .addEventListener("click", (event) => event.stopPropagation()) + ); + return dialog.open(); + }, + _onFieldChanged: function (event) { + const self = this; + event.stopPropagation(); + if (event.data.changes.dummy.display_name === undefined) { + return this._rpc({ + model: this.field.relation, + method: "name_get", + args: [event.data.changes.dummy.id], + context: session.user_context, + }).then(function (result) { + event.data.changes.dummy.display_name = result[0][1]; + return ( + self + ._applyChanges( + event.data.dataPointID, + event.data.changes, + event + ) + // eslint-disable-next-line no-empty-function + .then(event.data.onSuccess || function () {}) + // eslint-disable-next-line no-empty-function + .guardedCatch(event.data.onFailure || function () {}) + ); + }); + } + return ( + this._applyChanges(event.data.dataPointID, event.data.changes, event) + // eslint-disable-next-line no-empty-function + .then(event.data.onSuccess || function () {}) + // eslint-disable-next-line no-empty-function + .guardedCatch(event.data.onFailure || function () {}) + ); + }, +}); + +export class FakeMany2oneFieldWidgetAdapter extends ComponentAdapter { + constructor() { + super(...arguments); + this.env = Component.env; + } + + renderWidget() { + this.widget._render(); + } + + get widgetArgs() { + if (this.props.widgetArgs) { + return this.props.widgetArgs; + } + return [this.props.attrs]; + } +} + +/** + * A record selector widget. + * + * Underneath, it implements and extends the `FieldManagerMixin`, and acts as if it + * were a reduced dummy controller. Some actions "mock" the underlying model, since + * sometimes we use a char widget to fill related fields (which is not supported by + * that widget), and fields need an underlying model implementation, which can only + * hold fake data, given a search view has no data on it by definition. + * + * @extends Component + */ +export class RecordPicker extends Component { + setup() { + this.attrs = { + string: this.props.string, + model: this.props.model, + domain: this.props.domain, + context: this.props.context, + }; + this.FakeMany2oneFieldWidget = FakeMany2oneFieldWidget; + } +} + +RecordPicker.template = xml` +
+ +
`; +RecordPicker.components = {FakeMany2oneFieldWidgetAdapter}; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/dropdown.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/dropdown.esm.js new file mode 100644 index 0000000..61758cf --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/dropdown.esm.js @@ -0,0 +1,21 @@ +/** @odoo-module **/ + +import {Dropdown} from "@web/core/dropdown/dropdown"; +import {patch} from "web.utils"; + +patch(Dropdown.prototype, "web.Dropdown", { + /** + * Our many2one widget in the filter menus has a dropdown that propagates some + * custom events through the bus to the search more pop-up. This is not replicable + * in core but we can simply cut it here + * @override + */ + onDropdownStateChanged(args) { + const direct_siblings = + args.emitter.rootRef.el.parentElement === this.rootRef.el.parentElement; + if (!direct_siblings && args.emitter.myActiveEl !== this.myActiveEl) { + return; + } + return this._super(...arguments); + }, +}); diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/utils.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/utils.esm.js new file mode 100644 index 0000000..f3f3d88 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/js/utils.esm.js @@ -0,0 +1,58 @@ +/** @odoo-module **/ +/* + Copyright 2018 Tecnativa - Jairo Llopis + Copyright 2020 Tecnativa - Alexandre Díaz + Copyright 2022 Camptocamp SA - Iván Todorovich + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +*/ + +import {_t} from "web.core"; +const JOIN_MAPPING = { + "&": _t(" and "), + "|": _t(" or "), + "!": _t(" is not "), +}; + +const HUMAN_DOMAIN_METHODS = { + DomainTree: function () { + const human_domains = []; + _.each(this.children, (child) => { + human_domains.push(HUMAN_DOMAIN_METHODS[child.template].apply(child)); + }); + return `(${human_domains.join(JOIN_MAPPING[this.operator])})`; + }, + + DomainSelector: function () { + const result = HUMAN_DOMAIN_METHODS.DomainTree.apply(this, arguments); + // Remove surrounding parenthesis + return result.slice(1, -1); + }, + + DomainLeaf: function () { + const chain = []; + let operator = this.operator_mapping[this.operator], + value = `"${this.value}"`; + // Humanize chain + const chain_splitted = this.chain.split("."); + const len = chain_splitted.length; + for (let x = 0; x < len; ++x) { + const element = chain_splitted[x]; + chain.push( + _.findWhere(this.fieldSelector.popover.pages[x], {name: element}) + .string || element + ); + } + // Special beautiness for some values + if (this.operator === "=" && _.isBoolean(this.value)) { + operator = this.operator_mapping[this.value ? "set" : "not set"]; + value = ""; + } else if (_.isArray(this.value)) { + value = `["${this.value.join('", "')}"]`; + } + return `${chain.join("→")} ${operator || this.operator} ${value}`.trim(); + }, +}; + +export function getHumanDomain(domainSelector) { + return HUMAN_DOMAIN_METHODS.DomainSelector.apply(domainSelector); +} diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/advanced_filter_item.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/advanced_filter_item.esm.js new file mode 100644 index 0000000..6dee0fc --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/advanced_filter_item.esm.js @@ -0,0 +1,59 @@ +/** @odoo-module **/ + +import Domain from "web.Domain"; +import DomainSelectorDialog from "web.DomainSelectorDialog"; +import config from "web.config"; +import {getHumanDomain} from "../../../js/utils.esm"; +import {standaloneAdapter} from "web.OwlCompatibility"; +import {useModel} from "web.Model"; +const {Component, useRef} = owl; + +class AdvancedFilterItem extends Component { + setup() { + this.itemRef = useRef("dropdown-item"); + this.model = useModel("searchModel"); + } + /** + * Prevent propagation of dropdown-item-selected event, so that it + * doesn't reach the FilterMenu onFilterSelected event handler. + */ + mounted() { + $(this.itemRef.el).on("dropdown-item-selected", (event) => + event.stopPropagation() + ); + } + /** + * Open advanced search dialog + * + * @returns {DomainSelectorDialog} The opened dialog itself. + */ + onClick() { + const adapterParent = standaloneAdapter({Component}); + const dialog = new DomainSelectorDialog( + adapterParent, + this.model.config.modelName, + "[]", + { + debugMode: config.isDebug(), + readonly: false, + } + ); + // Add 1st domain node by default + dialog.opened(() => dialog.domainSelector._onAddFirstButtonClick()); + // Configure handler + dialog.on("domain_selected", this, function (e) { + const preFilter = { + description: getHumanDomain(dialog.domainSelector), + domain: Domain.prototype.arrayToString(e.data.domain), + type: "filter", + }; + this.model.dispatch("createNewFilters", [preFilter]); + }); + return dialog.open(); + } +} + +AdvancedFilterItem.components = {AdvancedFilterItem}; + +AdvancedFilterItem.template = "web_advanced_search.AdvancedFilterItem"; +export default AdvancedFilterItem; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/custom_filter_item.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/custom_filter_item.esm.js new file mode 100644 index 0000000..2fb42f8 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/custom_filter_item.esm.js @@ -0,0 +1,95 @@ +/** @odoo-module **/ + +import CustomFilterItem from "web.CustomFilterItem"; +import {RecordPicker} from "../../../js/RecordPicker.esm"; +import {patch} from "@web/core/utils/patch"; + +/** + * Patches the CustomFilterItem for legacy widgets. + * + * Tree views still use this old legacy widget, so we need to patch it. + * This is likely to disappear in 17.0 + */ +patch(CustomFilterItem.prototype, "web_advanced_search.legacy.CustomFilterItem", { + /** + * Ideally we'd want this in setup, but CustomFilterItem does its initialization + * in the constructor, which can't be patched. + * + * Doing it here works just as well. + * + * @override + */ + async willStart() { + this.OPERATORS.relational = this.OPERATORS.char; + this.FIELD_TYPES.many2one = "relational"; + this.FIELD_TYPES.many2many = "relational"; + this.FIELD_TYPES.one2many = "relational"; + return this._super(...arguments); + }, + /** + * @override + */ + _setDefaultValue(condition) { + const res = this._super(...arguments); + const fieldType = this.fields[condition.field].type; + const genericType = this.FIELD_TYPES[fieldType]; + if (genericType === "relational") { + condition.value = 0; + condition.displayedValue = ""; + } + return res; + }, + /** + * Add displayed value to preFilters for "relational" types. + * + * @override + */ + onApply() { + // To avoid the complete override, we patch this.conditions.map() + const originalMapFn = this.conditions.map; + const self = this; + this.conditions.map = function () { + const preFilters = originalMapFn.apply(this, arguments); + for (const condition of this) { + const field = self.fields[condition.field]; + const type = self.FIELD_TYPES[field.type]; + if (type === "relational") { + const idx = this.indexOf(condition); + const preFilter = preFilters[idx]; + const operator = self.OPERATORS[type][condition.operator]; + const descriptionArray = [ + field.string, + operator.description, + `"${condition.displayedValue}"`, + ]; + preFilter.description = descriptionArray.join(" "); + } + } + return preFilters; + }; + const res = this._super(...arguments); + // Restore original map() + this.conditions.map = originalMapFn; + return res; + }, + /** + * @private + * @param {Object} condition + * @param {OwlEvent} ev + */ + onRelationalChanged(condition, ev) { + if (ev.detail) { + condition.value = ev.detail.id; + condition.displayedValue = ev.detail.display_name; + } + }, +}); + +patch(CustomFilterItem, "web_advanced_search.legacy.CustomFilterItem", { + components: { + ...CustomFilterItem.components, + RecordPicker, + }, +}); + +export default CustomFilterItem; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/filter_menu.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/filter_menu.esm.js new file mode 100644 index 0000000..e5b5a99 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/legacy/js/control_panel/filter_menu.esm.js @@ -0,0 +1,20 @@ +/** @odoo-module **/ + +import AdvancedFilterItem from "./advanced_filter_item.esm"; +import FilterMenu from "web.FilterMenu"; +import {patch} from "@web/core/utils/patch"; + +/** + * Patches the FilterMenu for legacy widgets. + * + * Tree views still use this old legacy widget, so we need to patch it. + * This is likely to disappear in 17.0 + */ +patch(FilterMenu, "web_advanced_search.legacy.FilterMenu", { + components: { + ...FilterMenu.components, + AdvancedFilterItem, + }, +}); + +export default FilterMenu; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.esm.js new file mode 100644 index 0000000..510ae0e --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.esm.js @@ -0,0 +1,57 @@ +/** @odoo-module **/ + +import Domain from "web.Domain"; +import DomainSelectorDialog from "web.DomainSelectorDialog"; +import config from "web.config"; +import {getHumanDomain} from "../../js/utils.esm"; +import {standaloneAdapter} from "web.OwlCompatibility"; +const {Component, useRef} = owl; + +class AdvancedFilterItem extends Component { + setup() { + this.itemRef = useRef("dropdown-item"); + } + /** + * Prevent propagation of dropdown-item-selected event, so that it + * doesn't reach the FilterMenu onFilterSelected event handler. + */ + mounted() { + $(this.itemRef.el).on("dropdown-item-selected", (event) => + event.stopPropagation() + ); + } + /** + * Open advanced search dialog + * + * @returns {DomainSelectorDialog} The opened dialog itself. + */ + onClick() { + const adapterParent = standaloneAdapter({Component}); + const dialog = new DomainSelectorDialog( + adapterParent, + this.env.searchModel.resModel, + "[]", + { + debugMode: config.isDebug(), + readonly: false, + } + ); + // Add 1st domain node by default + dialog.opened(() => dialog.domainSelector._onAddFirstButtonClick()); + // Configure handler + dialog.on("domain_selected", this, function (e) { + const preFilter = { + description: getHumanDomain(dialog.domainSelector), + domain: Domain.prototype.arrayToString(e.data.domain), + type: "filter", + }; + this.env.searchModel.createNewFilters([preFilter]); + }); + return dialog.open(); + } +} + +AdvancedFilterItem.components = {AdvancedFilterItem}; + +AdvancedFilterItem.template = "web_advanced_search.AdvancedFilterItem"; +export default AdvancedFilterItem; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml new file mode 100644 index 0000000..86559e7 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml @@ -0,0 +1,15 @@ + + + + + Add Advanced Filter + + diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/custom_filter_item.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/custom_filter_item.esm.js new file mode 100644 index 0000000..5049a23 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/custom_filter_item.esm.js @@ -0,0 +1,105 @@ +/** @odoo-module **/ + +import {CustomFilterItem} from "@web/search/filter_menu/custom_filter_item"; +import {RecordPicker} from "../../js/RecordPicker.esm"; +import {patch} from "@web/core/utils/patch"; + +/** + * Patches the CustomFilterItem for owl widgets. + */ +patch(CustomFilterItem.prototype, "web_advanced_search.CustomFilterItem", { + /** + * @override + */ + setup() { + this._super.apply(this, arguments); + this.OPERATORS.relational = this.OPERATORS.char; + this.FIELD_TYPES.many2one = "relational"; + this.FIELD_TYPES.many2many = "relational"; + this.FIELD_TYPES.one2many = "relational"; + }, + /** + * @override + */ + setDefaultValue(condition) { + const fieldType = this.fields[condition.field].type; + const genericType = this.FIELD_TYPES[fieldType]; + if (genericType === "relational") { + condition.value = 0; + condition.displayedValue = ""; + return; + } + return this._super.apply(this, arguments); + }, + /** + * Add displayed value to preFilters for "relational" types. + * + * @override + */ + onApply() { + // To avoid the complete override, we patch this.conditions.map() + const originalMapFn = this.conditions.map; + const self = this; + this.conditions.map = function () { + const preFilters = originalMapFn.apply(this, arguments); + for (const condition of this) { + const field = self.fields[condition.field]; + const type = self.FIELD_TYPES[field.type]; + if (type === "relational") { + const idx = this.indexOf(condition); + const preFilter = preFilters[idx]; + const operator = self.OPERATORS[type][condition.operator]; + if ( + ["=", "!="].includes(operator.symbol) && + operator.value === undefined + ) { + const descriptionArray = [ + field.string, + operator.description, + `"${condition.displayedValue}"`, + ]; + preFilter.description = descriptionArray.join(" "); + } + } + } + return preFilters; + }; + const res = this._super.apply(this, arguments); + // Restore original map() + this.conditions.map = originalMapFn; + return res; + }, + /** + * @private + * @param {Object} condition + * @param {OwlEvent} ev + */ + onRelationalChanged(condition, ev) { + if (ev.detail) { + condition.value = ev.detail.id; + condition.displayedValue = ev.detail.display_name; + } + }, + onValueChange(condition, ev) { + if (!ev.target.value) { + return this.setDefaultValue(condition); + } + const field = this.fields[condition.field]; + const type = this.FIELD_TYPES[field.type]; + if (type === "relational") { + condition.value = ev.target.value; + condition.displayedValue = ev.target.value; + } else { + this._super.apply(this, arguments); + } + }, +}); + +patch(CustomFilterItem, "web_advanced_search.CustomFilterItem", { + components: { + ...CustomFilterItem.components, + RecordPicker, + }, +}); + +export default CustomFilterItem; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/custom_filter_item.xml b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/custom_filter_item.xml new file mode 100644 index 0000000..285d6f8 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/custom_filter_item.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/filter_menu.esm.js b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/filter_menu.esm.js new file mode 100644 index 0000000..ea6d9bf --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/filter_menu.esm.js @@ -0,0 +1,16 @@ +/** @odoo-module **/ + +import AdvancedFilterItem from "./advanced_filter_item.esm"; +import {FilterMenu} from "@web/search/filter_menu/filter_menu"; +import {patch} from "@web/core/utils/patch"; +/** + * Patches the FilterMenu for owl widgets. + */ +patch(FilterMenu, "web_advanced_search.FilterMenu", { + components: { + ...FilterMenu.components, + AdvancedFilterItem, + }, +}); + +export default FilterMenu; diff --git a/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/filter_menu.xml b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/filter_menu.xml new file mode 100644 index 0000000..058a9b1 --- /dev/null +++ b/odoo-bringout-oca-web-web_advanced_search/web_advanced_search/static/src/search/filter_menu/filter_menu.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/odoo-bringout-oca-web-web_apply_field_style/README.md b/odoo-bringout-oca-web-web_apply_field_style/README.md new file mode 100644 index 0000000..514ecc5 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/README.md @@ -0,0 +1,46 @@ +# Apply Field Style + +Odoo addon: web_apply_field_style + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_apply_field_style +``` + +## Dependencies + +This addon depends on: +- base + +## Manifest Information + +- **Name**: Apply Field Style +- **Version**: 16.0.1.0.1 +- **Category**: web +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_apply_field_style`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_apply_field_style/doc/ARCHITECTURE.md new file mode 100644 index 0000000..11e1f34 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_apply_field_style Module - web_apply_field_style + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_apply_field_style/doc/CONFIGURATION.md new file mode 100644 index 0000000..154967d --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_apply_field_style. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_apply_field_style/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_apply_field_style/doc/DEPENDENCIES.md new file mode 100644 index 0000000..e3a0a5c --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- base diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/FAQ.md b/odoo-bringout-oca-web-web_apply_field_style/doc/FAQ.md new file mode 100644 index 0000000..03a7d95 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_apply_field_style or install in UI. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/INSTALL.md b/odoo-bringout-oca-web-web_apply_field_style/doc/INSTALL.md new file mode 100644 index 0000000..42259c0 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_apply_field_style" +# or +uv pip install odoo-bringout-oca-web-web_apply_field_style" +``` diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/MODELS.md b/odoo-bringout-oca-web-web_apply_field_style/doc/MODELS.md new file mode 100644 index 0000000..1750061 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/MODELS.md @@ -0,0 +1,12 @@ +# Models + +Detected core models and extensions in web_apply_field_style. + +```mermaid +classDiagram + class base +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_apply_field_style/doc/OVERVIEW.md new file mode 100644 index 0000000..f51c361 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_apply_field_style. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_apply_field_style +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/REPORTS.md b/odoo-bringout-oca-web-web_apply_field_style/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/SECURITY.md b/odoo-bringout-oca-web-web_apply_field_style/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_apply_field_style/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/USAGE.md b/odoo-bringout-oca-web-web_apply_field_style/doc/USAGE.md new file mode 100644 index 0000000..de9f22c --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_apply_field_style +``` diff --git a/odoo-bringout-oca-web-web_apply_field_style/doc/WIZARDS.md b/odoo-bringout-oca-web-web_apply_field_style/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_apply_field_style/pyproject.toml b/odoo-bringout-oca-web-web_apply_field_style/pyproject.toml new file mode 100644 index 0000000..a0c9dbb --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_apply_field_style" +version = "16.0.0" +description = "Apply Field Style - Apply css class style to fields from a dict parameters" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-base>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_apply_field_style"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/README.rst b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/README.rst new file mode 100644 index 0000000..069d871 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/README.rst @@ -0,0 +1,101 @@ +================= +Apply Field Style +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:38a4bb4c2b2b17a0055b08a8a192ba970bcc84eff7632e722687545c75251d72 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_apply_field_style + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_apply_field_style + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Allow to set an additional css class to fields in form view. + +Use case : you may highlight some fields for training purpose + +.. figure:: https://raw.githubusercontent.com/OCA/web/16.0/web_apply_field_style/static/description/demo.png + :alt: Colored fields + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Override _get_field_styles() with a dict of fields list per model + + +.. code-block:: python + + class Base(models.AbstractModel): + _inherit = "base" + + def _get_field_styles(self): + res = super()._get_field_styles() + res["product.product"] = { + "my-css-class1": ["field1", "field2"], + "my-css-class2": ["field3"], + } + return res + +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 +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* `Akretion `_: + * David BEAL + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/__init__.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/__init__.py new file mode 100644 index 0000000..ede0a44 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/__init__.py @@ -0,0 +1,6 @@ +from odoo.tools import config + +from . import models + +if not config.get("without_demo"): + from . import demo diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/__manifest__.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/__manifest__.py new file mode 100644 index 0000000..8fc1f04 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/__manifest__.py @@ -0,0 +1,15 @@ +{ + "name": "Apply Field Style", + "author": "Akretion,Odoo Community Association (OCA)", + "summary": "Apply css class style to fields from a dict parameters", + "version": "16.0.1.0.1", + "license": "AGPL-3", + "maintainer": ["bealdav"], + "website": "https://github.com/OCA/web", + "category": "web", + "depends": [ + "base", + ], + "data": [], + "installable": True, +} diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/demo/__init__.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/demo/__init__.py new file mode 100644 index 0000000..0e44449 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/demo/__init__.py @@ -0,0 +1 @@ +from . import base diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/demo/base.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/demo/base.py new file mode 100644 index 0000000..d334d21 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/demo/base.py @@ -0,0 +1,30 @@ +# © 2023 David BEAL @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + +# R8180 rule asks for merging demo/base.py and models/base.py content +# We need to keep these class separated because of demo mode. +# pylint: disable=R8180 + + +class Base(models.AbstractModel): + _inherit = "base" + + def _get_field_styles(self): + res = super()._get_field_styles() + style = self.env.context.get("style") + if style == "nice": + # only this entry is correct + res["res.users"] = { + "bg-info": ["login", "type"], + "bg-warning": ["partner_id"], + } + elif style == "no_dict": + res = "any" + elif style == "no_field_list": + res["res.users"] = {"bg-info": "any"} + elif style == "empty_dict": + res["res.users"] = {} + elif style == "no_style": + res["res.users"] = False + return res diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/bs.po b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/bs.po new file mode 100644 index 0000000..52e7b30 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/bs.po @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_apply_field_style +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_apply_field_style +#: model:ir.model,name:web_apply_field_style.model_base +msgid "Base" +msgstr "Osnova" diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/es.po b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/es.po new file mode 100644 index 0000000..5a4421f --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/es.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_apply_field_style +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-07 22:34+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_apply_field_style +#: model:ir.model,name:web_apply_field_style.model_base +msgid "Base" +msgstr "Base" diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/it.po b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/it.po new file mode 100644 index 0000000..507670e --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/it.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_apply_field_style +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:37+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_apply_field_style +#: model:ir.model,name:web_apply_field_style.model_base +msgid "Base" +msgstr "Base" diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/web_apply_field_style.pot b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/web_apply_field_style.pot new file mode 100644 index 0000000..5ed225b --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/i18n/web_apply_field_style.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_apply_field_style +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_apply_field_style +#: model:ir.model,name:web_apply_field_style.model_base +msgid "Base" +msgstr "" diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/models/__init__.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/models/__init__.py new file mode 100644 index 0000000..0e44449 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/models/__init__.py @@ -0,0 +1 @@ +from . import base diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/models/base.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/models/base.py new file mode 100644 index 0000000..9c6cf43 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/models/base.py @@ -0,0 +1,55 @@ +# © 2023 David BEAL @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging + +from odoo import api, exceptions, models + +logger = logging.getLogger(__name__) + + +class Base(models.AbstractModel): + _inherit = "base" + + @api.model + def _get_view(self, view_id=None, view_type="form", **options): + arch, view = super()._get_view(view_id, view_type, **options) + if view_type == "form": + self._update_css_class(arch) + return arch, view + + def _update_css_class(self, arch): + css = self._get_field_styles() + if css: + self._check_css_dict(css) + for style in css.get(self._name): + for field_name in css[self._name][style]: + for field in arch.xpath(f"//field[@name='{field_name}']"): + field.attrib[ + "class" + ] = f"{style} {field.attrib.get('class') or ''}".strip() + + def _get_field_styles(self): + """Inherit me with: + + res = super()._get_field_styles() + res.append({'my_model': {"css_class": ['field1', 'field2'], "bg-info": [...] }}) + return res + """ + return {} + + def _check_css_dict(self, css): + rtfm = "\n\nPlease have a look to the readme.\n\nThe rtfm team." + if not isinstance(css, dict): + raise exceptions.ValidationError( + f"_get_field_styles() should return a dict{rtfm}" + ) + model = self._name + if model in css: + if not isinstance(css[model], dict): + raise exceptions.ValidationError(f"{css[model]} should be a dict{rtfm}") + for vals in css[model].values(): + if not isinstance(vals, list): + raise exceptions.ValidationError( + f"{vals} should be a list of fields !{rtfm}" + ) diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/CONFIGURE.rst b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/CONFIGURE.rst new file mode 100644 index 0000000..675b211 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/CONFIGURE.rst @@ -0,0 +1,15 @@ +Override _get_field_styles() with a dict of fields list per model + + +.. code-block:: python + + class Base(models.AbstractModel): + _inherit = "base" + + def _get_field_styles(self): + res = super()._get_field_styles() + res["product.product"] = { + "my-css-class1": ["field1", "field2"], + "my-css-class2": ["field3"], + } + return res diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..957db5f --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* `Akretion `_: + * David BEAL diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/DESCRIPTION.rst new file mode 100644 index 0000000..7145b7c --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +Allow to set an additional css class to fields in form view. + +Use case : you may highlight some fields for training purpose + +.. figure:: ../static/description/demo.png + :alt: Colored fields diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/demo.png b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/demo.png new file mode 100644 index 0000000..27c2aaa Binary files /dev/null and b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/demo.png differ diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/icon.png b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/index.html b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/index.html new file mode 100644 index 0000000..3957d11 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/static/description/index.html @@ -0,0 +1,449 @@ + + + + + + +Apply Field Style + + + +
+

Apply Field Style

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

Allow to set an additional css class to fields in form view.

+

Use case : you may highlight some fields for training purpose

+
+Colored fields +
+

Table of contents

+ +
+

Configuration

+

Override _get_field_styles() with a dict of fields list per model

+
+class Base(models.AbstractModel):
+    _inherit = "base"
+
+    def _get_field_styles(self):
+        res = super()._get_field_styles()
+        res["product.product"] = {
+            "my-css-class1": ["field1", "field2"],
+            "my-css-class2": ["field3"],
+        }
+        return res
+
+
+
+

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

+
    +
  • Akretion
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/tests/__init__.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/tests/__init__.py new file mode 100644 index 0000000..d9b96c4 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/tests/test_module.py b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/tests/test_module.py new file mode 100644 index 0000000..1785212 --- /dev/null +++ b/odoo-bringout-oca-web-web_apply_field_style/web_apply_field_style/tests/test_module.py @@ -0,0 +1,54 @@ +# © 2023 David BEAL @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.exceptions import ValidationError +from odoo.tests import common + + +class Test(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.user_view = cls.env.ref("base.view_users_form") + + def test_nice(self): + arch, view = ( + self.env["res.users"] + .with_context(style="nice") + ._get_view(view_id=self.user_view.id) + ) + for field in arch.xpath("//field[@name='partner_id']"): + self.assertEqual(field.attrib.get("class"), "bg-warning") + + def test_no_dict(self): + with self.assertRaisesRegex(ValidationError, "_get_field_styles().*"): + arch, view = ( + self.env["res.users"] + .with_context(style="no_dict") + ._get_view(view_id=self.user_view.id) + ) + + def test_no_field_list(self): + with self.assertRaisesRegex(ValidationError, ".*should be a list of fields.*"): + arch, view = ( + self.env["res.users"] + .with_context(style="no_field_list") + ._get_view(view_id=self.user_view.id) + ) + + def test_empty_dict(self): + # No effect but no broken code + arch, view = ( + self.env["res.users"] + .with_context(style="empty_dict") + ._get_view(view_id=self.user_view.id) + ) + + def test_no_style(self): + with self.assertRaisesRegex(ValidationError, ".*should be a dict.*"): + arch, view = ( + self.env["res.users"] + .with_context(style="no_style") + ._get_view(view_id=self.user_view.id) + ) diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/README.md b/odoo-bringout-oca-web-web_calendar_slot_duration/README.md new file mode 100644 index 0000000..b5a70dd --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/README.md @@ -0,0 +1,46 @@ +# Calendar slot duration + +Odoo addon: web_calendar_slot_duration + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_calendar_slot_duration +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Calendar slot duration +- **Version**: 16.0.1.1.0 +- **Category**: Extra Tools +- **License**: LGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_calendar_slot_duration`. + +## License + +This package maintains the original LGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/ARCHITECTURE.md new file mode 100644 index 0000000..458d516 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_calendar_slot_duration Module - web_calendar_slot_duration + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/CONFIGURATION.md new file mode 100644 index 0000000..4524a6f --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_calendar_slot_duration. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/FAQ.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/FAQ.md new file mode 100644 index 0000000..b8a1ea7 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_calendar_slot_duration or install in UI. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/INSTALL.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/INSTALL.md new file mode 100644 index 0000000..b019310 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_calendar_slot_duration" +# or +uv pip install odoo-bringout-oca-web-web_calendar_slot_duration" +``` diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/MODELS.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/MODELS.md new file mode 100644 index 0000000..df5029f --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/MODELS.md @@ -0,0 +1,11 @@ +# Models + +Detected core models and extensions in web_calendar_slot_duration. + +```mermaid +classDiagram +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/OVERVIEW.md new file mode 100644 index 0000000..195d9df --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_calendar_slot_duration. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_calendar_slot_duration +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/REPORTS.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/SECURITY.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/USAGE.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/USAGE.md new file mode 100644 index 0000000..4a1c17d --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_calendar_slot_duration +``` diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/doc/WIZARDS.md b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/pyproject.toml b/odoo-bringout-oca-web-web_calendar_slot_duration/pyproject.toml new file mode 100644 index 0000000..cf377c8 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_calendar_slot_duration" +version = "16.0.0" +description = "Calendar slot duration - Customizable calendar slot durations" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_calendar_slot_duration"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/README.rst b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/README.rst new file mode 100644 index 0000000..3619975 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/README.rst @@ -0,0 +1,124 @@ +====================== +Calendar slot duration +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3a39a33ad7a9a5a3673b1461fb0f8651e690a8437512f2a9c58b6614319fe3af + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/licence-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/16.0/web_calendar_slot_duration + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_calendar_slot_duration + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of backend calendars to support custom +slot durations and to allow you to provide more specific UX regarding event +duration and snapping. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +This documentation is for developers. + +If you want to configure your calendar view's snap duration, make sure that you +action includes a context similar to this (example is the default value):: + + {"calendar_slot_duration": "00:30:00"} + +In addition, you can also configure the calendar view's default mode by adding:: + + {"calendar_slot_duration": "00:30:00", "keep_default_view_slot_duration": True} + +The ``keep_default_view_slot_duration`` key is optional and defaults to ``False``. +When set to ``True``, the calendar view will not adapt its view to the slot size. + +For example, if you want to set the default slot duration to 1 hour and 30 minutes, +by default the calendar view will adapt its view to show slots of 1 hour and 30 minutes. +Sometimes this is not desired, for example when you want to show every time slots by hour. + +It can be added in actions defined on python or as ``ir.actions.act_window`` +records. + +Usage +===== + +To use this module, you need to install some other addon that uses it, as it +doesn't provide any end-user functionality. + +Known issues / Roadmap +====================== + +* Drop module if/when https://github.com/odoo/odoo/pull/66739 is merged. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Jairo Llopis + * Stefan Ungureanu + +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 + +Current `maintainer `__: + +|maintainer-Yajo| + +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/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/__init__.py b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/__manifest__.py b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/__manifest__.py new file mode 100644 index 0000000..ec43d98 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 Tecnativa - Jairo Llopis +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Calendar slot duration", + "summary": "Customizable calendar slot durations", + "version": "16.0.1.1.0", + "development_status": "Production/Stable", + "category": "Extra Tools", + "website": "https://github.com/OCA/web", + "author": "Tecnativa, Odoo Community Association (OCA)", + "maintainers": ["Yajo"], + "license": "LGPL-3", + "application": False, + "installable": True, + "assets": { + "web.assets_backend": [ + "web_calendar_slot_duration/static/src/js/calendar_common_renderer.esm.js", + "web_calendar_slot_duration/static/src/js/calendar_model.esm.js", + ] + }, + "depends": ["web"], +} diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/de.po b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/de.po new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/it.po b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/it.po new file mode 100644 index 0000000..7338855 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/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/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/pt_BR.po b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/pt_BR.po new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/web_calendar_slot_duration.pot b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/web_calendar_slot_duration.pot new file mode 100644 index 0000000..78d58d5 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/i18n/web_calendar_slot_duration.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 16.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/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/CONFIGURE.rst b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/CONFIGURE.rst new file mode 100644 index 0000000..afb1c2d --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/CONFIGURE.rst @@ -0,0 +1,20 @@ +This documentation is for developers. + +If you want to configure your calendar view's snap duration, make sure that you +action includes a context similar to this (example is the default value):: + + {"calendar_slot_duration": "00:30:00"} + +In addition, you can also configure the calendar view's default mode by adding:: + + {"calendar_slot_duration": "00:30:00", "keep_default_view_slot_duration": True} + +The ``keep_default_view_slot_duration`` key is optional and defaults to ``False``. +When set to ``True``, the calendar view will not adapt its view to the slot size. + +For example, if you want to set the default slot duration to 1 hour and 30 minutes, +by default the calendar view will adapt its view to show slots of 1 hour and 30 minutes. +Sometimes this is not desired, for example when you want to show every time slots by hour. + +It can be added in actions defined on python or as ``ir.actions.act_window`` +records. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..bdf9d22 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Jairo Llopis + * Stefan Ungureanu diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/DESCRIPTION.rst new file mode 100644 index 0000000..e0bcd77 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module extends the functionality of backend calendars to support custom +slot durations and to allow you to provide more specific UX regarding event +duration and snapping. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/ROADMAP.rst b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/ROADMAP.rst new file mode 100644 index 0000000..da9d2d7 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Drop module if/when https://github.com/odoo/odoo/pull/66739 is merged. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/USAGE.rst b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/USAGE.rst new file mode 100644 index 0000000..f8d0bc6 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/readme/USAGE.rst @@ -0,0 +1,2 @@ +To use this module, you need to install some other addon that uses it, as it +doesn't provide any end-user functionality. diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/description/icon.png b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/description/index.html b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/description/index.html new file mode 100644 index 0000000..d6072c9 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/description/index.html @@ -0,0 +1,465 @@ + + + + + +Calendar slot duration + + + +
+

Calendar slot duration

+ + +

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

+

This module extends the functionality of backend calendars to support custom +slot durations and to allow you to provide more specific UX regarding event +duration and snapping.

+

Table of contents

+ +
+

Configuration

+

This documentation is for developers.

+

If you want to configure your calendar view’s snap duration, make sure that you +action includes a context similar to this (example is the default value):

+
+{"calendar_slot_duration": "00:30:00"}
+
+

In addition, you can also configure the calendar view’s default mode by adding:

+
+{"calendar_slot_duration": "00:30:00", "keep_default_view_slot_duration": True}
+
+

The keep_default_view_slot_duration key is optional and defaults to False. +When set to True, the calendar view will not adapt its view to the slot size.

+

For example, if you want to set the default slot duration to 1 hour and 30 minutes, +by default the calendar view will adapt its view to show slots of 1 hour and 30 minutes. +Sometimes this is not desired, for example when you want to show every time slots by hour.

+

It can be added in actions defined on python or as ir.actions.act_window +records.

+
+
+

Usage

+

To use this module, you need to install some other addon that uses it, as it +doesn’t provide any end-user functionality.

+
+
+

Known issues / Roadmap

+ +
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Jairo Llopis
    • +
    • Stefan Ungureanu
    • +
    +
  • +
+
+
+

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 maintainer:

+

Yajo

+

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/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/src/js/calendar_common_renderer.esm.js b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/src/js/calendar_common_renderer.esm.js new file mode 100644 index 0000000..23ff9b0 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/src/js/calendar_common_renderer.esm.js @@ -0,0 +1,24 @@ +/** @odoo-module **/ +/* Copyright 2023 Tecnativa - Stefan Ungureanu + * License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ + +import {CalendarCommonRenderer} from "@web/views/calendar/calendar_common/calendar_common_renderer"; +import {patch} from "@web/core/utils/patch"; + +patch( + CalendarCommonRenderer.prototype, + "WebCalendarSlotDurationCalendarCommonRenderer", + { + get options() { + const options = this._super(...arguments); + if ( + this.env.searchModel.context.calendar_slot_duration && + !this.env.searchModel.context.keep_default_view_slot_duration + ) { + options.slotDuration = + this.env.searchModel.context.calendar_slot_duration; + } + return options; + }, + } +); diff --git a/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/src/js/calendar_model.esm.js b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/src/js/calendar_model.esm.js new file mode 100644 index 0000000..b8c5bf5 --- /dev/null +++ b/odoo-bringout-oca-web-web_calendar_slot_duration/web_calendar_slot_duration/static/src/js/calendar_model.esm.js @@ -0,0 +1,32 @@ +/** @odoo-module **/ +/* Copyright 2023 Tecnativa - Stefan Ungureanu + + * License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ + +import {CalendarModel} from "@web/views/calendar/calendar_model"; +import {patch} from "@web/core/utils/patch"; + +patch(CalendarModel.prototype, "WebCalendarSlotDurationCalendarModel", { + buildRawRecord(partialRecord, options = {}) { + if ( + !partialRecord.end && + this.env.searchModel.context.calendar_slot_duration && + !partialRecord.isAllDay + ) { + const slot_duration = this.env.searchModel.context.calendar_slot_duration; + const [hours, minutes, seconds] = slot_duration + .match(/(\d+):(\d+):(\d+)/) + .slice(1, 4); + // Convert all to float + // if we use a context like {'calendar_slot_duration': '01:30:00'} + // we will have on the backend a duration of 10 hour and 30 minutes + // instead of 1 hour and 30 minutes + const durationFloat = + parseFloat(hours) + + parseFloat(minutes) / 60 + + parseFloat(seconds) / 3600; + partialRecord.end = partialRecord.start.plus({hours: durationFloat}); + } + return this._super(partialRecord, options); + }, +}); diff --git a/odoo-bringout-oca-web-web_chatter_position/README.md b/odoo-bringout-oca-web-web_chatter_position/README.md new file mode 100644 index 0000000..2416b33 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/README.md @@ -0,0 +1,47 @@ +# Chatter Position + +Odoo addon: web_chatter_position + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_chatter_position +``` + +## Dependencies + +This addon depends on: +- web +- mail + +## Manifest Information + +- **Name**: Chatter Position +- **Version**: 16.0.1.0.3 +- **Category**: Extra Tools +- **License**: LGPL-3 +- **Installable**: False + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_chatter_position`. + +## License + +This package maintains the original LGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_chatter_position/doc/ARCHITECTURE.md new file mode 100644 index 0000000..c86008a --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_chatter_position Module - web_chatter_position + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_chatter_position/doc/CONFIGURATION.md new file mode 100644 index 0000000..fe7ac78 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_chatter_position. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_chatter_position/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_chatter_position/doc/DEPENDENCIES.md new file mode 100644 index 0000000..ff56486 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/DEPENDENCIES.md @@ -0,0 +1,6 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) +- [mail](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-mail) diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/FAQ.md b/odoo-bringout-oca-web-web_chatter_position/doc/FAQ.md new file mode 100644 index 0000000..f51c5d6 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_chatter_position or install in UI. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/INSTALL.md b/odoo-bringout-oca-web-web_chatter_position/doc/INSTALL.md new file mode 100644 index 0000000..8435483 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_chatter_position" +# or +uv pip install odoo-bringout-oca-web-web_chatter_position" +``` diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/MODELS.md b/odoo-bringout-oca-web-web_chatter_position/doc/MODELS.md new file mode 100644 index 0000000..8f58149 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/MODELS.md @@ -0,0 +1,12 @@ +# Models + +Detected core models and extensions in web_chatter_position. + +```mermaid +classDiagram + class res_users +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_chatter_position/doc/OVERVIEW.md new file mode 100644 index 0000000..3aa5e68 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_chatter_position. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_chatter_position +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/REPORTS.md b/odoo-bringout-oca-web-web_chatter_position/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/SECURITY.md b/odoo-bringout-oca-web-web_chatter_position/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_chatter_position/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/USAGE.md b/odoo-bringout-oca-web-web_chatter_position/doc/USAGE.md new file mode 100644 index 0000000..812f8a8 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_chatter_position +``` diff --git a/odoo-bringout-oca-web-web_chatter_position/doc/WIZARDS.md b/odoo-bringout-oca-web-web_chatter_position/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_chatter_position/pyproject.toml b/odoo-bringout-oca-web-web_chatter_position/pyproject.toml new file mode 100644 index 0000000..510ce90 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/pyproject.toml @@ -0,0 +1,43 @@ +[project] +name = "odoo-bringout-oca-web-web_chatter_position" +version = "16.0.0" +description = "Chatter Position - Add an option to change the chatter position" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "odoo-bringout-oca-ocb-mail>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_chatter_position"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/README.rst b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/README.rst new file mode 100644 index 0000000..07a5af3 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/README.rst @@ -0,0 +1,89 @@ +================ +Chatter Position +================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c91e4b816e6e16e912ca30c77aa434f57365780718ca011c8753d734d75a923b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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/16.0/web_chatter_position + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_chatter_position + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Configurable chatter position from the user preferences. + +Supports Both Community & Enterprise Edition. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +#. There's a **Chatter Position** option in **User Preferences**, where you can +choose between ``auto``, ``bottom`` and ``sided``. + +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 +~~~~~~~ + +* Hynsys Technologies +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Hynsys Technologies +* Juan Miguel Sánchez Arce +* `Camptocamp `_ + + * Iván Todorovich + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/__init__.py b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/__manifest__.py b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/__manifest__.py new file mode 100644 index 0000000..8a7f4c0 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2022 Hynsys Technologies +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +{ + "name": "Chatter Position", + "summary": "Add an option to change the chatter position", + "version": "16.0.1.0.3", + "author": "Hynsys Technologies, Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "license": "LGPL-3", + "category": "Extra Tools", + "depends": ["web", "mail"], + "data": ["views/res_users.xml", "views/web.xml"], + "assets": { + "web.assets_backend": [ + "/web_chatter_position/static/src/**/*.js", + ], + }, +} diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/bs.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/bs.po new file mode 100644 index 0000000..96ec57f --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/bs.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Na dnu" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Pozicija razgovora" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Responzivno" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Sa strane" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Korisnik" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/ca.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/ca.po new file mode 100644 index 0000000..32b1409 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/ca.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-20 12:34+0000\n" +"Last-Translator: pere-aquarian \n" +"Language-Team: none\n" +"Language: ca\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Abaix" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Posició del chatter" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Responsiu" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Al costat" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Usuari/ària" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/de.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/de.po new file mode 100644 index 0000000..2e8b93f --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/de.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-20 02:38+0000\n" +"Last-Translator: jappi00 \n" +"Language-Team: none\n" +"Language: de\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Unten" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Chatter-Position" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Responsiv" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Seitlich" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Benutzer" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/es.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/es.po new file mode 100644 index 0000000..b617d11 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/es.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-20 10:15+0000\n" +"Last-Translator: kikopeiro \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Abajo" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Posición del historial de comunicación" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Adaptativo" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Lateral" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Usuario" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/fr.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/fr.po new file mode 100644 index 0000000..3e1076c --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/fr.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-03-13 14:23+0000\n" +"Last-Translator: Rémi \n" +"Language-Team: none\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" +"X-Generator: Weblate 4.14.1\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "En bas" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Position du Chatter" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Automatique" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "A droite" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Utilisateur" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/hr.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/hr.po new file mode 100644 index 0000000..1cd0413 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/hr.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-04-03 13:22+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Na dnu" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Pozicija razgovora" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Responzivno" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Sa strane" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Korisnik" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/it.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/it.po new file mode 100644 index 0000000..512ec51 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/it.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:34+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "In basso" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Posizione conversazione" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Responsive" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Laterale" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Utente" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/nl.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/nl.po new file mode 100644 index 0000000..4754101 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/nl.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-08-07 16:10+0000\n" +"Last-Translator: \"Jan Tapper [Onestein]\" \n" +"Language-Team: none\n" +"Language: nl\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Onderkant" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Chatter-positie" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Snel reagerend" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Zijdelings" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Gebruiker" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/pt_BR.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/pt_BR.po new file mode 100644 index 0000000..ac311ba --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/pt_BR.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-11 14:37+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: none\n" +"Language: pt_BR\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Em Baixo" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Posição da Conversa" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Responsivo" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "Lateral" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Usuário" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/tr.po b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/tr.po new file mode 100644 index 0000000..82517e2 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/tr.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-03-06 20:08+0000\n" +"Last-Translator: Ediz Duman \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" +"X-Generator: Weblate 4.14.1\n" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "Alt" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "Sohbet Pozisyonu" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "Esnek" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "Kullanıcı" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/web_chatter_position.pot b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/web_chatter_position.pot new file mode 100644 index 0000000..4937f1d --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/i18n/web_chatter_position.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_chatter_position +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom +msgid "Bottom" +msgstr "" + +#. module: web_chatter_position +#: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position +msgid "Chatter Position" +msgstr "" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto +msgid "Responsive" +msgstr "" + +#. module: web_chatter_position +#: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided +msgid "Sided" +msgstr "" + +#. module: web_chatter_position +#: model:ir.model,name:web_chatter_position.model_res_users +msgid "User" +msgstr "" diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/migrations/16.0.1.0.3/post-migration.py b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/migrations/16.0.1.0.3/post-migration.py new file mode 100644 index 0000000..7faaafb --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/migrations/16.0.1.0.3/post-migration.py @@ -0,0 +1,21 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # Field 'chatter_position' was defined in module 'web_responsive' before it was + # moved to 'web_chatter_position'. In 'web_responsive' the allowed values have + # been ['normal', 'sided']. + # In case users installed 'web_chatter_position' along with 'web_responsive' field + # 'chatter_position' potentially was already in the db with old values, which are + # not supported. + # This migration covers this scenario by correcting unsupported values. + openupgrade.logged_query( + env.cr, + """ + UPDATE res_users + SET chatter_position = 'auto' + WHERE chatter_position = 'normal' + """, + ) diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/models/__init__.py b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/models/__init__.py new file mode 100644 index 0000000..8835165 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/models/__init__.py @@ -0,0 +1 @@ +from . import res_users diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/models/res_users.py b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/models/res_users.py new file mode 100644 index 0000000..3cfb7b7 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/models/res_users.py @@ -0,0 +1,25 @@ +# Copyright 2022 Hynsys Technologies +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class ResUsers(models.Model): + _inherit = "res.users" + + chatter_position = fields.Selection( + [ + ("auto", "Responsive"), + ("bottom", "Bottom"), + ("sided", "Sided"), + ], + default="auto", + ) + + @property + def SELF_READABLE_FIELDS(self): + return super().SELF_READABLE_FIELDS + ["chatter_position"] + + @property + def SELF_WRITEABLE_FIELDS(self): + return super().SELF_WRITEABLE_FIELDS + ["chatter_position"] diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..e0a264e --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Hynsys Technologies +* Juan Miguel Sánchez Arce +* `Camptocamp `_ + + * Iván Todorovich diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/DESCRIPTION.rst new file mode 100644 index 0000000..9c874e1 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +Configurable chatter position from the user preferences. + +Supports Both Community & Enterprise Edition. diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/USAGE.rst b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/USAGE.rst new file mode 100644 index 0000000..dd82654 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/readme/USAGE.rst @@ -0,0 +1,2 @@ +#. There's a **Chatter Position** option in **User Preferences**, where you can +choose between ``auto``, ``bottom`` and ``sided``. diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/description/icon.png b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/description/index.html b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/description/index.html new file mode 100644 index 0000000..45f1716 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +Chatter Position + + + +
+

Chatter Position

+ + +

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

+

Configurable chatter position from the user preferences.

+

Supports Both Community & Enterprise Edition.

+

Table of contents

+ +
+

Usage

+

#. There’s a Chatter Position option in User Preferences, where you can +choose between auto, bottom and sided.

+
+
+

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

+
    +
  • Hynsys Technologies
  • +
  • Camptocamp
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/src/js/web_chatter_position.esm.js b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/src/js/web_chatter_position.esm.js new file mode 100644 index 0000000..43425c1 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/static/src/js/web_chatter_position.esm.js @@ -0,0 +1,165 @@ +/** @odoo-module **/ +/* + Copyright 2023 Camptocamp SA (https://www.camptocamp.com). + License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +*/ + +import {FormCompiler} from "@web/views/form/form_compiler"; +import {FormController} from "@web/views/form/form_controller"; +import {MailFormCompiler} from "@mail/views/form/form_compiler"; +import {append} from "@web/core/utils/xml"; +import {patch} from "@web/core/utils/patch"; + +/** + * So, you've landed here and you have no idea what this is about. Don't worry, you're + * not the only one. Here's a quick summary of what's going on: + * + * In core, the chatter position depends on the size of the screen and wether there is + * an attachment viewer or not. There are 3 possible positions, and for each position a + * different chatter instance is displayed. + * + * So, in fact, we have 3 chatter instances running, and we switch their visibility + * depending on the desired position. + * + * A) Bottom position + * https://github.com/odoo/odoo/blob/2ef010907/addons/mail/static/src/views/form/form_compiler.js#L160 + * Condition: `!this.props.hasAttachmentViewer and uiService.size < ${SIZES.XXL}` + * + * This is the bottom position you would except. However it can only be there until + * XXL screen sizes, because the container is a flexbox and changes from row to + * column display. It's hidden in the presence of an attachment viewer. + * + * B) Bottom In-sheet position + * https://github.com/odoo/odoo/blob/2ef010907/addons/mail/static/src/views/form/form_compiler.js#L181 + * Condition: `this.props.hasAttachmentViewer` + * + * This is the bottom position that's used when there's an attachment viewer in place. + * It's rendered within the form sheet, possibly to by-pass the flexbox issue + * beforementioned. It's only instanciated when there's an attachment viewer. + * + * C) Sided position + * https://github.com/odoo/odoo/blob/2ef010907/addons/mail/static/src/views/form/form_compiler.js#L83 + * Condition: `!hasAttachmentViewer() and uiService.size >= ${SIZES.XXL}` + * + * This is the sided position, hidden in the presence of an attachment viewer. + * It's the better half of `A`. + * + * The patches and overrides you see below are here to alter these conditions to force + * a specific position regardless of the screen size, depending on an user setting. + */ + +patch(MailFormCompiler.prototype, "web_chatter_position", { + /** + * Patch the visibility of the Sided chatter (`C` above). + * + * @override + */ + compile() { + const res = this._super.apply(this, arguments); + const chatterContainerHookXml = res.querySelector( + ".o_FormRenderer_chatterContainer" + ); + if (!chatterContainerHookXml) { + return res; + } + // Don't patch anything if the setting is "auto": this is the core behaviour + if (odoo.web_chatter_position === "auto") { + return res; + } else if (odoo.web_chatter_position === "sided") { + chatterContainerHookXml.setAttribute("t-if", "!hasAttachmentViewer()"); + } else if (odoo.web_chatter_position === "bottom") { + chatterContainerHookXml.setAttribute("t-if", false); + } + return res; + }, +}); + +patch(FormCompiler.prototype, "web_chatter_position", { + /** + * Patch the css classes of the `Form`, to include an extra `h-100` class. + * Without it, the form sheet will not be full height in some situations, + * looking a bit weird. + * + * @override + */ + compileForm() { + const res = this._super.apply(this, arguments); + if (odoo.web_chatter_position === "sided") { + const classes = res.getAttribute("t-attf-class"); + res.setAttribute("t-attf-class", `${classes} h-100`); + } + return res; + }, + /** + * Patch the visibility of bottom chatters (`A` and `B` above). + * `B` may not exist in some situations, so we ensure it does by creating it. + * + * @override + */ + compile(node, params) { + const res = this._super.apply(this, arguments); + const chatterContainerHookXml = res.querySelector( + ".o_FormRenderer_chatterContainer:not(.o-isInFormSheetBg)" + ); + if (!chatterContainerHookXml) { + return res; + } + if (chatterContainerHookXml.parentNode.classList.contains("o_form_sheet")) { + return res; + } + // Don't patch anything if the setting is "auto": this is the core behaviour + if (odoo.web_chatter_position === "auto") { + return res; + // For "sided", we have to remote the bottom chatter + // (except if there is an attachment viewer, as we have to force bottom) + } else if (odoo.web_chatter_position === "sided") { + const formSheetBgXml = res.querySelector(".o_form_sheet_bg"); + if (!formSheetBgXml) { + return res; + } + chatterContainerHookXml.setAttribute("t-if", false); + // For "bottom", we keep the chatter in the form sheet + // (the one used for the attachment viewer case) + // If it's not there, we create it. + } else if (odoo.web_chatter_position === "bottom") { + if (params.hasAttachmentViewerInArch) { + const sheetBgChatterContainerHookXml = res.querySelector( + ".o_FormRenderer_chatterContainer.o-isInFormSheetBg" + ); + sheetBgChatterContainerHookXml.setAttribute("t-if", true); + chatterContainerHookXml.setAttribute("t-if", false); + } else { + const formSheetBgXml = res.querySelector(".o_form_sheet_bg"); + if (!formSheetBgXml) { + return res; + } + const sheetBgChatterContainerHookXml = + chatterContainerHookXml.cloneNode(true); + sheetBgChatterContainerHookXml.classList.add("o-isInFormSheetBg"); + sheetBgChatterContainerHookXml.setAttribute("t-if", true); + append(formSheetBgXml, sheetBgChatterContainerHookXml); + const sheetBgChatterContainerXml = + sheetBgChatterContainerHookXml.querySelector("ChatterContainer"); + sheetBgChatterContainerXml.setAttribute("isInFormSheetBg", "true"); + chatterContainerHookXml.setAttribute("t-if", false); + } + } + return res; + }, +}); + +patch(FormController.prototype, "web_chatter_position", { + /** + * Patch the css classes of the form container, to include an extra `flex-row` class. + * Without it, it'd go for flex columns direction and it won't look good. + * + * @override + */ + get className() { + const result = this._super(); + if (odoo.web_chatter_position === "sided") { + result["flex-row"] = true; + } + return result; + }, +}); diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/views/res_users.xml b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/views/res_users.xml new file mode 100644 index 0000000..0cf19ea --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/views/res_users.xml @@ -0,0 +1,12 @@ + + + + res.users + + + + + + + + diff --git a/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/views/web.xml b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/views/web.xml new file mode 100644 index 0000000..b65b4e1 --- /dev/null +++ b/odoo-bringout-oca-web-web_chatter_position/web_chatter_position/views/web.xml @@ -0,0 +1,12 @@ + + + + diff --git a/odoo-bringout-oca-web-web_company_color/README.md b/odoo-bringout-oca-web-web_company_color/README.md new file mode 100644 index 0000000..97b3a60 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/README.md @@ -0,0 +1,47 @@ +# Web Company Color + +Odoo addon: web_company_color + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_company_color +``` + +## Dependencies + +This addon depends on: +- web +- base_sparse_field + +## Manifest Information + +- **Name**: Web Company Color +- **Version**: 16.0.1.2.3 +- **Category**: web +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_company_color`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_company_color/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_company_color/doc/ARCHITECTURE.md new file mode 100644 index 0000000..8425043 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_company_color Module - web_company_color + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_company_color/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_company_color/doc/CONFIGURATION.md new file mode 100644 index 0000000..3608f9e --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_company_color. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_company_color/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_company_color/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_company_color/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_company_color/doc/DEPENDENCIES.md new file mode 100644 index 0000000..699a647 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/DEPENDENCIES.md @@ -0,0 +1,6 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) +- [base_sparse_field](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-base_sparse_field) diff --git a/odoo-bringout-oca-web-web_company_color/doc/FAQ.md b/odoo-bringout-oca-web-web_company_color/doc/FAQ.md new file mode 100644 index 0000000..53606ec --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_company_color or install in UI. diff --git a/odoo-bringout-oca-web-web_company_color/doc/INSTALL.md b/odoo-bringout-oca-web-web_company_color/doc/INSTALL.md new file mode 100644 index 0000000..1788e3c --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_company_color" +# or +uv pip install odoo-bringout-oca-web-web_company_color" +``` diff --git a/odoo-bringout-oca-web-web_company_color/doc/MODELS.md b/odoo-bringout-oca-web-web_company_color/doc/MODELS.md new file mode 100644 index 0000000..a4a118e --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/MODELS.md @@ -0,0 +1,13 @@ +# Models + +Detected core models and extensions in web_company_color. + +```mermaid +classDiagram + class ir_qweb + class res_company +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_company_color/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_company_color/doc/OVERVIEW.md new file mode 100644 index 0000000..33b9d91 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_company_color. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_company_color +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_company_color/doc/REPORTS.md b/odoo-bringout-oca-web-web_company_color/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_company_color/doc/SECURITY.md b/odoo-bringout-oca-web-web_company_color/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_company_color/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_company_color/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_company_color/doc/USAGE.md b/odoo-bringout-oca-web-web_company_color/doc/USAGE.md new file mode 100644 index 0000000..000d359 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_company_color +``` diff --git a/odoo-bringout-oca-web-web_company_color/doc/WIZARDS.md b/odoo-bringout-oca-web-web_company_color/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_company_color/pyproject.toml b/odoo-bringout-oca-web-web_company_color/pyproject.toml new file mode 100644 index 0000000..a7c5bdb --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/pyproject.toml @@ -0,0 +1,43 @@ +[project] +name = "odoo-bringout-oca-web-web_company_color" +version = "16.0.0" +description = "Web Company Color - Odoo addon" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "odoo-bringout-oca-web-base_sparse_field>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_company_color"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/README.rst b/odoo-bringout-oca-web-web_company_color/web_company_color/README.rst new file mode 100644 index 0000000..85b13a6 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/README.rst @@ -0,0 +1,98 @@ +================= +Web Company Color +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8a814ac88491029ca65ef378be730bd05a762604c5913f24f9cf1c6ea5b160cb + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_company_color + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_company_color + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module change navbar colors based in the company logo colors. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Go to company record and set a logo. Can see/modify applied colors on the "Navbar" section. + +For optimal results use images with alpha channel. + +Known issues / Roadmap +====================== + +White color is omitted in the addition operation to support images without alpha channel. + +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 +~~~~~~~ + +* Alexandre Díaz + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester Alomar (ForgeFlow) +* Lois Rilo (ForgeFlow) +* Simone Orsi +* Iván Antón +* Bernat Puig (ForgeFlow) +* Dhara Solanki +* `Tecnativa `_: + + * Jairo Llopis + * Alexandre Díaz + * Carlos Roca + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/__init__.py b/odoo-bringout-oca-web-web_company_color/web_company_color/__init__.py new file mode 100644 index 0000000..62048b1 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models +from .hooks import post_init_hook, uninstall_hook +from . import utils diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/__manifest__.py b/odoo-bringout-oca-web-web_company_color/web_company_color/__manifest__.py new file mode 100644 index 0000000..9b50bee --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/__manifest__.py @@ -0,0 +1,18 @@ +# Odoo, Open Source Web Company Color +# Copyright (C) 2019 Alexandre Díaz +# +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).# +{ + "name": "Web Company Color", + "category": "web", + "version": "16.0.1.2.3", + "author": "Alexandre Díaz, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "depends": ["web", "base_sparse_field"], + "data": ["view/assets.xml", "view/res_company.xml"], + "uninstall_hook": "uninstall_hook", + "post_init_hook": "post_init_hook", + "license": "AGPL-3", + "auto_install": False, + "installable": True, +} diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/hooks.py b/odoo-bringout-oca-web-web_company_color/web_company_color/hooks.py new file mode 100644 index 0000000..ca23677 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/hooks.py @@ -0,0 +1,15 @@ +# Copyright 2019 Alexandre Díaz +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import SUPERUSER_ID, api + +from .models.res_company import URL_BASE + + +def uninstall_hook(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + env["ir.attachment"].search([("url", "=like", "%s%%" % URL_BASE)]).unlink() + + +def post_init_hook(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + env["res.company"].search([]).scss_create_or_update_attachment() diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/bs.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/bs.po new file mode 100644 index 0000000..61a7706 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/bs.po @@ -0,0 +1,97 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please refresh\n" +" the page." +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "Boja Pozadine Dugmeta" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "Boja Pozadine Dugmeta Hover" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "Boja Teksta Dugmeta" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "Boje" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Tvrtke" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Boje tvrtke" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Stilovi tvrtke" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Izračunaj boje iz loga" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "Boja Teksta Linka" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "Boja Teksta Linka Hover" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Boja pozadine Navigacijske trake" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Poja pozadine navigacijske trake (hoover)" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Boja teksta navigacijske trake" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "SCSS Modif. Vremenski žig" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/ca.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/ca.po new file mode 100644 index 0000000..6ab993f --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/ca.po @@ -0,0 +1,101 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-11-18 17:36+0000\n" +"Last-Translator: Dept. Técnico \n" +"Language-Team: none\n" +"Language: ca\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Companyies" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/de.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/de.po new file mode 100644 index 0000000..e73a298 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/de.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-06-20 11:09+0000\n" +"Last-Translator: Nils Coenen \n" +"Language-Team: none\n" +"Language: de\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" +"\n" +" Damit die Änderungen wirksam werden, aktualisieren " +"Sie bitte\n" +" die Seite." + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Unternehmensfarben" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Unternehmensstile" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Farben aus Logo generieren" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Navbar-Hintergrundfarbe" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Navbar Hintergrundfarbe Hover" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Navbar Textfarbe" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "" + +#~ msgid "Navbar Colors" +#~ msgstr "Navbar-Farben" + +#~ msgid "" +#~ "\n" +#~ " In order for the changes to take effect, please " +#~ "refresh\n" +#~ " the page." +#~ msgstr "" +#~ "\n" +#~ " Damit die Änderungen wirksam werden, " +#~ "aktualisieren Sie bitte\n" +#~ " Sie die Seite." + +#~ msgid "Display Name" +#~ msgstr "Anzeigename" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Zuletzt bearbeitet am" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/es.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/es.po new file mode 100644 index 0000000..b4c7302 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/es.po @@ -0,0 +1,118 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-03-02 15:55+0000\n" +"PO-Revision-Date: 2023-11-07 22:38+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" +"\n" +" Para que los cambios surtan efecto, actualice\n" +" la página." + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "Color de Fondo del Botón" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "Color de fondo del Botón Hover" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "Color del Texto del Botón" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "Colores" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Colores de la compañía" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Estilos de compañía" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Calcular colores a partir del logo" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "Color del Texto del Enlace" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "Color del Texto del Enlace Hover" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Color de fondo de la barra de navegación" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Desplazamiento del color de fondo de la barra de navegación" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Color de texto de la barra de navegación" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "SCSS Modif. Marca de tiempo" + +#~ msgid "Navbar Colors" +#~ msgstr "Colores de la barra de navegación" + +#~ msgid "" +#~ "\n" +#~ " In order for the changes to take effect, please " +#~ "refresh\n" +#~ " the page." +#~ msgstr "" +#~ "\n" +#~ " Para que los cambios surtan efecto, actualice\n" +#~ " la página." diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/fr.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/fr.po new file mode 100644 index 0000000..2cc3062 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/fr.po @@ -0,0 +1,104 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-06 17:37+0000\n" +"Last-Translator: Rémi \n" +"Language-Team: none\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please refresh\n" +" the page." +msgstr "" +"\n" +" Pour que les modifications soient effectives, merci " +"d'actualiser\n" +" la page." + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "Couleur d'arrière-plan de bouton" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "Couleur d'arrière plan de bouton (survol)" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "Couleur du texte de bouton" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "Couleurs" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Couleurs de la société" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Styles de la société" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Déterminer les couleurs à partir du logo" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "Couleur du texte des liens" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "Couleur du texte des liens (survol)" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Couleur de fond de la barre de navigation" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Couleur de fond de la barre de navigation (survol)" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Couleur du texte de la barre de navigation" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "Heure de modification du SCSS" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/hr.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/hr.po new file mode 100644 index 0000000..a0f2a81 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/hr.po @@ -0,0 +1,115 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-18 14:34+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Tvrtke" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Boje tvrtke" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Stilovi tvrtke" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Boja pozadine Navigacijske trake" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Poja pozadine navigacijske trake (hoover)" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Boja teksta navigacijske trake" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "SCSS Modif. Vremenski žig" + +#~ msgid "Navbar Colors" +#~ msgstr "Boje navigacijske trake" + +#~ msgid "" +#~ "\n" +#~ " In order for the changes to take effect, please " +#~ "refresh\n" +#~ " the page." +#~ msgstr "" +#~ "\n" +#~ " Kako bi promjene postale vidljive, molimo \n" +#~ " učitajte ponovo ovu stranicu." diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/it.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/it.po new file mode 100644 index 0000000..d5ce4ad --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/it.po @@ -0,0 +1,117 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:33+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" +"\n" +" Affinché la modifica abbia effetto, ricaricare\n" +" la pagina." + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "Colore sfondo pulsante" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "Colore hover sfondo pulsante" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "Colore testo pulsante" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "Colori" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Colori Aziendali" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Stili Aziendali" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Calcola colori dal logo" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "Colore testo collegamento" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "Colore hover testo collegamento" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Sfondo Barra Navigazione" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Colore Hover Sfondo Barra Navigazione" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Colori Testo Barra Navigazione" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "Timestamp modifica SCSS" + +#~ msgid "Navbar Colors" +#~ msgstr "Colori Barra Navigazione" + +#~ msgid "" +#~ "\n" +#~ " In order for the changes to take effect, please " +#~ "refresh\n" +#~ " the page." +#~ msgstr "" +#~ "\n" +#~ " Perché i cambiamenti abbiano effetto, prego " +#~ "aggiornare la pagina." diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/nl.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/nl.po new file mode 100644 index 0000000..74af7db --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/nl.po @@ -0,0 +1,118 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-08-07 16:10+0000\n" +"Last-Translator: \"Jan Tapper [Onestein]\" \n" +"Language-Team: none\n" +"Language: nl\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" +"\n" +" Om de aanpassingen actief te maken, ververs " +"alstublieft\n" +" de pagina." + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Bedrijfskleuren" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Bedrijfsstijlen" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Genereer kleuren vanuit het logo" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Navigatiebalk Achtergrondkleur" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Navigatiebalk Achtergrondkleur (als je de muis er overheen beweegt)" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Navigatiebalk Tekstkleuren" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "" + +#~ msgid "Navbar Colors" +#~ msgstr "Navigatiebalk Kleuren" + +#~ msgid "" +#~ "\n" +#~ " In order for the changes to take effect, please " +#~ "refresh\n" +#~ " the page." +#~ msgstr "" +#~ "\n" +#~ " Ververs de pagina om de wijzigingen door te " +#~ "voeren." diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/pt.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/pt.po new file mode 100644 index 0000000..29faae2 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/pt.po @@ -0,0 +1,103 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-29 19:37+0000\n" +"Last-Translator: Peter Romão \n" +"Language-Team: none\n" +"Language: pt\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please refresh\n" +" the page." +msgstr "" +"\n" +" Para que as alterações entrem em vigor, atualize\n" +" a página." + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "Cor de Fundo dos Botões" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "Cor de Fundo de Botões com Foco" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "Cor do Texto do Botão" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "Cores" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "Empresas" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "Cores da Empresa" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "Estilos da Empresa" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "Calcular cores a partir do logotipo" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "Cor do Texto das Ligações" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "Cor do Texto das Ligações com Foco" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "Cor de Fundo da Barra de Navegação" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "Cor de Fundo da Barra de Navegação com Foco" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "Cor do Texto da Barra de Navegação" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "QWeb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "SCSS Modif. Timestamp" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/web_company_color.pot b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/web_company_color.pot new file mode 100644 index 0000000..1cd32a3 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/web_company_color.pot @@ -0,0 +1,97 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please refresh\n" +" the page." +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/zh_CN.po b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/zh_CN.po new file mode 100644 index 0000000..e0a98ca --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/i18n/zh_CN.po @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-07-08 05:19+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.10\n" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "" +"\n" +" In order for the changes to take effect, please " +"refresh\n" +" the page." +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg +msgid "Button Background Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover +msgid "Button Background Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text +msgid "Button Text Color" +msgstr "" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Colors" +msgstr "" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_res_company +msgid "Companies" +msgstr "公司" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors +msgid "Company Colors" +msgstr "公司颜色" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Company Styles" +msgstr "公司风格" + +#. module: web_company_color +#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form +msgid "Compute colors from logo" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text +msgid "Link Text Color" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover +msgid "Link Text Color Hover" +msgstr "" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg +msgid "Navbar Background Color" +msgstr "导航栏背景颜色" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover +msgid "Navbar Background Color Hover" +msgstr "导航栏鼠标悬停背景颜色" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text +msgid "Navbar Text Color" +msgstr "导航栏文字颜色" + +#. module: web_company_color +#: model:ir.model,name:web_company_color.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" + +#. module: web_company_color +#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp +msgid "SCSS Modif. Timestamp" +msgstr "SCSS修改时间戳" + +#~ msgid "Navbar Colors" +#~ msgstr "导航栏颜色" + +#~ msgid "" +#~ "\n" +#~ " In order for the changes to take effect, please " +#~ "refresh\n" +#~ " the page." +#~ msgstr "" +#~ "\n" +#~ " 为了使更改生效,请刷新\n" +#~ " 这个页面。" diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/migrations/16.0.1.2.1/post-migration.py b/odoo-bringout-oca-web-web_company_color/web_company_color/migrations/16.0.1.2.1/post-migration.py new file mode 100644 index 0000000..73b0a47 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/migrations/16.0.1.2.1/post-migration.py @@ -0,0 +1,9 @@ +# Copyright 2024 Tecnativa - Carlos Roca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + companies = env["res.company"].search([("company_colors", "!=", False)]) + companies.scss_create_or_update_attachment() diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/models/__init__.py b/odoo-bringout-oca-web-web_company_color/web_company_color/models/__init__.py new file mode 100644 index 0000000..8677b09 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import assetsbundle +from . import res_company +from . import ir_qweb diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/models/assetsbundle.py b/odoo-bringout-oca-web-web_company_color/web_company_color/models/assetsbundle.py new file mode 100644 index 0000000..aec3073 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/models/assetsbundle.py @@ -0,0 +1,22 @@ +# Copyright 2020 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.http import request + +from odoo.addons.base.models.assetsbundle import AssetsBundle, ScssStylesheetAsset + + +class AssetsBundleCompanyColor(AssetsBundle): + def get_company_color_asset_node(self): + """Process the user active company scss and returns the node to inject""" + try: + active_company_id = int( + request.httprequest.cookies.get("cids", "").split(",")[0] + ) + except Exception: + active_company_id = False + company_id = ( + self.env["res.company"].browse(active_company_id) or self.env.company + ) + asset = ScssStylesheetAsset(self, url=company_id.scss_get_url()) + compiled = self.compile_css(asset.compile, asset.get_source()) + return "style", {}, compiled diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/models/ir_qweb.py b/odoo-bringout-oca-web-web_company_color/web_company_color/models/ir_qweb.py new file mode 100644 index 0000000..944288c --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/models/ir_qweb.py @@ -0,0 +1,38 @@ +# Copyright 2020 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models + +from .assetsbundle import AssetsBundleCompanyColor + + +class QWeb(models.AbstractModel): + _inherit = "ir.qweb" + + def _generate_asset_nodes_cache( + self, + bundle, + css=True, + js=True, + debug=False, + async_load=False, + defer_load=False, + lazy_load=False, + media=None, + ): + res = super()._generate_asset_nodes( + bundle, css, js, debug, async_load, defer_load, lazy_load, media + ) + if bundle == "web_company_color.company_color_assets": + asset = AssetsBundleCompanyColor( + bundle, [], env=self.env, css=True, js=True + ) + res += [asset.get_company_color_asset_node()] + return res + + def _get_asset_content(self, bundle, defer_load=False, lazy_load=False, media=None): + """Handle 'special' web_company_color bundle""" + if bundle == "web_company_color.company_color_assets": + return [], [] + return super()._get_asset_content( + bundle, defer_load=defer_load, lazy_load=lazy_load, media=media + ) diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/models/res_company.py b/odoo-bringout-oca-web-web_company_color/web_company_color/models/res_company.py new file mode 100644 index 0000000..278e832 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/models/res_company.py @@ -0,0 +1,231 @@ +# Copyright 2019 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import base64 +from colorsys import hls_to_rgb, rgb_to_hls + +from odoo import api, fields, models + +from ..utils import convert_to_image, image_to_rgb, n_rgb_to_hex + +URL_BASE = "/web_company_color/static/src/scss/" +URL_SCSS_GEN_TEMPLATE = URL_BASE + "custom_colors.%d.gen.scss" + + +class ResCompany(models.Model): + _inherit = "res.company" + + SCSS_TEMPLATE = """ + .o_main_navbar { + background: %(color_navbar_bg)s !important; + background-color: %(color_navbar_bg)s !important; + color: %(color_navbar_text)s !important; + + > .o_menu_brand { + color: %(color_navbar_text)s !important; + &:hover, &:focus, &:active, &:focus:active { + background-color: %(color_navbar_bg_hover)s !important; + } + } + + .show { + .dropdown-toggle { + background-color: %(color_navbar_bg_hover)s !important; + } + } + + > ul { + > li { + > a, > label { + color: %(color_navbar_text)s !important; + + &:hover, &:focus, &:active, &:focus:active { + background-color: %(color_navbar_bg_hover)s !important; + } + } + } + } + } + + a[href], + a[tabindex], + .btn-link, + .o_external_button { + color: %(color_link_text)s; + .o_main_navbar { + color: none; + } + } + a:hover, + .btn-link:hover { + color: %(color_link_text_hover)s; + .o_main_navbar { + color: none; + } + } + .btn-primary:not(.disabled), + .ui-autocomplete .ui-menu-item > a.ui-state-active { + color: %(color_button_text)s !important; + background-color: %(color_button_bg)s !important; + border-color: %(color_button_bg)s !important; + } + .btn-primary:hover:not(.disabled), + .ui-autocomplete .ui-menu-item > a.ui-state-active:hover { + color: %(color_button_text)s !important; + background-color: %(color_button_bg_hover)s !important; + border-color: %(color_button_bg_hover)s !important; + } + .o_searchview .o_searchview_facet .o_searchview_facet_label { + color: %(color_button_text)s !important; + background-color: %(color_button_bg)s !important; + } + .o_form_view .o_horizontal_separator { + color: %(color_link_text)s !important; + } + .o_form_view .oe_button_box .oe_stat_button .o_button_icon, + .o_form_view .oe_button_box .oe_stat_button .o_stat_info .o_stat_value, + .o_form_view .oe_button_box .oe_stat_button > span .o_stat_value { + color: %(color_link_text)s !important; + } + .o_form_view .o_form_statusbar > .o_statusbar_status > + .o_arrow_button.btn-primary.disabled { + color: %(color_link_text)s !important; + } + .o_required_modifier{ + :focus-within { + --o-input-border-color: %(color_button_bg)s !important; + --o-caret-color: %(color_button_bg)s !important; + } + input:hover, .o_field_many2one_selection:hover { + --o-input-border-color: %(color_button_bg)s !important; + --o-caret-color: %(color_button_bg)s !important; + } + } + """ + + company_colors = fields.Serialized() + color_navbar_bg = fields.Char("Navbar Background Color", sparse="company_colors") + color_navbar_bg_hover = fields.Char( + "Navbar Background Color Hover", sparse="company_colors" + ) + color_navbar_text = fields.Char("Navbar Text Color", sparse="company_colors") + color_button_text = fields.Char("Button Text Color", sparse="company_colors") + color_button_bg = fields.Char("Button Background Color", sparse="company_colors") + color_button_bg_hover = fields.Char( + "Button Background Color Hover", sparse="company_colors" + ) + color_link_text = fields.Char("Link Text Color", sparse="company_colors") + color_link_text_hover = fields.Char( + "Link Text Color Hover", sparse="company_colors" + ) + scss_modif_timestamp = fields.Char("SCSS Modif. Timestamp") + + @api.model_create_multi + def create(self, vals_list): + records = super().create(vals_list) + records.scss_create_or_update_attachment() + return records + + def unlink(self): + IrAttachmentObj = self.env["ir.attachment"] + for record in self: + IrAttachmentObj.sudo().search( + [("url", "=", record.scss_get_url()), ("company_id", "=", record.id)] + ).sudo().unlink() + return super().unlink() + + def write(self, values): + if not self.env.context.get("ignore_company_color", False): + fields_to_check = ( + "color_navbar_bg", + "color_navbar_bg_hover", + "color_navbar_text", + "color_button_bg", + "color_button_bg_hover", + "color_button_text", + "color_link_text", + "color_link_text_hover", + ) + result = super().write(values) + if any([field in values for field in fields_to_check]): + self.scss_create_or_update_attachment() + else: + result = super().write(values) + return result + + def button_compute_color(self): + self.ensure_one() + values = self.default_get( + ["color_navbar_bg", "color_navbar_bg_hover", "color_navbar_text"] + ) + if self.logo: + _r, _g, _b = image_to_rgb(convert_to_image(self.logo)) + # Make color 10% darker + _h, _l, _s = rgb_to_hls(_r, _g, _b) + _l = max(0, _l - 0.1) + _rd, _gd, _bd = hls_to_rgb(_h, _l, _s) + # Calc. optimal text color (b/w) + # Grayscale human vision perception (Rec. 709 values) + _a = 1 - (0.2126 * _r + 0.7152 * _g + 0.0722 * _b) + values.update( + { + "color_navbar_bg": n_rgb_to_hex(_r, _g, _b), + "color_navbar_bg_hover": n_rgb_to_hex(_rd, _gd, _bd), + "color_navbar_text": "#000" if _a < 0.5 else "#fff", + } + ) + self.write(values) + + def _scss_get_sanitized_values(self): + self.ensure_one() + # Clone company_color as dictionary to avoid ORM operations + # This allow extend company_colors and only sanitize selected fields + # or add custom values + values = dict(self.company_colors or {}) + values.update( + { + "color_navbar_bg": (values.get("color_navbar_bg") or "$o-brand-odoo"), + "color_navbar_bg_hover": (values.get("color_navbar_bg_hover")), + "color_navbar_text": (values.get("color_navbar_text") or "#FFF"), + "color_button_bg": values.get("color_button_bg") or "#71639e", + "color_button_bg_hover": values.get("color_button_bg_hover") + or "darken(#71639e, 10%)", + "color_button_text": values.get("color_button_text") or "#FFF", + "color_link_text": values.get("color_link_text") or "#71639e", + "color_link_text_hover": values.get("color_link_text_hover") + or "darken(#71639e, 10%)", + } + ) + return values + + def _scss_generate_content(self): + self.ensure_one() + # ir.attachment need files with content to work + if not self.company_colors: + return "// No Web Company Color SCSS Content\n" + return self.SCSS_TEMPLATE % self._scss_get_sanitized_values() + + def scss_get_url(self): + self.ensure_one() + return URL_SCSS_GEN_TEMPLATE % self.id + + def scss_create_or_update_attachment(self): + IrAttachmentObj = self.env["ir.attachment"] + for record in self: + datas = base64.b64encode(record._scss_generate_content().encode("utf-8")) + custom_url = record.scss_get_url() + custom_attachment = IrAttachmentObj.sudo().search( + [("url", "=", custom_url), ("company_id", "=", record.id)] + ) + values = { + "datas": datas, + "db_datas": datas, + "url": custom_url, + "name": custom_url, + "company_id": record.id, + } + if custom_attachment: + custom_attachment.sudo().write(values) + else: + values.update({"type": "binary", "mimetype": "text/scss"}) + IrAttachmentObj.sudo().create(values) + self.env["ir.qweb"].sudo().clear_caches() diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..180a4a0 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* Jordi Ballester Alomar (ForgeFlow) +* Lois Rilo (ForgeFlow) +* Simone Orsi +* Iván Antón +* Bernat Puig (ForgeFlow) +* Dhara Solanki +* `Tecnativa `_: + + * Jairo Llopis + * Alexandre Díaz + * Carlos Roca diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/DESCRIPTION.rst new file mode 100644 index 0000000..b164fc0 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module change navbar colors based in the company logo colors. diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/readme/ROADMAP.rst b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/ROADMAP.rst new file mode 100644 index 0000000..2b66937 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/ROADMAP.rst @@ -0,0 +1 @@ +White color is omitted in the addition operation to support images without alpha channel. diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/readme/USAGE.rst b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/USAGE.rst new file mode 100644 index 0000000..0143fee --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/readme/USAGE.rst @@ -0,0 +1,3 @@ +Go to company record and set a logo. Can see/modify applied colors on the "Navbar" section. + +For optimal results use images with alpha channel. diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/static/description/icon.png b/odoo-bringout-oca-web-web_company_color/web_company_color/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_company_color/web_company_color/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/static/description/index.html b/odoo-bringout-oca-web-web_company_color/web_company_color/static/description/index.html new file mode 100644 index 0000000..d248396 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +Web Company Color + + + +
+

Web Company Color

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module change navbar colors based in the company logo colors.

+

Table of contents

+ +
+

Usage

+

Go to company record and set a logo. Can see/modify applied colors on the “Navbar” section.

+

For optimal results use images with alpha channel.

+
+
+

Known issues / Roadmap

+

White color is omitted in the addition operation to support images without alpha channel.

+
+
+

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

+
    +
  • Alexandre Díaz
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_company_color/web_company_color/tests/__init__.py b/odoo-bringout-oca-web-web_company_color/web_company_color/tests/__init__.py new file mode 100644 index 0000000..2c9568e --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/tests/__init__.py @@ -0,0 +1 @@ +from . import test_res_company diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/tests/test_res_company.py b/odoo-bringout-oca-web-web_company_color/web_company_color/tests/test_res_company.py new file mode 100644 index 0000000..06a780c --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/tests/test_res_company.py @@ -0,0 +1,77 @@ +# Copyright 2019 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests import common + +from ..models.res_company import URL_BASE + + +class TestResCompany(common.TransactionCase): + IMG_GREEN = ( + "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUl" + + "EQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg==" + ) + + def _test_scss_attachment(self): + num_scss = self.env["ir.attachment"].search_count( + [("url", "ilike", "%s%%" % URL_BASE)] + ) + num_companies = self.env["res.company"].search_count([]) + self.assertEqual(num_scss, num_companies, "Invalid scss attachments") + + def test_create_unlink_company(self): + company_id = self.env["res.company"].create({"name": "Company Test"}) + self.assertEqual( + company_id.color_navbar_bg, False, "Invalid Navbar Background Color" + ) + self._test_scss_attachment() + company_id.sudo().write({"logo": self.IMG_GREEN}) + company_id.button_compute_color() + self.assertEqual( + company_id.color_navbar_bg, "#00ff00", "Invalid Navbar Background Color" + ) + # TODO: We can't remove companies if they have attached data, like + # warehouse when we have stock module installed + # company_id.sudo().unlink() + # self._test_scss_attachment() + + def test_change_logo(self): + company_id = self.env["res.company"].search([], limit=1) + company_id.sudo().write({"logo": self.IMG_GREEN}) + company_id.button_compute_color() + self.assertEqual( + company_id.color_navbar_bg, "#00ff00", "Invalid Navbar Background Color" + ) + + def test_scss_sanitized_values(self): + company_id = self.env["res.company"].search([], limit=1) + company_id.sudo().write({"color_navbar_bg": False}) + values = company_id.sudo()._scss_get_sanitized_values() + self.assertEqual( + values["color_navbar_bg"], + "$o-brand-odoo", + "Invalid Navbar Background Color", + ) + company_id.sudo().write({"color_navbar_bg": "#DEAD00"}) + values = company_id.sudo()._scss_get_sanitized_values() + self.assertEqual( + values["color_navbar_bg"], "#DEAD00", "Invalid Navbar Background Color" + ) + + def test_change_color(self): + company_id = self.env["res.company"].search([], limit=1) + company_id.sudo().write({"color_navbar_bg": "#DEAD00"}) + self.assertEqual( + company_id.color_navbar_bg, "#DEAD00", "Invalid Navbar Background Color" + ) + self.assertEqual( + company_id.company_colors["color_navbar_bg"], + "#DEAD00", + "Invalid Navbar Background Color", + ) + company_id.sudo().write({"color_navbar_bg": False}) + self.assertFalse(company_id.color_navbar_bg, "Invalid Navbar Background Color") + self.assertNotIn( + "color_navbar_bg", + company_id.company_colors, + "Invalid Navbar Background Color", + ) diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/utils.py b/odoo-bringout-oca-web-web_company_color/web_company_color/utils.py new file mode 100644 index 0000000..118ceb2 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/utils.py @@ -0,0 +1,40 @@ +# Copyright 2019 Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import base64 +import math +from io import BytesIO + +from PIL import Image + + +def n_rgb_to_hex(_r, _g, _b): + return "#{:02x}{:02x}{:02x}".format(int(255 * _r), int(255 * _g), int(255 * _b)) + + +def convert_to_image(field_binary): + return Image.open(BytesIO(base64.b64decode(field_binary))) + + +def image_to_rgb(img): + def normalize_vec3(vec3): + _l = 1.0 / math.sqrt(vec3[0] * vec3[0] + vec3[1] * vec3[1] + vec3[2] * vec3[2]) + return (vec3[0] * _l, vec3[1] * _l, vec3[2] * _l) + + # Force Alpha Channel + if img.mode != "RGBA": + img = img.convert("RGBA") + width, height = img.size + # Reduce pixels + width, height = (max(1, int(width / 4)), max(1, int(height / 4))) + img = img.resize((width, height)) + rgb_sum = [0, 0, 0] + # Mix. image colors using addition method + RGBA_WHITE = (255, 255, 255, 255) + for i in range(0, height * width): + rgba = img.getpixel((i % width, i / width)) + if rgba[3] > 128 and rgba != RGBA_WHITE: + rgb_sum[0] += rgba[0] + rgb_sum[1] += rgba[1] + rgb_sum[2] += rgba[2] + _r, _g, _b = normalize_vec3(rgb_sum) + return (_r, _g, _b) diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/view/assets.xml b/odoo-bringout-oca-web-web_company_color/web_company_color/view/assets.xml new file mode 100644 index 0000000..94b3baf --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/view/assets.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/odoo-bringout-oca-web-web_company_color/web_company_color/view/res_company.xml b/odoo-bringout-oca-web-web_company_color/web_company_color/view/res_company.xml new file mode 100644 index 0000000..45dd794 --- /dev/null +++ b/odoo-bringout-oca-web-web_company_color/web_company_color/view/res_company.xml @@ -0,0 +1,46 @@ + + + + + res.company + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+ + + tile.category + + + + + + + + + + + + Dashboard Categories + tile.category + tree,kanban,form + {'active_test': False} + + + + +
diff --git a/odoo-bringout-oca-web-web_dashboard_tile/web_dashboard_tile/views/tile_tile.xml b/odoo-bringout-oca-web-web_dashboard_tile/web_dashboard_tile/views/tile_tile.xml new file mode 100644 index 0000000..eb00f15 --- /dev/null +++ b/odoo-bringout-oca-web-web_dashboard_tile/web_dashboard_tile/views/tile_tile.xml @@ -0,0 +1,231 @@ + + + + + tile.tile + + + + + + + + + + + tile.tile + + + + + + + + + + + + + + + + + + + tile.tile + +
+ + +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + tile.tile + + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + Dashboard Items + tile.tile + tree,form,kanban + + + + + + + + diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/README.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/README.md new file mode 100644 index 0000000..1009a7f --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/README.md @@ -0,0 +1,46 @@ +# Web Datetime Picker Default Time + +Odoo addon: web_datetime_picker_default_time + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_datetime_picker_default_time +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Web Datetime Picker Default Time +- **Version**: 16.0.1.0.0 +- **Category**: web +- **License**: AGPL-3 +- **Installable**: False + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_datetime_picker_default_time`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/ARCHITECTURE.md new file mode 100644 index 0000000..2c636a7 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_datetime_picker_default_time Module - web_datetime_picker_default_time + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/CONFIGURATION.md new file mode 100644 index 0000000..ffdacad --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_datetime_picker_default_time. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/FAQ.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/FAQ.md new file mode 100644 index 0000000..2a309a0 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_datetime_picker_default_time or install in UI. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/INSTALL.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/INSTALL.md new file mode 100644 index 0000000..3c787f1 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_datetime_picker_default_time" +# or +uv pip install odoo-bringout-oca-web-web_datetime_picker_default_time" +``` diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/MODELS.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/MODELS.md new file mode 100644 index 0000000..28289c7 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/MODELS.md @@ -0,0 +1,11 @@ +# Models + +Detected core models and extensions in web_datetime_picker_default_time. + +```mermaid +classDiagram +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/OVERVIEW.md new file mode 100644 index 0000000..71e617f --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_datetime_picker_default_time. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_datetime_picker_default_time +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/REPORTS.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/SECURITY.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/USAGE.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/USAGE.md new file mode 100644 index 0000000..23f7916 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_datetime_picker_default_time +``` diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/WIZARDS.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/pyproject.toml b/odoo-bringout-oca-web-web_datetime_picker_default_time/pyproject.toml new file mode 100644 index 0000000..1a7912e --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_datetime_picker_default_time" +version = "16.0.0" +description = "Web Datetime Picker Default Time - Allows to define a default time on datetime picker" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_datetime_picker_default_time"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/README.rst b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/README.rst new file mode 100644 index 0000000..c86cd7a --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/README.rst @@ -0,0 +1,122 @@ +================================ +Web Datetime Picker Default Time +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a5ffb697bdf4c26817212f783a9d4d617e91fcdc912a7750382d3eddaff05f7b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_datetime_picker_default_time + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_datetime_picker_default_time + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module customizes the datetime picker widget and allows to define a +default time to be applied in case the user selects only a Date. + +For example, if a user wants to define a commitment date without having +to specify the time on that date, setting the default time value on the +field in the Form view allows to ensure the commitment date will be set +to this time instead of the time when the page was loaded by the +browser. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +You can define the default time as follows for a static value: + +.. code:: xml + + + +Otherwise you can also use a JSON field to make it dynamic through a +compute function, and reference this field in the view: + +.. code:: python + + start_time = field.Json(compute="_compute_start_time") + + def _compute_start_time(self): + for rec in self: + rec.start_time = {'hour': 8, 'minute': 30, 'second': 15 } + +.. code:: xml + + + + +Known issues / Roadmap +====================== + +- Handle Timezone related to the default time + +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 +------- + +* Camptocamp + +Contributors +------------ + +- Akim Juillerat akim.juillerat@camptocamp.com +- Iván Todorovich ivan.todorovich@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. + +.. |maintainer-grindtildeath| image:: https://github.com/grindtildeath.png?size=40px + :target: https://github.com/grindtildeath + :alt: grindtildeath + +Current `maintainer `__: + +|maintainer-grindtildeath| + +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/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/__init__.py b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/__manifest__.py b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/__manifest__.py new file mode 100644 index 0000000..98d289a --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +{ + "name": "Web Datetime Picker Default Time", + "summary": "Allows to define a default time on datetime picker", + "version": "16.0.1.0.0", + "category": "web", + "website": "https://github.com/OCA/web", + "author": "Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["grindtildeath"], + "license": "AGPL-3", + "depends": [ + "web", + ], + "assets": { + "web.assets_backend": [ + "/web_datetime_picker_default_time/static/src/js/*.js", + "/web_datetime_picker_default_time/static/src/xml/*.xml", + ], + }, +} diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/i18n/it.po b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/i18n/it.po new file mode 100644 index 0000000..7338855 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/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/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/i18n/web_datetime_picker_default_time.pot b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/i18n/web_datetime_picker_default_time.pot new file mode 100644 index 0000000..78d58d5 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/i18n/web_datetime_picker_default_time.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 16.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/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/CONTRIBUTORS.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..6168e90 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +* Akim Juillerat +* Iván Todorovich diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/DESCRIPTION.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/DESCRIPTION.md new file mode 100644 index 0000000..4e15c7e --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module customizes the datetime picker widget and allows to define a default +time to be applied in case the user selects only a Date. + +For example, if a user wants to define a commitment date without having to specify +the time on that date, setting the default time value on the field in the Form view +allows to ensure the commitment date will be set to this time instead of the time +when the page was loaded by the browser. diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/ROADMAP.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/ROADMAP.md new file mode 100644 index 0000000..53bc263 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/ROADMAP.md @@ -0,0 +1 @@ +* Handle Timezone related to the default time diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/USAGE.md b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/USAGE.md new file mode 100644 index 0000000..03e2fc1 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/readme/USAGE.md @@ -0,0 +1,21 @@ +You can define the default time as follows for a static value: + +```xml + +``` + +Otherwise you can also use a JSON field to make it dynamic through a compute function, +and reference this field in the view: + +```python + start_time = field.Json(compute="_compute_start_time") + + def _compute_start_time(self): + for rec in self: + rec.start_time = {'hour': 8, 'minute': 30, 'second': 15 } +``` + +```xml + + +``` diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/description/icon.png b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/description/index.html b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/description/index.html new file mode 100644 index 0000000..8ff4371 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/description/index.html @@ -0,0 +1,460 @@ + + + + + +Web Datetime Picker Default Time + + + +
+

Web Datetime Picker Default Time

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module customizes the datetime picker widget and allows to define a +default time to be applied in case the user selects only a Date.

+

For example, if a user wants to define a commitment date without having +to specify the time on that date, setting the default time value on the +field in the Form view allows to ensure the commitment date will be set +to this time instead of the time when the page was loaded by the +browser.

+

Table of contents

+ +
+

Usage

+

You can define the default time as follows for a static value:

+
+<field name="your_datetime_field" options="{'defaultTime': {'hour': 8, 'minute': 30, 'second': 15 }}"/>
+
+

Otherwise you can also use a JSON field to make it dynamic through a +compute function, and reference this field in the view:

+
+start_time = field.Json(compute="_compute_start_time")
+
+def _compute_start_time(self):
+    for rec in self:
+        rec.start_time = {'hour': 8, 'minute': 30, 'second': 15 }
+
+
+<field name="start_time" invisible="1" />
+<field name="your_datetime_field" options="{'defaultTime': 'start_time'}"/>
+
+
+
+

Known issues / Roadmap

+
    +
  • Handle Timezone related to the default time
  • +
+
+
+

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

+
    +
  • Camptocamp
  • +
+
+ +
+

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 maintainer:

+

grindtildeath

+

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/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/js/datepicker.esm.js b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/js/datepicker.esm.js new file mode 100644 index 0000000..f453cbf --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/js/datepicker.esm.js @@ -0,0 +1,58 @@ +/** @odoo-module **/ +/* Copyright 2024 Camptocamp + * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) */ + +import {DateTimePicker} from "@web/core/datepicker/datepicker"; +import {patch} from "@web/core/utils/patch"; +import {localization} from "@web/core/l10n/localization"; + +patch(DateTimePicker.prototype, "DateTimePickerDefaultTime", { + onMounted() { + this._super.apply(this, arguments); + this.addPickerListener("change", ({date, oldDate}) => { + const default_time = this.props.defaultTime; + if (date && !oldDate && default_time) { + // FIXME: Consider TZ + date.set({ + hour: default_time.hour, + minute: default_time.minute, + second: default_time.second, + }); + window.$(this.rootRef.el).datetimepicker("date", date); + } + }); + }, + isStrDate(input_string) { + return input_string.trim().length == localization.dateFormat.length; + }, + customParseValue(input_value, options) { + const default_time = this.props.defaultTime; + let [res, error] = this.parseValueOriginal(input_value, options); + if (default_time && this.isStrDate(input_value)) { + const new_value = res.set({ + hour: default_time.hour, + minute: default_time.minute, + second: default_time.second, + }); + res = new_value; + } + return [res, error]; + }, + initFormat() { + this._super.apply(this, arguments); + this.parseValueOriginal = this.parseValue; + this.parseValue = this.customParseValue; + }, +}); + +DateTimePicker.props = _.extend({}, DateTimePicker.props, { + defaultTime: { + type: Object, + shape: { + hour: Number, + minute: Number, + second: Number, + }, + optional: true, + }, +}); diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/js/datetime_field.esm.js b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/js/datetime_field.esm.js new file mode 100644 index 0000000..58f4660 --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/js/datetime_field.esm.js @@ -0,0 +1,42 @@ +/** @odoo-module **/ +/* Copyright 2024 Camptocamp + * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) */ + +import {DateTimeField} from "@web/views/fields/datetime/datetime_field"; +import {patch} from "@web/core/utils/patch"; + +patch(DateTimeField.prototype, "DateTimeFieldDefaultTime", { + get defaultTime() { + if (typeof this.props.defaultTime === "string") { + return this.props.record.data[this.props.defaultTime]; + } + return this.props.defaultTime; + }, +}); + +DateTimeField.props = _.extend({}, DateTimeField.props, { + defaultTime: { + type: [ + String, + { + type: Object, + shape: { + hour: Number, + minute: Number, + second: Number, + }, + optional: true, + }, + ], + optional: true, + }, +}); + +const super_extractProps = DateTimeField.extractProps; + +DateTimeField.extractProps = ({attrs}) => { + return { + ...super_extractProps({attrs}), + defaultTime: attrs.options.defaultTime, + }; +}; diff --git a/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/xml/datetime_field.xml b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/xml/datetime_field.xml new file mode 100644 index 0000000..df9affa --- /dev/null +++ b/odoo-bringout-oca-web-web_datetime_picker_default_time/web_datetime_picker_default_time/static/src/xml/datetime_field.xml @@ -0,0 +1,8 @@ + + + + + defaultTime + + + diff --git a/odoo-bringout-oca-web-web_dialog_size/README.md b/odoo-bringout-oca-web-web_dialog_size/README.md new file mode 100644 index 0000000..f3796ec --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/README.md @@ -0,0 +1,46 @@ +# Web Dialog Size + +Odoo addon: web_dialog_size + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_dialog_size +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Web Dialog Size +- **Version**: 16.0.1.0.2 +- **Category**: web +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_dialog_size`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_dialog_size/doc/ARCHITECTURE.md new file mode 100644 index 0000000..c968cf8 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_dialog_size Module - web_dialog_size + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_dialog_size/doc/CONFIGURATION.md new file mode 100644 index 0000000..44e1e37 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_dialog_size. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_dialog_size/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_dialog_size/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/FAQ.md b/odoo-bringout-oca-web-web_dialog_size/doc/FAQ.md new file mode 100644 index 0000000..19f84dc --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_dialog_size or install in UI. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/INSTALL.md b/odoo-bringout-oca-web-web_dialog_size/doc/INSTALL.md new file mode 100644 index 0000000..72733ab --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_dialog_size" +# or +uv pip install odoo-bringout-oca-web-web_dialog_size" +``` diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/MODELS.md b/odoo-bringout-oca-web-web_dialog_size/doc/MODELS.md new file mode 100644 index 0000000..9acb49a --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/MODELS.md @@ -0,0 +1,12 @@ +# Models + +Detected core models and extensions in web_dialog_size. + +```mermaid +classDiagram + class ir_config_parameter +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_dialog_size/doc/OVERVIEW.md new file mode 100644 index 0000000..a5fd6e0 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_dialog_size. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_dialog_size +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/REPORTS.md b/odoo-bringout-oca-web-web_dialog_size/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/SECURITY.md b/odoo-bringout-oca-web-web_dialog_size/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_dialog_size/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/USAGE.md b/odoo-bringout-oca-web-web_dialog_size/doc/USAGE.md new file mode 100644 index 0000000..f07253e --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_dialog_size +``` diff --git a/odoo-bringout-oca-web-web_dialog_size/doc/WIZARDS.md b/odoo-bringout-oca-web-web_dialog_size/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_dialog_size/pyproject.toml b/odoo-bringout-oca-web-web_dialog_size/pyproject.toml new file mode 100644 index 0000000..a983fa0 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "odoo-bringout-oca-web-web_dialog_size" +version = "16.0.0" +description = "Web Dialog Size - + A module that lets the user expand a + dialog box to the full screen width." +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_dialog_size"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/README.rst b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/README.rst new file mode 100644 index 0000000..97ee688 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/README.rst @@ -0,0 +1,112 @@ +=============== +Web Dialog Size +=============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:214939c5a8aeb84d5fb1f5bacae73d4d4d4a81d59c9e2af6e0ea600a6c4c90c5 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_dialog_size + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_dialog_size + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +A module that lets the user expand/restore the dialog box size through a button +in the upper right corner (imitating most windows managers). +It also adds draggable support to the dialogs. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +By default, the module respects the caller's ``dialog_size`` option. +If you want to set dialog boxes maximized by default, you need to: + +#. Go to *Settings -> Technical -> Parameters -> System Parameters* +#. Add a new record with the text *web_dialog_size.default_maximize* in + the *Key* field and the text *True* in the *Value* field + +Known issues / Roadmap +====================== + +* Allow setting default dialog size per user. + +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 +~~~~~~~ + +* ACSONE SA/NV +* Therp BV +* Siddharth Bhalgami +* Tecnativa +* Amaris + +Contributors +~~~~~~~~~~~~ + +* Anthony Muschang +* Stéphane Bidoul +* Holger Brunn +* Siddharth Bhalgami +* Wolfgang Pichler +* David Vidal +* Quentin Theuret +* `Tecnativa `_: + + * Pedro M. Baeza + * Jairo Llopis + * Ernesto Tejeda + +* Sudhir Arya +* Pierre Pizzetta +* Mantas Šniukas + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/__init__.py b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/__manifest__.py b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/__manifest__.py new file mode 100644 index 0000000..4ac4809 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/__manifest__.py @@ -0,0 +1,33 @@ +# Copyright 2015 ACSONE SA/NV +# Copyright 2018 Amaris +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Dialog Size", + "summary": """ + A module that lets the user expand a + dialog box to the full screen width.""", + "author": "ACSONE SA/NV, " + "Therp BV, " + "Siddharth Bhalgami," + "Tecnativa, " + "Amaris, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "category": "web", + "version": "16.0.1.0.2", + "license": "AGPL-3", + "depends": ["web"], + "installable": True, + "assets": { + "web.assets_backend": [ + "/web_dialog_size/static/src/js/web_dialog_size.js", + "/web_dialog_size/static/src/js/web_dialog_size.esm.js", + "/web_dialog_size/static/src/js/web_dialog_draggable.esm.js", + "/web_dialog_size/static/src/scss/web_dialog_size.scss", + "/web_dialog_size/static/src/xml/web_dialog_size.xml", + "/web_dialog_size/static/src/xml/ExpandButton.xml", + "/web_dialog_size/static/src/xml/DialogDraggable.xml", + ], + }, +} diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/bs.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/bs.po new file mode 100644 index 0000000..8820076 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/bs.po @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Sistemski parametar" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/de.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/de.po new file mode 100644 index 0000000..3a7e405 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/de.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-13 20:46+0000\n" +"Last-Translator: Corneliuus \n" +"Language-Team: none\n" +"Language: de\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Systemparameter" + +#~ msgid "Display Name" +#~ msgstr "Anzeigename" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Zuletzt bearbeitet am" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/es.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/es.po new file mode 100644 index 0000000..a3647c3 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/es.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-25 11:47+0000\n" +"Last-Translator: Valentin Vinagre \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Parámetro del sistema" + +#~ msgid "ID" +#~ msgstr "ID" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/fr.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/fr.po new file mode 100644 index 0000000..d3a0bde --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/fr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-14 20:47+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Paramètre système" + +#~ msgid "Display Name" +#~ msgstr "Nom affiché" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/hr.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/hr.po new file mode 100644 index 0000000..a6ff78c --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/hr.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-11-13 17:06+0000\n" +"Last-Translator: vladimiruvid \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Sistemski parametar" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/it.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/it.po new file mode 100644 index 0000000..b54cc33 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/it.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:33+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Parametro di sistema" + +#~ msgid "Display Name" +#~ msgstr "Nome Visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima Modifica il" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/nl.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/nl.po new file mode 100644 index 0000000..d90fc96 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/nl.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-17 20:47+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Systeem Parameter" + +#~ msgid "Display Name" +#~ msgstr "Weergavenaam" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Laatst Gewijzigd op" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/tr.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/tr.po new file mode 100644 index 0000000..fcf4787 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/tr.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-04-15 10:24+0000\n" +"Last-Translator: Betül Öğmen \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" +"X-Generator: Weblate 5.10.4\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Sistem Parametresi" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/web_dialog_size.pot b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/web_dialog_size.pot new file mode 100644 index 0000000..a59c772 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/web_dialog_size.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/zh_CN.po b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/zh_CN.po new file mode 100644 index 0000000..8a3c411 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/i18n/zh_CN.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 12:52+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "系统参数" diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/models/__init__.py b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/models/__init__.py new file mode 100644 index 0000000..bd3aa9f --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/models/__init__.py @@ -0,0 +1 @@ +from . import ir_config_parameter diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/models/ir_config_parameter.py b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/models/ir_config_parameter.py new file mode 100644 index 0000000..493a4f6 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/models/ir_config_parameter.py @@ -0,0 +1,18 @@ +# Copyright 2018 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.models import Model, api +from odoo.tools.safe_eval import const_eval + + +class IrConfigParameter(Model): + _inherit = "ir.config_parameter" + + @api.model + def get_web_dialog_size_config(self): + get_param = self.sudo().get_param + return { + "default_maximize": const_eval( + get_param("web_dialog_size.default_maximize", "False") + ) + } diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/CONFIGURE.rst b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/CONFIGURE.rst new file mode 100644 index 0000000..243ecce --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +By default, the module respects the caller's ``dialog_size`` option. +If you want to set dialog boxes maximized by default, you need to: + +#. Go to *Settings -> Technical -> Parameters -> System Parameters* +#. Add a new record with the text *web_dialog_size.default_maximize* in + the *Key* field and the text *True* in the *Value* field diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..5f67550 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/CONTRIBUTORS.rst @@ -0,0 +1,16 @@ +* Anthony Muschang +* Stéphane Bidoul +* Holger Brunn +* Siddharth Bhalgami +* Wolfgang Pichler +* David Vidal +* Quentin Theuret +* `Tecnativa `_: + + * Pedro M. Baeza + * Jairo Llopis + * Ernesto Tejeda + +* Sudhir Arya +* Pierre Pizzetta +* Mantas Šniukas diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/DESCRIPTION.rst new file mode 100644 index 0000000..398e72f --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +A module that lets the user expand/restore the dialog box size through a button +in the upper right corner (imitating most windows managers). +It also adds draggable support to the dialogs. diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/ROADMAP.rst b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/ROADMAP.rst new file mode 100644 index 0000000..8667f3e --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Allow setting default dialog size per user. diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/description/icon.png b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/description/index.html b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/description/index.html new file mode 100644 index 0000000..ac2c633 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/description/index.html @@ -0,0 +1,465 @@ + + + + + +Web Dialog Size + + + +
+

Web Dialog Size

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

A module that lets the user expand/restore the dialog box size through a button +in the upper right corner (imitating most windows managers). +It also adds draggable support to the dialogs.

+

Table of contents

+ +
+

Configuration

+

By default, the module respects the caller’s dialog_size option. +If you want to set dialog boxes maximized by default, you need to:

+
    +
  1. Go to Settings -> Technical -> Parameters -> System Parameters
  2. +
  3. +
    Add a new record with the text web_dialog_size.default_maximize in
    +
    the Key field and the text True in the Value field
    +
    +
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Allow setting default dialog size per user.
  • +
+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
  • Therp BV
  • +
  • Siddharth Bhalgami
  • +
  • Tecnativa
  • +
  • Amaris
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_draggable.esm.js b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_draggable.esm.js new file mode 100644 index 0000000..92ea85a --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_draggable.esm.js @@ -0,0 +1,50 @@ +/** @odoo-module **/ + +import {ActionDialog} from "@web/webclient/actions/action_dialog"; +import {onMounted, useExternalListener} from "@odoo/owl"; +import {useListener} from "@web/core/utils/hooks"; +import {LegacyComponent} from "@web/legacy/legacy_component"; +import {Dialog} from "@web/core/dialog/dialog"; + +export class DialogDraggable extends LegacyComponent { + setup() { + this.element_position = {x: 0, y: 0}; + this.mouse_to_element_ratio = {x: 0, y: 0}; + const bound_onDrag = this.onDrag.bind(this); + useListener("mousedown", "header.modal-header", (event) => { + const y = parseInt(this.el.querySelector(".modal-content").offsetTop, 10); + const x = parseInt(this.el.querySelector(".modal-content").offsetLeft, 10); + this.mouse_to_element_ratio = {x: event.x - x, y: event.y - y}; + this.element_position = { + x: event.x - this.mouse_to_element_ratio.x - x, + y: event.y - this.mouse_to_element_ratio.y - y, + }; + document.addEventListener("mousemove", bound_onDrag); + }); + useExternalListener(document, "mouseup", () => + document.removeEventListener("mousemove", bound_onDrag) + ); + onMounted(() => { + this.el.querySelector(".modal-content").classList.add("position-absolute"); + this.el.parentNode.classList.add("position-relative"); + }); + } + + getMovePosition({x, y}) { + return { + x: x - this.mouse_to_element_ratio.x - this.element_position.x, + y: y - this.mouse_to_element_ratio.y - this.element_position.y, + }; + } + onDrag(event) { + const {x, y} = this.getMovePosition(event); + const el = this.el.querySelector(".modal-content"); + el.style.left = `${x}px`; + el.style.top = `${y}px`; + } +} + +DialogDraggable.template = "DialogDraggable"; + +Dialog.components = Object.assign(Dialog.components || {}, {DialogDraggable}); +Object.assign(ActionDialog.components, {DialogDraggable}); diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_size.esm.js b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_size.esm.js new file mode 100644 index 0000000..594408e --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_size.esm.js @@ -0,0 +1,96 @@ +/** @odoo-module **/ + +import {ActionDialog} from "@web/webclient/actions/action_dialog"; +import {patch} from "@web/core/utils/patch"; +import rpc from "web.rpc"; +import {Component, onWillRender} from "@odoo/owl"; +import {Dialog} from "@web/core/dialog/dialog"; +import {SelectCreateDialog} from "@web/views/view_dialogs/select_create_dialog"; + +export class ExpandButton extends Component { + setup() { + this.lastSize = this.currentSize = this.props.getsize(); + this.sizeRestored = false; + this.config = rpc.query({ + model: "ir.config_parameter", + method: "get_web_dialog_size_config", + }); + + onWillRender(() => { + var self = this; + // If the form lost its current state, we need to set it again + if (this.props.getsize() !== this.currentSize) { + this.props.setsize(this.currentSize); + } + // Check if we already are in full screen or if the form was restored. + // If so we don't need to check the default maximize + if (this.props.getsize() !== "dialog_full_screen" && !this.sizeRestored) { + this.config.then(function (r) { + if (r.default_maximize && stop) { + self.dialog_button_extend(); + } + }); + } + }); + } + + dialog_button_extend() { + this.lastSize = this.props.getsize(); + this.props.setsize("dialog_full_screen"); + this.currentSize = "dialog_full_screen"; + this.sizeRestored = false; + this.render(); + } + + dialog_button_restore() { + this.props.setsize(this.lastSize); + this.currentSize = this.lastSize; + this.sizeRestored = true; + this.render(); + } +} + +ExpandButton.template = "web_dialog_size.ExpandButton"; + +patch(Dialog.prototype, "web_dialog_size.Dialog", { + setup() { + this._super(...arguments); + this.setSize = this.setSize.bind(this); + this.getSize = this.getSize.bind(this); + }, + + setSize(size) { + this.props.size = size; + this.render(); + }, + + getSize() { + return this.props.size; + }, +}); + +patch(SelectCreateDialog.prototype, "web_dialog_size.SelectCreateDialog", { + setup() { + this._super(...arguments); + this.setSize = this.setSize.bind(this); + this.getSize = this.getSize.bind(this); + }, + + setSize(size) { + this.props.size = size; + this.render(); + }, + + getSize() { + return this.props.size; + }, +}); + +Object.assign(ActionDialog.components, {ExpandButton}); +SelectCreateDialog.components = Object.assign(SelectCreateDialog.components || {}, { + ExpandButton, +}); +Dialog.components = Object.assign(Dialog.components || {}, {ExpandButton}); +// Patch annoying validation method +Dialog.props.size.validate = (s) => + ["sm", "md", "lg", "xl", "dialog_full_screen"].includes(s); diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_size.js b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_size.js new file mode 100644 index 0000000..0afabcc --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/js/web_dialog_size.js @@ -0,0 +1,50 @@ +odoo.define("web_dialog_size.web_dialog_size", function (require) { + "use strict"; + + var rpc = require("web.rpc"); + var Dialog = require("web.Dialog"); + + var config = rpc.query({ + model: "ir.config_parameter", + method: "get_web_dialog_size_config", + }); + + Dialog.include({ + willStart: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + self.$modal + .find(".dialog_button_extend") + .on("click", self.proxy("_extending")); + self.$modal + .find(".dialog_button_restore") + .on("click", self.proxy("_restore")); + self.$modal.find(">:first-child").draggable({ + handle: ".modal-header", + helper: false, + }); + return config.then(function (r) { + if (r.default_maximize) { + self._extending(); + } else { + self._restore(); + } + }); + }); + }, + + _extending: function () { + var dialog = this.$modal.find(".modal-dialog"); + dialog.addClass("modal-dialog_full_screen"); + dialog.find(".dialog_button_extend").hide(); + dialog.find(".dialog_button_restore").show(); + }, + + _restore: function () { + var dialog = this.$modal.find(".modal-dialog"); + dialog.removeClass("modal-dialog_full_screen"); + dialog.find(".dialog_button_restore").hide(); + dialog.find(".dialog_button_extend").show(); + }, + }); +}); diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/scss/web_dialog_size.scss b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/scss/web_dialog_size.scss new file mode 100644 index 0000000..44e2066 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/scss/web_dialog_size.scss @@ -0,0 +1,16 @@ +.modal { + .modal-dialog_full_screen { + @include media-breakpoint-up(sm) { + max-width: 100%; + width: calc(100% - 50px); + } + } + + .dialog_button_restore, + .dialog_button_extend { + margin-left: auto; + + .btn-close { + margin: -8px -8px -8px 0px; + } + } +} diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/DialogDraggable.xml b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/DialogDraggable.xml new file mode 100644 index 0000000..bc30ace --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/DialogDraggable.xml @@ -0,0 +1,8 @@ + + + +
+ +
+
+
diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/ExpandButton.xml b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/ExpandButton.xml new file mode 100644 index 0000000..9544445 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/ExpandButton.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/web_dialog_size.xml b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/web_dialog_size.xml new file mode 100644 index 0000000..e160bed --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/static/src/xml/web_dialog_size.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + props.size + + + + diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/tests/__init__.py b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/tests/__init__.py new file mode 100644 index 0000000..79d0263 --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/tests/__init__.py @@ -0,0 +1 @@ +from . import test_web_dialog_size diff --git a/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/tests/test_web_dialog_size.py b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/tests/test_web_dialog_size.py new file mode 100644 index 0000000..53e916d --- /dev/null +++ b/odoo-bringout-oca-web-web_dialog_size/web_dialog_size/tests/test_web_dialog_size.py @@ -0,0 +1,20 @@ +# Copyright 2018 Tecnativa - Ernesto Tejeda +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +from odoo.tests.common import TransactionCase + + +class TestWebDialogSize(TransactionCase): + def setUp(self): + super(TestWebDialogSize, self).setUp() + + def test_get_web_dialog_size_config(self): + obj = self.env["ir.config_parameter"] + + self.assertFalse(obj.get_web_dialog_size_config()["default_maximize"]) + + obj.set_param("web_dialog_size.default_maximize", "True") + self.assertTrue(obj.get_web_dialog_size_config()["default_maximize"]) + + obj.set_param("web_dialog_size.default_maximize", "False") + self.assertFalse(obj.get_web_dialog_size_config()["default_maximize"]) diff --git a/odoo-bringout-oca-web-web_disable_export_group/README.md b/odoo-bringout-oca-web-web_disable_export_group/README.md new file mode 100644 index 0000000..cec7061 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/README.md @@ -0,0 +1,46 @@ +# Web Disable Export Group + +Odoo addon: web_disable_export_group + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_disable_export_group +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Web Disable Export Group +- **Version**: 16.0.1.0.0 +- **Category**: Web +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_disable_export_group`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_disable_export_group/doc/ARCHITECTURE.md new file mode 100644 index 0000000..33851f9 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_disable_export_group Module - web_disable_export_group + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_disable_export_group/doc/CONFIGURATION.md new file mode 100644 index 0000000..88f92e1 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_disable_export_group. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_disable_export_group/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_disable_export_group/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/FAQ.md b/odoo-bringout-oca-web-web_disable_export_group/doc/FAQ.md new file mode 100644 index 0000000..ef5b0d8 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_disable_export_group or install in UI. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/INSTALL.md b/odoo-bringout-oca-web-web_disable_export_group/doc/INSTALL.md new file mode 100644 index 0000000..7fa703c --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_disable_export_group" +# or +uv pip install odoo-bringout-oca-web-web_disable_export_group" +``` diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/MODELS.md b/odoo-bringout-oca-web-web_disable_export_group/doc/MODELS.md new file mode 100644 index 0000000..445aa50 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/MODELS.md @@ -0,0 +1,13 @@ +# Models + +Detected core models and extensions in web_disable_export_group. + +```mermaid +classDiagram + class base + class ir_http +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_disable_export_group/doc/OVERVIEW.md new file mode 100644 index 0000000..336da28 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_disable_export_group. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_disable_export_group +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/REPORTS.md b/odoo-bringout-oca-web-web_disable_export_group/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/SECURITY.md b/odoo-bringout-oca-web-web_disable_export_group/doc/SECURITY.md new file mode 100644 index 0000000..08c85bc --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/SECURITY.md @@ -0,0 +1,42 @@ +# Security + +Access control and security definitions in web_disable_export_group. + +## Access Control Lists (ACLs) + +Model access permissions defined in: +- **[ir.model.access.csv](../web_disable_export_group/security/ir.model.access.csv)** + - 1 model access rules + +## Record Rules + +Row-level security rules defined in: + +## Security Groups & Configuration + +Security groups and permissions defined in: +- **[groups.xml](../web_disable_export_group/security/groups.xml)** + - 2 security groups defined + +```mermaid +graph TB + subgraph "Security Layers" + A[Users] --> B[Groups] + B --> C[Access Control Lists] + C --> D[Models] + B --> E[Record Rules] + E --> F[Individual Records] + end +``` + +Security files overview: +- **[groups.xml](../web_disable_export_group/security/groups.xml)** + - Security groups, categories, and XML-based rules +- **[ir.model.access.csv](../web_disable_export_group/security/ir.model.access.csv)** + - Model access permissions (CRUD rights) + +Notes +- Access Control Lists define which groups can access which models +- Record Rules provide row-level security (filter records by user/group) +- Security groups organize users and define permission sets +- All security is enforced at the ORM level by Odoo diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_disable_export_group/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/USAGE.md b/odoo-bringout-oca-web-web_disable_export_group/doc/USAGE.md new file mode 100644 index 0000000..1b9b515 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_disable_export_group +``` diff --git a/odoo-bringout-oca-web-web_disable_export_group/doc/WIZARDS.md b/odoo-bringout-oca-web-web_disable_export_group/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_disable_export_group/pyproject.toml b/odoo-bringout-oca-web-web_disable_export_group/pyproject.toml new file mode 100644 index 0000000..b698773 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_disable_export_group" +version = "16.0.0" +description = "Web Disable Export Group - Odoo addon" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_disable_export_group"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/README.rst b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/README.rst new file mode 100644 index 0000000..3a562de --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/README.rst @@ -0,0 +1,107 @@ +======================== +Web Disable Export Group +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:53eeef451e7dbe8a9904efe9a17051a08f19242c695fd057ea6cde108866f101 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_disable_export_group + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_disable_export_group + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The standard grants/prevents access to any UI export via *Access to export feature* +group. + +This module adds a new group for the 'Direct Export (xlsx)' feature, leaving the +standard one for only the 'Export All' feature. + +Admin users can always use the export option. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Enable the group *Direct Export* to the users who are allowed to make use of the option +'Export xlsx' from the list view. + +Usage +===== + +- Users in the *Access to export feature* group or admins can export in any way. +- Users in the *Direct Export (xlsx)* group can only use the default export feature + from the list view. + +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 +~~~~~~~ + +* Onestein +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Onestein `_: + + * Dennis Sluijk + * Andrea Stirpe + +* `Tecnativa `_: + + * David Vidal + * João Marques + * Alexandre Díaz + * Víctor Martínez + * David Vidal + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/__init__.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/__manifest__.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/__manifest__.py new file mode 100644 index 0000000..f086e83 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2016 Onestein () +# Copyright 2018 Tecnativa - David Vidal +# Copyright 2018 Tecnativa - João Marques +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Web Disable Export Group", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Onestein, Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "category": "Web", + "depends": ["web"], + "data": [ + "security/groups.xml", + "security/ir.model.access.csv", + ], + "installable": True, + "assets": { + "web.assets_backend": [ + "/web_disable_export_group/static/src/**/*", + ], + "web.assets_tests": ["/web_disable_export_group/static/tests/*.js"], + }, +} diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/bs.po b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/bs.po new file mode 100644 index 0000000..64a0896 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/bs.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "Osnova" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "Direktni Izvoz (xlsx)" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "HTTP usmjeravanje" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/es.po b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/es.po new file mode 100644 index 0000000..0ccd2db --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/es.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-19 19:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "Base" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "Exportación directa (xlsx)" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "Ruta HTTP" + +#, python-format +#~ msgid "widget.is_action_enabled('export_xlsx') and widget.isExportXlsEnable" +#~ msgstr "widget.is_action_enabled('export_xlsx') y widget.isExportXlsEnable" + +#, python-format +#~ msgid "Export" +#~ msgstr "Exportar" + +#~ msgid "Export Data" +#~ msgstr "Exportar datos" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/hr.po b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/hr.po new file mode 100644 index 0000000..adfd1c4 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/hr.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-12-02 16:35+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.9.1\n" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "HTTP usmjeravanje" + +#. module: web_disable_export_group +#. openerp-web +#: code:addons/web_disable_export_group/static/src/xml/export_xls_views.xml:0 +#, python-format +msgid "widget.is_action_enabled('export_xlsx') and widget.isExportXlsEnable" +msgstr "" + +#, python-format +#~ msgid "Export" +#~ msgstr "Izvoz" + +#~ msgid "Export Data" +#~ msgstr "Izvoz podataka" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/it.po b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/it.po new file mode 100644 index 0000000..abae925 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/it.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-05 14:40+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "Base" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "Esportazione diretta (xlsx)" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "Instradamento HTTP" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/pt.po b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/pt.po new file mode 100644 index 0000000..5011adc --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/pt.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-10-16 12:08+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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" +"X-Generator: Weblate 3.10\n" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "Encaminhamento HTTP" + +#. module: web_disable_export_group +#. openerp-web +#: code:addons/web_disable_export_group/static/src/xml/export_xls_views.xml:0 +#, python-format +msgid "widget.is_action_enabled('export_xlsx') and widget.isExportXlsEnable" +msgstr "" + +#, python-format +#~ msgid "Export" +#~ msgstr "Exportar" + +#~ msgid "Export Data" +#~ msgstr "Exportar Dados" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/web_disable_export_group.pot b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/web_disable_export_group.pot new file mode 100644 index 0000000..cb0bde9 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/web_disable_export_group.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/zh_CN.po b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/zh_CN.po new file mode 100644 index 0000000..52029f5 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/i18n/zh_CN.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_disable_export_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 12:52+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_base +msgid "Base" +msgstr "" + +#. module: web_disable_export_group +#: model:res.groups,name:web_disable_export_group.group_export_xlsx_data +msgid "Direct Export (xlsx)" +msgstr "" + +#. module: web_disable_export_group +#: model:ir.model,name:web_disable_export_group.model_ir_http +msgid "HTTP Routing" +msgstr "HTTP路由" + +#. module: web_disable_export_group +#. openerp-web +#: code:addons/web_disable_export_group/static/src/xml/export_xls_views.xml:0 +#, python-format +msgid "widget.is_action_enabled('export_xlsx') and widget.isExportXlsEnable" +msgstr "" + +#, python-format +#~ msgid "Export" +#~ msgstr "导出" + +#~ msgid "Export Data" +#~ msgstr "导出数据" diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/__init__.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/__init__.py new file mode 100644 index 0000000..ea997b3 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/__init__.py @@ -0,0 +1,2 @@ +from . import ir_http +from . import models diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/ir_http.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/ir_http.py new file mode 100644 index 0000000..562ff40 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/ir_http.py @@ -0,0 +1,20 @@ +# Copyright 2018 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models +from odoo.http import request + + +class Http(models.AbstractModel): + _inherit = "ir.http" + + def session_info(self): + res = super().session_info() + user = request.env.user + res.update( + { + "group_xlsx_export_data": user + and user.has_group("web_disable_export_group.group_export_xlsx_data"), + } + ) + return res diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/models.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/models.py new file mode 100644 index 0000000..63a911d --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/models/models.py @@ -0,0 +1,23 @@ +# Copyright 2023 Tecnativa - David Vidal +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +from odoo import models + + +class Base(models.AbstractModel): + _inherit = "base" + + def export_data(self, fields_to_export): + """Export fields for selected objects + + :param fields_to_export: list of fields + :param raw_data: True to return value in native Python type + :rtype: dictionary with a *datas* matrix + + This method is used when exporting data via client menu + """ + if self.env.user.has_group("web_disable_export_group.group_export_xlsx_data"): + fields_to_export = [ + models.fix_import_export_id_paths(f) for f in fields_to_export + ] + return {"datas": self._export_rows(fields_to_export)} + return super().export_data(fields_to_export) diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/CONFIGURE.rst b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/CONFIGURE.rst new file mode 100644 index 0000000..e1c825c --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +Enable the group *Direct Export* to the users who are allowed to make use of the option +'Export xlsx' from the list view. diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..fa58464 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/CONTRIBUTORS.rst @@ -0,0 +1,12 @@ +* `Onestein `_: + + * Dennis Sluijk + * Andrea Stirpe + +* `Tecnativa `_: + + * David Vidal + * João Marques + * Alexandre Díaz + * Víctor Martínez + * David Vidal diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/DESCRIPTION.rst new file mode 100644 index 0000000..8e9916e --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +The standard grants/prevents access to any UI export via *Access to export feature* +group. + +This module adds a new group for the 'Direct Export (xlsx)' feature, leaving the +standard one for only the 'Export All' feature. + +Admin users can always use the export option. diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/USAGE.rst b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/USAGE.rst new file mode 100644 index 0000000..e35c9bd --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/readme/USAGE.rst @@ -0,0 +1,3 @@ +- Users in the *Access to export feature* group or admins can export in any way. +- Users in the *Direct Export (xlsx)* group can only use the default export feature + from the list view. diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/security/groups.xml b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/security/groups.xml new file mode 100644 index 0000000..cdcf4e0 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/security/groups.xml @@ -0,0 +1,19 @@ + + + + + Direct Export (xlsx) + + + + + + + diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/security/ir.model.access.csv b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/security/ir.model.access.csv new file mode 100644 index 0000000..589bcc4 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_ir_exports_group_xls","ir_exports group_xls","base.model_ir_exports","web_disable_export_group.group_export_xlsx_data",1,0,0,0 diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/description/icon.png b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/description/index.html b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/description/index.html new file mode 100644 index 0000000..349bcf0 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/description/index.html @@ -0,0 +1,453 @@ + + + + + + +Web Disable Export Group + + + +
+

Web Disable Export Group

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

The standard grants/prevents access to any UI export via Access to export feature +group.

+

This module adds a new group for the ‘Direct Export (xlsx)’ feature, leaving the +standard one for only the ‘Export All’ feature.

+

Admin users can always use the export option.

+

Table of contents

+ +
+

Configuration

+

Enable the group Direct Export to the users who are allowed to make use of the option +‘Export xlsx’ from the list view.

+
+
+

Usage

+
    +
  • Users in the Access to export feature group or admins can export in any way.
  • +
  • Users in the Direct Export (xlsx) group can only use the default export feature +from the list view.
  • +
+
+
+

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

+
    +
  • Onestein
  • +
  • Tecnativa
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/js/abstract_controller.esm.js b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/js/abstract_controller.esm.js new file mode 100644 index 0000000..8576a18 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/js/abstract_controller.esm.js @@ -0,0 +1,26 @@ +/** @odoo-module **/ +/* Copyright 2016 Onestein + Copyright 2018 Tecnativa - David Vidal + Copyright 2021 Tecnativa - Alexandre Díaz + Copyright 2022 Tecnativa - Víctor Martínez + License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ +import AbstractController from "web.AbstractController"; +import session from "web.session"; + +AbstractController.include({ + /** + * @override + */ + is_action_enabled: function (action) { + if ( + !session.is_superuser && + action && + action === "export_xlsx" && + !session.group_xlsx_export_data + ) { + return false; + } + + return this._super.apply(this, arguments); + }, +}); diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/js/list_controller.esm.js b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/js/list_controller.esm.js new file mode 100644 index 0000000..8e99b91 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/js/list_controller.esm.js @@ -0,0 +1,20 @@ +/** @odoo-module **/ +/* Copyright 2018 Tecnativa - David Vidal + License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ +import {ListController} from "@web/views/list/list_controller"; +import {onWillStart} from "@odoo/owl"; +import {patch} from "@web/core/utils/patch"; + +patch(ListController.prototype, "disable_export_group", { + setup() { + this._super(...arguments); + onWillStart(async () => { + this.isExportEnable = await this.userService.hasGroup( + "base.group_allow_export" + ); + this.isExportXlsEnable = await this.userService.hasGroup( + "web_disable_export_group.group_export_xlsx_data" + ); + }); + }, +}); diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/xml/export_xls_views.xml b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/xml/export_xls_views.xml new file mode 100644 index 0000000..236efcb --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/src/xml/export_xls_views.xml @@ -0,0 +1,17 @@ + + + + + + nbTotal and !nbSelected and activeActions.exportXlsx and isExportXlsEnable and !env.isSmall + + + + diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/tests/web_disable_export_group_tour.esm.js b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/tests/web_disable_export_group_tour.esm.js new file mode 100644 index 0000000..1702df8 --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/static/tests/web_disable_export_group_tour.esm.js @@ -0,0 +1,33 @@ +/** @odoo-module **/ +/* Copyright 2020 Tecnativa - João Marques + Copyright 2022 Tecnativa - Víctor Martínez + License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ + +import tour from "web_tour.tour"; + +tour.register( + "export_tour_xlsx_button_ok", + { + test: true, + url: "/web#model=ir.ui.view&view_type=list&cids=&action=base.action_ui_view", + }, + [ + { + content: "Check if 'Export all' button exists", + trigger: ".o_list_buttons:has(.o_list_export_xlsx)", + }, + ] +); +tour.register( + "export_tour_xlsx_button_ko", + { + test: true, + url: "/web#model=ir.ui.view&view_type=list&cids=&action=base.action_ui_view", + }, + [ + { + content: "Check if 'Export all' button exists", + trigger: ".o_list_buttons:not(:has(.o_list_export_xlsx))", + }, + ] +); diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/tests/__init__.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/tests/__init__.py new file mode 100644 index 0000000..f49429e --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/tests/__init__.py @@ -0,0 +1 @@ +from . import test_tour diff --git a/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/tests/test_tour.py b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/tests/test_tour.py new file mode 100644 index 0000000..854eb9b --- /dev/null +++ b/odoo-bringout-oca-web-web_disable_export_group/web_disable_export_group/tests/test_tour.py @@ -0,0 +1,35 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# Copyright 2020 Tecnativa - João Marques +# Copyright 2022 Tecnativa - Víctor Martínez +import odoo.tests +from odoo.tests import new_test_user + + +@odoo.tests.tagged("post_install", "-at_install") +class TestTour(odoo.tests.HttpCase): + def setUp(self): + super().setUp() + new_test_user( + self.env, + login="user_not_export", + password="user_not_export", + groups="base.group_user,base.group_system", + ) + new_test_user( + self.env, + login="user_export_xlsx", + password="user_export_xlsx", + groups=( + "base.group_user,base.group_system," + "web_disable_export_group.group_export_xlsx_data" + ), + ) + + def test_admin(self): + self.start_tour("/web", "export_tour_xlsx_button_ok", login="admin") + + def test_user_not_export(self): + self.start_tour("/web", "export_tour_xlsx_button_ko", login="user_not_export") + + def test_user_export_xlsx(self): + self.start_tour("/web", "export_tour_xlsx_button_ok", login="user_export_xlsx") diff --git a/odoo-bringout-oca-web-web_domain_field/README.md b/odoo-bringout-oca-web-web_domain_field/README.md new file mode 100644 index 0000000..53fa637 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/README.md @@ -0,0 +1,46 @@ +# Web Domain Field + +Odoo addon: web_domain_field + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_domain_field +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Web Domain Field +- **Version**: 16.0.1.0.1 +- **Category**: N/A +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_domain_field`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_domain_field/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_domain_field/doc/ARCHITECTURE.md new file mode 100644 index 0000000..41faa34 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_domain_field Module - web_domain_field + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_domain_field/doc/CONFIGURATION.md new file mode 100644 index 0000000..918ccf3 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_domain_field. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_domain_field/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_domain_field/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_domain_field/doc/FAQ.md b/odoo-bringout-oca-web-web_domain_field/doc/FAQ.md new file mode 100644 index 0000000..7e6b38d --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_domain_field or install in UI. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/INSTALL.md b/odoo-bringout-oca-web-web_domain_field/doc/INSTALL.md new file mode 100644 index 0000000..7676b3a --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_domain_field" +# or +uv pip install odoo-bringout-oca-web-web_domain_field" +``` diff --git a/odoo-bringout-oca-web-web_domain_field/doc/MODELS.md b/odoo-bringout-oca-web-web_domain_field/doc/MODELS.md new file mode 100644 index 0000000..820e140 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/MODELS.md @@ -0,0 +1,11 @@ +# Models + +Detected core models and extensions in web_domain_field. + +```mermaid +classDiagram +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_domain_field/doc/OVERVIEW.md new file mode 100644 index 0000000..a0d3fde --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_domain_field. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_domain_field +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_domain_field/doc/REPORTS.md b/odoo-bringout-oca-web-web_domain_field/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/SECURITY.md b/odoo-bringout-oca-web-web_domain_field/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_domain_field/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_domain_field/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_domain_field/doc/USAGE.md b/odoo-bringout-oca-web-web_domain_field/doc/USAGE.md new file mode 100644 index 0000000..cc3db5f --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_domain_field +``` diff --git a/odoo-bringout-oca-web-web_domain_field/doc/WIZARDS.md b/odoo-bringout-oca-web-web_domain_field/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_domain_field/pyproject.toml b/odoo-bringout-oca-web-web_domain_field/pyproject.toml new file mode 100644 index 0000000..649ab5f --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/pyproject.toml @@ -0,0 +1,43 @@ +[project] +name = "odoo-bringout-oca-web-web_domain_field" +version = "16.0.0" +description = "Web Domain Field - + Use computed field as domain" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_domain_field"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/README.rst b/odoo-bringout-oca-web-web_domain_field/web_domain_field/README.rst new file mode 100644 index 0000000..5ad21b8 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/README.rst @@ -0,0 +1,157 @@ +================ +Web Domain Field +================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:38caddd3efd0bf3c90c5b3a84068ef6e757e1bb72698ee16451a62c210e7a154 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_domain_field + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_domain_field + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +.. warning:: + This module is deprecated. + If you want to use this functionality you can assign a unserialised + domain to a fields.Binary, `example `_ + +This technical addon allows developers to specify a field domain in a view +using the value of another field in that view, rather than as a static +XML attribute. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +When you define a view you can specify on the relational fields a domain +attribute. This attribute is evaluated as filter to apply when displaying +existing records for selection. + +.. code-block:: xml + + + +The value provided for the domain attribute must be a string representing a +valid Odoo domain. This string is evaluated on the client side in a +restricted context where we can reference as right operand the values of +fields present into the form and a limited set of functions. + +In this context it's hard to build complex domain and we are facing to some +limitations as: + + * The syntax to include in your domain a criteria involving values from a + x2many field is complex. + * The right side of domain in case of x2many can involve huge amount of ids + (performance problem). + * Domains computed by an onchange on an other field are not recomputed when + you modify the form and don't modify the field triggering the onchange. + * It's not possible to extend an existing domain. You must completely redefine + the domain in your specialized addon + * etc... + +In order to mitigate these limitations this new addon allows you to use the +value of a field as domain of an other field in the xml definition of your +view. + +.. code-block:: xml + + + + +The field used as domain must provide the domain as a JSON encoded string. + +.. code-block:: python + + product_id_domain = fields.Char( + compute="_compute_product_id_domain", + readonly=True, + store=False, + ) + + @api.depends('name') + def _compute_product_id_domain(self): + for rec in self: + rec.product_id_domain = json.dumps( + [('type', '=', 'product'), ('name', 'like', rec.name)] + ) + +.. note:: + You do not actually need this module to craft a dynamic domain. Odoo comes + with its own `py.js `_ + web library to parse expressions such as domains. `py.js` supports more + complex expressions than just static lists. + + Here is an example of a conditional domain based on the value of another + field: + + .. code-block:: python + + (order_id or partner_id) and [('id', 'in', allowed_picking_ids)] + or [('state', '=', 'done'), ('picking_type_id.code', '=', 'outgoing')] + + For OCA modules, this method is preferred over adding this module as an + additional dependency. + +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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Laurent Mignon +* Denis Roussel +* Raf Ven + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/__init__.py b/odoo-bringout-oca-web-web_domain_field/web_domain_field/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/__manifest__.py b/odoo-bringout-oca-web-web_domain_field/web_domain_field/__manifest__.py new file mode 100644 index 0000000..9d0c346 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Domain Field", + "summary": """ + Use computed field as domain""", + "version": "16.0.1.0.1", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "depends": ["web"], + "data": [], + "assets": { + "web.assets_backend": [ + "/web_domain_field/static/lib/js/*.js", + ], + "web.qunit_suite_tests": [ + "/web_domain_field/static/tests/**/*.js", + ], + }, + "installable": True, +} diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/i18n/it.po b/odoo-bringout-oca-web-web_domain_field/web_domain_field/i18n/it.po new file mode 100644 index 0000000..7338855 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/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/odoo-bringout-oca-web-web_domain_field/web_domain_field/i18n/web_domain_field.pot b/odoo-bringout-oca-web-web_domain_field/web_domain_field/i18n/web_domain_field.pot new file mode 100644 index 0000000..78d58d5 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/i18n/web_domain_field.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 16.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/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..1294ec2 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Laurent Mignon +* Denis Roussel +* Raf Ven diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/DESCRIPTION.rst new file mode 100644 index 0000000..830f5b5 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +.. warning:: + This module is deprecated. + If you want to use this functionality you can assign a unserialised + domain to a fields.Binary, `example `_ + +This technical addon allows developers to specify a field domain in a view +using the value of another field in that view, rather than as a static +XML attribute. diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/USAGE.rst b/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/USAGE.rst new file mode 100644 index 0000000..e32b3b7 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/readme/USAGE.rst @@ -0,0 +1,68 @@ +When you define a view you can specify on the relational fields a domain +attribute. This attribute is evaluated as filter to apply when displaying +existing records for selection. + +.. code-block:: xml + + + +The value provided for the domain attribute must be a string representing a +valid Odoo domain. This string is evaluated on the client side in a +restricted context where we can reference as right operand the values of +fields present into the form and a limited set of functions. + +In this context it's hard to build complex domain and we are facing to some +limitations as: + + * The syntax to include in your domain a criteria involving values from a + x2many field is complex. + * The right side of domain in case of x2many can involve huge amount of ids + (performance problem). + * Domains computed by an onchange on an other field are not recomputed when + you modify the form and don't modify the field triggering the onchange. + * It's not possible to extend an existing domain. You must completely redefine + the domain in your specialized addon + * etc... + +In order to mitigate these limitations this new addon allows you to use the +value of a field as domain of an other field in the xml definition of your +view. + +.. code-block:: xml + + + + +The field used as domain must provide the domain as a JSON encoded string. + +.. code-block:: python + + product_id_domain = fields.Char( + compute="_compute_product_id_domain", + readonly=True, + store=False, + ) + + @api.depends('name') + def _compute_product_id_domain(self): + for rec in self: + rec.product_id_domain = json.dumps( + [('type', '=', 'product'), ('name', 'like', rec.name)] + ) + +.. note:: + You do not actually need this module to craft a dynamic domain. Odoo comes + with its own `py.js `_ + web library to parse expressions such as domains. `py.js` supports more + complex expressions than just static lists. + + Here is an example of a conditional domain based on the value of another + field: + + .. code-block:: python + + (order_id or partner_id) and [('id', 'in', allowed_picking_ids)] + or [('state', '=', 'done'), ('picking_type_id.code', '=', 'outgoing')] + + For OCA modules, this method is preferred over adding this module as an + additional dependency. diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/description/icon.png b/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/description/index.html b/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/description/index.html new file mode 100644 index 0000000..7d766b3 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/description/index.html @@ -0,0 +1,497 @@ + + + + + + +Web Domain Field + + + +
+

Web Domain Field

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+
+

Warning

+

This module is deprecated. +If you want to use this functionality you can assign a unserialised +domain to a fields.Binary, example

+
+

This technical addon allows developers to specify a field domain in a view +using the value of another field in that view, rather than as a static +XML attribute.

+

Table of contents

+ +
+

Usage

+

When you define a view you can specify on the relational fields a domain +attribute. This attribute is evaluated as filter to apply when displaying +existing records for selection.

+
+<field name="product_id" domain="[('type','=','product')]"/>
+
+

The value provided for the domain attribute must be a string representing a +valid Odoo domain. This string is evaluated on the client side in a +restricted context where we can reference as right operand the values of +fields present into the form and a limited set of functions.

+

In this context it’s hard to build complex domain and we are facing to some +limitations as:

+
+
    +
  • The syntax to include in your domain a criteria involving values from a +x2many field is complex.
  • +
  • The right side of domain in case of x2many can involve huge amount of ids +(performance problem).
  • +
  • Domains computed by an onchange on an other field are not recomputed when +you modify the form and don’t modify the field triggering the onchange.
  • +
  • It’s not possible to extend an existing domain. You must completely redefine +the domain in your specialized addon
  • +
  • etc…
  • +
+
+

In order to mitigate these limitations this new addon allows you to use the +value of a field as domain of an other field in the xml definition of your +view.

+
+<field name="product_id_domain" invisible="1"/>
+<field name="product_id" domain="product_id_domain"/>
+
+

The field used as domain must provide the domain as a JSON encoded string.

+
+product_id_domain = fields.Char(
+    compute="_compute_product_id_domain",
+    readonly=True,
+    store=False,
+)
+
+@api.depends('name')
+def _compute_product_id_domain(self):
+    for rec in self:
+        rec.product_id_domain = json.dumps(
+            [('type', '=', 'product'), ('name', 'like', rec.name)]
+        )
+
+
+

Note

+

You do not actually need this module to craft a dynamic domain. Odoo comes +with its own py.js +web library to parse expressions such as domains. py.js supports more +complex expressions than just static lists.

+

Here is an example of a conditional domain based on the value of another +field:

+
+(order_id or partner_id) and [('id', 'in', allowed_picking_ids)]
+or [('state', '=', 'done'), ('picking_type_id.code', '=', 'outgoing')]
+
+

For OCA modules, this method is preferred over adding this module as an +additional dependency.

+
+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/tests/test_qunit.js b/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/tests/test_qunit.js new file mode 100644 index 0000000..27a9fdf --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/static/tests/test_qunit.js @@ -0,0 +1,129 @@ +odoo.define("web_domain_field.tests", function (require) { + "use strict"; + + const FormView = require("web.FormView"); + const testUtils = require("web.test_utils"); + const {createView} = testUtils; + const {QUnit} = window; + + QUnit.module( + "web_domain_field", + { + beforeEach: function () { + this.data = { + "res.partner": { + fields: { + name: { + string: "Name", + type: "char", + searchable: true, + }, + type: { + string: "Type", + type: "selection", + selection: [ + ["person", "Person"], + ["company", "Company"], + ], + searchable: true, + }, + parent_id: { + string: "Parent", + type: "many2one", + relation: "res.partner", + }, + parent_domain: { + string: "Parent Domain", + type: "char", + }, + }, + records: [ + { + id: 1, + name: "John Doe", + type: "person", + parent_id: 2, + parent_domain: "[]", + }, + { + id: 2, + name: "ACME inc.", + type: "company", + parent_id: false, + parent_domain: `[["type", "=", "company"]]`, + }, + ], + onchanges: {}, + }, + }; + }, + }, + function () { + QUnit.test( + "one2many: field as domain attribute value", + async function (assert) { + assert.expect(2); + + async function testPartnerFormDomain(data, resId, expectedDomain) { + const form = await createView({ + View: FormView, + model: "res.partner", + data: data, + arch: ` +
+ + + + `, + mockRPC: function (route, args) { + if (args.method === "name_search") { + assert.deepEqual(args.kwargs.args, expectedDomain); + } + return this._super.apply(this, arguments); + }, + res_id: resId, + viewOptions: {mode: "edit"}, + }); + form.$el.find(".o_field_widget[name=parent_id] input").click(); + form.destroy(); + } + + await testPartnerFormDomain(this.data, 1, []); + await testPartnerFormDomain(this.data, 2, [ + ["type", "=", "company"], + ]); + } + ); + + QUnit.test( + "one2many: field with default behaviour", + async function (assert) { + assert.expect(1); + const form = await createView({ + View: FormView, + model: "res.partner", + data: this.data, + arch: ` +
+ + + + `, + mockRPC: function (route, args) { + if (args.method === "name_search") { + assert.deepEqual(args.kwargs.args, [ + ["name", "=", "John"], + ]); + } + return this._super.apply(this, arguments); + }, + res_id: 1, + viewOptions: {mode: "edit"}, + }); + form.$el.find(".o_field_widget[name=parent_id] input").click(); + form.destroy(); + } + ); + } + ); +}); diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/tests/__init__.py b/odoo-bringout-oca-web-web_domain_field/web_domain_field/tests/__init__.py new file mode 100644 index 0000000..d20d305 --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/tests/__init__.py @@ -0,0 +1 @@ +from . import test_qunit diff --git a/odoo-bringout-oca-web-web_domain_field/web_domain_field/tests/test_qunit.py b/odoo-bringout-oca-web-web_domain_field/web_domain_field/tests/test_qunit.py new file mode 100644 index 0000000..7e206dd --- /dev/null +++ b/odoo-bringout-oca-web-web_domain_field/web_domain_field/tests/test_qunit.py @@ -0,0 +1,16 @@ +# Copyright 2022 Camptocamp SA (https://www.camptocamp.com). +# @author Iván Todorovich +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests import HttpCase, tagged + + +@tagged("-at_install", "post_install") +class TestQunit(HttpCase): + def test_qunit(self): + self.browser_js( + "/web/tests?module=web_domain_field&failfast", + "", + "", + login="admin", + ) diff --git a/odoo-bringout-oca-web-web_editor_class_selector/README.md b/odoo-bringout-oca-web-web_editor_class_selector/README.md new file mode 100644 index 0000000..d370e48 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/README.md @@ -0,0 +1,46 @@ +# Web editor class selector + +Odoo addon: web_editor_class_selector + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_editor_class_selector +``` + +## Dependencies + +This addon depends on: +- web_editor + +## Manifest Information + +- **Name**: Web editor class selector +- **Version**: 16.0.1.1.0 +- **Category**: N/A +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_editor_class_selector`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/ARCHITECTURE.md new file mode 100644 index 0000000..7851349 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_editor_class_selector Module - web_editor_class_selector + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/CONFIGURATION.md new file mode 100644 index 0000000..ff6610a --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_editor_class_selector. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/DEPENDENCIES.md new file mode 100644 index 0000000..d52e80a --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web_editor](https://github.com/bringout/oca-ocb-web/tree/d140f04bde3a5b47e6ea0c4ecae4f3d4bcd940cb/odoo-bringout-oca-ocb-web_editor) diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/FAQ.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/FAQ.md new file mode 100644 index 0000000..85b3c2e --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_editor_class_selector or install in UI. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/INSTALL.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/INSTALL.md new file mode 100644 index 0000000..63c06b9 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_editor_class_selector" +# or +uv pip install odoo-bringout-oca-web-web_editor_class_selector" +``` diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/MODELS.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/MODELS.md new file mode 100644 index 0000000..007f210 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/MODELS.md @@ -0,0 +1,12 @@ +# Models + +Detected core models and extensions in web_editor_class_selector. + +```mermaid +classDiagram + class web_editor_class +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/OVERVIEW.md new file mode 100644 index 0000000..250bb61 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_editor_class_selector. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_editor_class_selector +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/REPORTS.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/SECURITY.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/SECURITY.md new file mode 100644 index 0000000..5fe5433 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/SECURITY.md @@ -0,0 +1,34 @@ +# Security + +Access control and security definitions in web_editor_class_selector. + +## Access Control Lists (ACLs) + +Model access permissions defined in: +- **[ir.model.access.csv](../web_editor_class_selector/security/ir.model.access.csv)** + - 2 model access rules + +## Record Rules + +Row-level security rules defined in: + +```mermaid +graph TB + subgraph "Security Layers" + A[Users] --> B[Groups] + B --> C[Access Control Lists] + C --> D[Models] + B --> E[Record Rules] + E --> F[Individual Records] + end +``` + +Security files overview: +- **[ir.model.access.csv](../web_editor_class_selector/security/ir.model.access.csv)** + - Model access permissions (CRUD rights) + +Notes +- Access Control Lists define which groups can access which models +- Record Rules provide row-level security (filter records by user/group) +- Security groups organize users and define permission sets +- All security is enforced at the ORM level by Odoo diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/USAGE.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/USAGE.md new file mode 100644 index 0000000..4bbdfd2 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_editor_class_selector +``` diff --git a/odoo-bringout-oca-web-web_editor_class_selector/doc/WIZARDS.md b/odoo-bringout-oca-web-web_editor_class_selector/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/pyproject.toml b/odoo-bringout-oca-web-web_editor_class_selector/pyproject.toml new file mode 100644 index 0000000..e5424b5 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_editor_class_selector" +version = "16.0.0" +description = "Web editor class selector - " +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web_editor>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_editor_class_selector"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/README.rst b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/README.rst new file mode 100644 index 0000000..15b00d7 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/README.rst @@ -0,0 +1,86 @@ +========================= +Web editor class selector +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c6c160e786b66249a4c30d19eb0204a20ee62766b8197957e1425967cdcc72d6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_editor_class_selector + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_editor_class_selector + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows users to create custom CSS class records, which can then be selected and applied directly in the HTML editor. +Note: The actual CSS file containing the class definitions is not provided by this module and must be loaded in a custom module. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to `Settings` > `Technical` > `User Interface` > `Web editor Class`. +* Create and name your custom CSS classes. +* Go to any model with an HTML field (e.g., `Settings` > `Users` > `Preferences` > `Signature`). +* In the HTML editor, select any content block. +* Choose from the available CSS classes to apply the desired styling. + +Known issues / Roadmap +====================== + +Add support to apply class to any element (currently, only `span` is supported) + +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 +~~~~~~~ + +* Tecnativa + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/__init__.py b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/__manifest__.py b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/__manifest__.py new file mode 100644 index 0000000..2b37b6f --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/__manifest__.py @@ -0,0 +1,32 @@ +{ + "name": "Web editor class selector", + "version": "16.0.1.1.0", + "summary": "", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "depends": [ + "web_editor", + ], + "data": [ + "security/ir.model.access.csv", + "views/web_editor_class_views.xml", + "views/menus.xml", + ], + "demo": [ + "demo/web_editor_class_demo.xml", + ], + "assets": { + "web.assets_backend": [ + "web_editor_class_selector/static/src/js/backend/**/*", + "web_editor_class_selector/static/src/xml/**/", + ], + "web_editor.assets_wysiwyg": [ + "web_editor_class_selector/static/src/js/odoo-editor/**/*", + "web_editor_class_selector/static/src/js/wysiwyg/**/*", + "web_editor_class_selector/static/src/scss/demo_styles.scss", + ], + }, + "installable": True, + "auto_install": False, + "license": "AGPL-3", +} diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/demo/web_editor_class_demo.xml b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/demo/web_editor_class_demo.xml new file mode 100644 index 0000000..a210e93 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/demo/web_editor_class_demo.xml @@ -0,0 +1,17 @@ + + + + + Button + demo_button + + + Menu + demo_menu + + + Field + demo_field + + + diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/bs.po b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/bs.po new file mode 100644 index 0000000..ee0436b --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/bs.po @@ -0,0 +1,115 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_class_selector +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__active +msgid "Active" +msgstr "Aktivan" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__class_name +msgid "Class Name" +msgstr "Naziv klase" + +#. module: web_editor_class_selector +#: model:ir.model.constraint,message:web_editor_class_selector.constraint_web_editor_class_class_name_uniq +msgid "Class name must be unique" +msgstr "Naziv klase mora biti jedinstven" + +#. module: web_editor_class_selector +#: model_terms:ir.actions.act_window,help:web_editor_class_selector.action_web_editor_class +msgid "Click here to add new Web Editor Class." +msgstr "Kliknite ovdje da dodate novu Web Editor klasu." + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_uid +msgid "Created by" +msgstr "Kreirao" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_date +msgid "Created on" +msgstr "Kreirano" + +#. module: web_editor_class_selector +#. odoo-javascript +#: code:addons/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js:0 +#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0 +#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0 +#, python-format +msgid "Custom CSS" +msgstr "Prilagođeni CSS" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__display_name +msgid "Display Name" +msgstr "Prikazani naziv" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__id +msgid "ID" +msgstr "ID" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class____last_update +msgid "Last Modified on" +msgstr "Zadnje mijenjano" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_uid +msgid "Last Updated by" +msgstr "Zadnji ažurirao" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_date +msgid "Last Updated on" +msgstr "Zadnje ažurirano" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__name +msgid "Name" +msgstr "Naziv:" + +#. module: web_editor_class_selector +#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form +msgid "Name..." +msgstr "Naziv..." + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__sequence +msgid "Sequence" +msgstr "Sekvenca" + +#. module: web_editor_class_selector +#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form +msgid "Some CSS class" +msgstr "Neka CSS klasa" + +#. module: web_editor_class_selector +#: model:ir.model.fields,help:web_editor_class_selector.field_web_editor_class__class_name +msgid "" +"The class name to be added to the tag. It must be created in the CSS file." +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.actions.act_window,name:web_editor_class_selector.action_web_editor_class +#: model:ir.ui.menu,name:web_editor_class_selector.web_editor_class_menu +msgid "Web Editor Class" +msgstr "Web Editor klasa" + +#. module: web_editor_class_selector +#: model:ir.model,name:web_editor_class_selector.model_web_editor_class +msgid "Web editor class selector" +msgstr "Web editor selektor klase" diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/it.po b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/it.po new file mode 100644 index 0000000..54fd913 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/it.po @@ -0,0 +1,118 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_class_selector +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-02-20 10:06+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__active +msgid "Active" +msgstr "Attiva" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__class_name +msgid "Class Name" +msgstr "Nome classe" + +#. module: web_editor_class_selector +#: model:ir.model.constraint,message:web_editor_class_selector.constraint_web_editor_class_class_name_uniq +msgid "Class name must be unique" +msgstr "Il nome della classe deve essere univoco" + +#. module: web_editor_class_selector +#: model_terms:ir.actions.act_window,help:web_editor_class_selector.action_web_editor_class +msgid "Click here to add new Web Editor Class." +msgstr "Fare clic qui per aggiungere una nuova classe editor web." + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: web_editor_class_selector +#. odoo-javascript +#: code:addons/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js:0 +#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0 +#, python-format +msgid "Custom CSS" +msgstr "CSS personalizzato" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__id +msgid "ID" +msgstr "ID" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__name +msgid "Name" +msgstr "Nome" + +#. module: web_editor_class_selector +#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form +msgid "Name..." +msgstr "Nome..." + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__sequence +msgid "Sequence" +msgstr "Sequenza" + +#. module: web_editor_class_selector +#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form +msgid "Some CSS class" +msgstr "Qualche classe CSS" + +#. module: web_editor_class_selector +#: model:ir.model.fields,help:web_editor_class_selector.field_web_editor_class__class_name +msgid "" +"The class name to be added to the tag. It must be created in the CSS file." +msgstr "" +"Il nome della classe da aggiungere al tag. Deve essere creata nel file CSS." + +#. module: web_editor_class_selector +#: model:ir.actions.act_window,name:web_editor_class_selector.action_web_editor_class +#: model:ir.ui.menu,name:web_editor_class_selector.web_editor_class_menu +msgid "Web Editor Class" +msgstr "Classe editor web" + +#. module: web_editor_class_selector +#: model:ir.model,name:web_editor_class_selector.model_web_editor_class +msgid "Web editor class selector" +msgstr "Selettore classe editore web" diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/web_editor_class_selector.pot b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/web_editor_class_selector.pot new file mode 100644 index 0000000..ef8f07e --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/i18n/web_editor_class_selector.pot @@ -0,0 +1,115 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_class_selector +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__active +msgid "Active" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__class_name +msgid "Class Name" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.constraint,message:web_editor_class_selector.constraint_web_editor_class_class_name_uniq +msgid "Class name must be unique" +msgstr "" + +#. module: web_editor_class_selector +#: model_terms:ir.actions.act_window,help:web_editor_class_selector.action_web_editor_class +msgid "Click here to add new Web Editor Class." +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_uid +msgid "Created by" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_date +msgid "Created on" +msgstr "" + +#. module: web_editor_class_selector +#. odoo-javascript +#: code:addons/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js:0 +#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0 +#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0 +#, python-format +msgid "Custom CSS" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__display_name +msgid "Display Name" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__id +msgid "ID" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class____last_update +msgid "Last Modified on" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_date +msgid "Last Updated on" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__name +msgid "Name" +msgstr "" + +#. module: web_editor_class_selector +#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form +msgid "Name..." +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__sequence +msgid "Sequence" +msgstr "" + +#. module: web_editor_class_selector +#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form +msgid "Some CSS class" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model.fields,help:web_editor_class_selector.field_web_editor_class__class_name +msgid "" +"The class name to be added to the tag. It must be created in the CSS file." +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.actions.act_window,name:web_editor_class_selector.action_web_editor_class +#: model:ir.ui.menu,name:web_editor_class_selector.web_editor_class_menu +msgid "Web Editor Class" +msgstr "" + +#. module: web_editor_class_selector +#: model:ir.model,name:web_editor_class_selector.model_web_editor_class +msgid "Web editor class selector" +msgstr "" diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/models/__init__.py b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/models/__init__.py new file mode 100644 index 0000000..5b89093 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/models/__init__.py @@ -0,0 +1 @@ +from . import web_editor_class diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/models/web_editor_class.py b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/models/web_editor_class.py new file mode 100644 index 0000000..e7f890b --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/models/web_editor_class.py @@ -0,0 +1,19 @@ +from odoo import fields, models + + +class WebEditorClass(models.Model): + _name = "web.editor.class" + _description = "Web editor class selector" + _order = "sequence,id" + + name = fields.Char(required=True) + sequence = fields.Integer(default=10) + class_name = fields.Char( + required=True, + help="The class name to be added to the tag. It must be created in the CSS file.", + ) + active = fields.Boolean(default=True) + + _sql_constraints = [ + ("class_name_uniq", "unique(class_name)", "Class name must be unique") + ] diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/DESCRIPTION.rst new file mode 100644 index 0000000..72f02ec --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows users to create custom CSS class records, which can then be selected and applied directly in the HTML editor. +Note: The actual CSS file containing the class definitions is not provided by this module and must be loaded in a custom module. \ No newline at end of file diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/ROADMAP.rst b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/ROADMAP.rst new file mode 100644 index 0000000..ef40b9a --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/ROADMAP.rst @@ -0,0 +1 @@ +Add support to apply class to any element (currently, only `span` is supported) \ No newline at end of file diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/USAGE.rst b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/USAGE.rst new file mode 100644 index 0000000..d924287 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/readme/USAGE.rst @@ -0,0 +1,5 @@ +* Go to `Settings` > `Technical` > `User Interface` > `Web editor Class`. +* Create and name your custom CSS classes. +* Go to any model with an HTML field (e.g., `Settings` > `Users` > `Preferences` > `Signature`). +* In the HTML editor, select any content block. +* Choose from the available CSS classes to apply the desired styling. diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/security/ir.model.access.csv b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/security/ir.model.access.csv new file mode 100644 index 0000000..373bd04 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_web_editor_class_group_user,access_web_editor_class_group_user,model_web_editor_class,base.group_user,1,0,0,0 +access_web_editor_class_group_no_one,access_web_editor_class_group_no_one,model_web_editor_class,base.group_no_one,1,1,1,1 diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/description/icon.png b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/description/index.html b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/description/index.html new file mode 100644 index 0000000..e55819c --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/description/index.html @@ -0,0 +1,433 @@ + + + + + +Web editor class selector + + + +
+

Web editor class selector

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module allows users to create custom CSS class records, which can then be selected and applied directly in the HTML editor. +Note: The actual CSS file containing the class definitions is not provided by this module and must be loaded in a custom module.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to Settings > Technical > User Interface > Web editor Class.
  • +
  • Create and name your custom CSS classes.
  • +
  • Go to any model with an HTML field (e.g., Settings > Users > Preferences > Signature).
  • +
  • In the HTML editor, select any content block.
  • +
  • Choose from the available CSS classes to apply the desired styling.
  • +
+
+
+

Known issues / Roadmap

+

Add support to apply class to any element (currently, only span is supported)

+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/backend/html_field.esm.js b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/backend/html_field.esm.js new file mode 100644 index 0000000..7bbbb3d --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/backend/html_field.esm.js @@ -0,0 +1,27 @@ +/** @odoo-module **/ +import {HtmlField} from "@web_editor/js/backend/html_field"; +import {patch} from "@web/core/utils/patch"; +import {useService} from "@web/core/utils/hooks"; + +const {onWillStart} = owl; + +patch(HtmlField.prototype, "web_editor_class_selector.HtmlField", { + setup() { + this._super(...arguments); + this.orm = useService("orm"); + this.custom_class_css = []; + onWillStart(async () => { + this.custom_class_css = await this.orm.searchRead( + "web.editor.class", + [], + ["name", "class_name"] + ); + }); + }, + async startWysiwyg(wysiwyg) { + // Provide the custom class css to the wysiwyg editor + // to render the custom class css in the toolbar + wysiwyg.options.custom_class_css = this.custom_class_css; + return this._super(wysiwyg); + }, +}); diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js new file mode 100644 index 0000000..b7cf068 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js @@ -0,0 +1,68 @@ +/** @odoo-module **/ +import {_t} from "web.core"; +import {patch} from "web.utils"; +import { + closestElement, + getSelectedNodes, + isVisibleTextNode, +} from "@web_editor/js/editor/odoo-editor/src/utils/utils"; +import {OdooEditor} from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; + +patch(OdooEditor.prototype, "web_editor_class_selector.OdooEditor", { + _updateToolbar(show) { + const res = this._super(show); + if (!this.toolbar || !this.custom_class_css) { + return res; + } + const sel = this.document.getSelection(); + if (!this.isSelectionInEditable(sel)) { + return res; + } + // Get selected nodes within td to handle non-p elements like h1, h2... + // Targeting
to ensure span stays inside its corresponding block node. + const selectedNodesInTds = [ + ...this.editable.querySelectorAll(".o_selected_td"), + ].map((node) => closestElement(node).querySelector("br")); + const selectedNodes = getSelectedNodes(this.editable).filter( + (n) => + n.nodeType === Node.TEXT_NODE && + closestElement(n).isContentEditable && + isVisibleTextNode(n) + ); + const selectedTextNodes = selectedNodes.length + ? selectedNodes + : selectedNodesInTds; + let activeLabel = ""; + for (const selectedTextNode of selectedTextNodes) { + const parentNode = selectedTextNode.parentElement; + for (const customCss of this.custom_class_css) { + const button = this.toolbar.querySelector("#" + customCss.class_name); + if (button) { + const isActive = parentNode.classList.contains( + customCss.class_name + ); + button.classList.toggle("active", isActive); + + if (isActive) { + activeLabel = button.textContent; + } + } + } + } + // Show current class active in the toolbar + // or remove active class if nothing is selected + const styleSection = this.toolbar.querySelector("#custom_class"); + if (styleSection) { + if (!activeLabel) { + const css_selectors = this.toolbar.querySelectorAll(".css_selector"); + for (const node of css_selectors) { + node.classList.toggle("active", false); + } + } + styleSection.querySelector("button span").textContent = activeLabel + ? activeLabel + : _t("Custom CSS"); + } + return res; + }, +}); diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/commands.esm.js b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/commands.esm.js new file mode 100644 index 0000000..e04641b --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/commands.esm.js @@ -0,0 +1,12 @@ +/** @odoo-module **/ +import {editorCommands} from "@web_editor/js/editor/odoo-editor/src/commands/commands"; +import {formatSelection} from "@web_editor/js/editor/odoo-editor/src/utils/utils"; + +const newCommands = { + setCustomCss: (editor, ...args) => { + const selectedId = parseInt(args[0], 10); + const record = editor.custom_class_css.find((item) => item.id === selectedId); + formatSelection(editor, record.class_name); + }, +}; +Object.assign(editorCommands, newCommands); diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/utils.esm.js b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/utils.esm.js new file mode 100644 index 0000000..706df13 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/odoo-editor/utils.esm.js @@ -0,0 +1,37 @@ +/** @odoo-module **/ +import { + closestElement, + formatsSpecs, +} from "@web_editor/js/editor/odoo-editor/src/utils/utils"; + +// This function is called in the _configureToolbar method of the Wysiwyg class +// It generates the new formatsSpecs object with the custom CSS class +export function createCustomCssFormats(custom_class_css) { + const newformatsSpecs = {}; + const class_names = custom_class_css.map((customCss) => customCss.class_name); + const removeCustomClass = (node) => { + for (const class_name of class_names) { + node.classList.remove(class_name); + if (node.parentElement) { + node.parentElement.classList.remove(class_name); + } + } + }; + for (const customCss of custom_class_css) { + const className = customCss.class_name; + newformatsSpecs[className] = { + tagName: "span", + isFormatted: (node) => closestElement(node).classList.contains(className), + isTag: (node) => + ["SPAN"].includes(node.tagName) && node.classList.contains(className), + hasStyle: (node) => closestElement(node).classList.contains(className), + addStyle: (node) => { + removeCustomClass(node); + node.classList.add(className); + }, + addNeutralStyle: (node) => removeCustomClass(node), + removeStyle: (node) => removeCustomClass(node), + }; + } + Object.assign(formatsSpecs, newformatsSpecs); +} diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/wysiwyg/wysiwyg.esm.js b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/wysiwyg/wysiwyg.esm.js new file mode 100644 index 0000000..7fa75f0 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/js/wysiwyg/wysiwyg.esm.js @@ -0,0 +1,25 @@ +/** @odoo-module **/ +import Wysiwyg from "web_editor.wysiwyg"; +import core from "web.core"; +import {createCustomCssFormats} from "../odoo-editor/utils.esm"; + +const Qweb = core.qweb; + +Wysiwyg.include({ + _configureToolbar: function (options) { + this._super(options); + if (options.custom_class_css && options.custom_class_css.length > 0) { + const $dialogContent = $( + Qweb.render("web_editor_class_selector.custom_class_css", { + custom_class_css: options.custom_class_css, + }) + ); + $dialogContent.appendTo(this.toolbar.$el); + // Binding the new commands to the editor + // to react to the click on the new options + this.odooEditor.bindExecCommand($dialogContent[0]); + this.odooEditor.custom_class_css = options.custom_class_css; + createCustomCssFormats(options.custom_class_css); + } + }, +}); diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/scss/demo_styles.scss b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/scss/demo_styles.scss new file mode 100644 index 0000000..e0cac6b --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/scss/demo_styles.scss @@ -0,0 +1,21 @@ +.demo_menu { + font-weight: bold; + font-style: italic; + color: #714b67; +} + +.demo_button { + border: 1px solid #71639e; + border-radius: 0.25rem; + padding: 0.25rem 0.7rem; + font-weight: bold; + color: #343a40; + background-color: #dee2e6; + border-color: #dee2e6 !important; +} + +.demo_field { + border-top: 1px solid grey; + border-bottom: 1px solid grey; + font-weight: bold; +} diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/xml/web_editor.xml b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/xml/web_editor.xml new file mode 100644 index 0000000..d930766 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/static/src/xml/web_editor.xml @@ -0,0 +1,33 @@ + + + + + + + + + + diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/views/menus.xml b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/views/menus.xml new file mode 100644 index 0000000..3681b31 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/views/menus.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/views/web_editor_class_views.xml b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/views/web_editor_class_views.xml new file mode 100644 index 0000000..3ff6643 --- /dev/null +++ b/odoo-bringout-oca-web-web_editor_class_selector/web_editor_class_selector/views/web_editor_class_views.xml @@ -0,0 +1,62 @@ + + + + + view.web.editor.class.tree + web.editor.class + + + + + + + + + + + view.web.editor.class.form + web.editor.class + +
+ +
+
+ + + + +
+
+
+
+ + + view.web.editor.class.search + web.editor.class + + + + + + + + + Web Editor Class + ir.actions.act_window + web.editor.class + tree,form + +

+ Click here to add new Web Editor Class. +

+
+
+ +
diff --git a/odoo-bringout-oca-web-web_environment_ribbon/README.md b/odoo-bringout-oca-web-web_environment_ribbon/README.md new file mode 100644 index 0000000..8c0b365 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/README.md @@ -0,0 +1,46 @@ +# Web Environment Ribbon + +Odoo addon: web_environment_ribbon + +## Installation + +```bash +pip install odoo-bringout-oca-web-web_environment_ribbon +``` + +## Dependencies + +This addon depends on: +- web + +## Manifest Information + +- **Name**: Web Environment Ribbon +- **Version**: 16.0.1.0.0 +- **Category**: Web +- **License**: AGPL-3 +- **Installable**: True + +## Source + +Based on [OCA/web](https://github.com/OCA/web) branch 16.0, addon `web_environment_ribbon`. + +## License + +This package maintains the original AGPL-3 license from the upstream Odoo project. + +## Documentation + +- Overview: doc/OVERVIEW.md +- Architecture: doc/ARCHITECTURE.md +- Models: doc/MODELS.md +- Controllers: doc/CONTROLLERS.md +- Wizards: doc/WIZARDS.md +- Reports: doc/REPORTS.md +- Security: doc/SECURITY.md +- Install: doc/INSTALL.md +- Usage: doc/USAGE.md +- Configuration: doc/CONFIGURATION.md +- Dependencies: doc/DEPENDENCIES.md +- Troubleshooting: doc/TROUBLESHOOTING.md +- FAQ: doc/FAQ.md diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/ARCHITECTURE.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/ARCHITECTURE.md new file mode 100644 index 0000000..43ddc08 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/ARCHITECTURE.md @@ -0,0 +1,32 @@ +# Architecture + +```mermaid +flowchart TD + U[Users] -->|HTTP| V[Views and QWeb Templates] + V --> C[Controllers] + V --> W[Wizards – Transient Models] + C --> M[Models and ORM] + W --> M + M --> R[Reports] + DX[Data XML] --> M + S[Security – ACLs and Groups] -. enforces .-> M + + subgraph Web_environment_ribbon Module - web_environment_ribbon + direction LR + M:::layer + W:::layer + C:::layer + V:::layer + R:::layer + S:::layer + DX:::layer + end + + classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px +``` + +Notes +- Views include tree/form/kanban templates and report templates. +- Controllers provide website/portal routes when present. +- Wizards are UI flows implemented with `models.TransientModel`. +- Data XML loads data/demo records; Security defines groups and access. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/CONFIGURATION.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/CONFIGURATION.md new file mode 100644 index 0000000..7811b7f --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/CONFIGURATION.md @@ -0,0 +1,3 @@ +# Configuration + +Refer to Odoo settings for web_environment_ribbon. Configure related models, access rights, and options as needed. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/CONTROLLERS.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/CONTROLLERS.md new file mode 100644 index 0000000..f628e77 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/CONTROLLERS.md @@ -0,0 +1,3 @@ +# Controllers + +This module does not define custom HTTP controllers. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/DEPENDENCIES.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/DEPENDENCIES.md new file mode 100644 index 0000000..b3b749a --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/DEPENDENCIES.md @@ -0,0 +1,5 @@ +# Dependencies + +This addon depends on: + +- [web](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-web) diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/FAQ.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/FAQ.md new file mode 100644 index 0000000..e3ddd4c --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged). +- Q: How to enable? A: Start server with --addon web_environment_ribbon or install in UI. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/INSTALL.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/INSTALL.md new file mode 100644 index 0000000..dd55b1a --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/INSTALL.md @@ -0,0 +1,7 @@ +# Install + +```bash +pip install odoo-bringout-oca-web-web_environment_ribbon" +# or +uv pip install odoo-bringout-oca-web-web_environment_ribbon" +``` diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/MODELS.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/MODELS.md new file mode 100644 index 0000000..1383ac6 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/MODELS.md @@ -0,0 +1,12 @@ +# Models + +Detected core models and extensions in web_environment_ribbon. + +```mermaid +classDiagram + class web_environment_ribbon_backend +``` + +Notes +- Classes show model technical names; fields omitted for brevity. +- Items listed under _inherit are extensions of existing models. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/OVERVIEW.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/OVERVIEW.md new file mode 100644 index 0000000..af5313a --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/OVERVIEW.md @@ -0,0 +1,6 @@ +# Overview + +Packaged Odoo addon: web_environment_ribbon. Provides features documented in upstream Odoo 16 under this addon. + +- Source: OCA/OCB 16.0, addon web_environment_ribbon +- License: LGPL-3 diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/REPORTS.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/REPORTS.md new file mode 100644 index 0000000..e0ea35f --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/REPORTS.md @@ -0,0 +1,3 @@ +# Reports + +This module does not define custom reports. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/SECURITY.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/SECURITY.md new file mode 100644 index 0000000..e07da9d --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/SECURITY.md @@ -0,0 +1,8 @@ +# Security + +This module does not define custom security rules or access controls beyond Odoo defaults. + +Default Odoo security applies: +- Base user access through standard groups +- Model access inherited from dependencies +- No custom row-level security rules diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/TROUBLESHOOTING.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/TROUBLESHOOTING.md new file mode 100644 index 0000000..56853cb --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/TROUBLESHOOTING.md @@ -0,0 +1,5 @@ +# Troubleshooting + +- Ensure Python and Odoo environment matches repo guidance. +- Check database connectivity and logs if startup fails. +- Validate that dependent addons listed in DEPENDENCIES.md are installed. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/USAGE.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/USAGE.md new file mode 100644 index 0000000..8c58ffd --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/USAGE.md @@ -0,0 +1,7 @@ +# Usage + +Start Odoo including this addon (from repo root): + +```bash +python3 scripts/nix_odoo_web_server.py --db-name mydb --addon web_environment_ribbon +``` diff --git a/odoo-bringout-oca-web-web_environment_ribbon/doc/WIZARDS.md b/odoo-bringout-oca-web-web_environment_ribbon/doc/WIZARDS.md new file mode 100644 index 0000000..48e790d --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/doc/WIZARDS.md @@ -0,0 +1,3 @@ +# Wizards + +This module does not include UI wizards. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/pyproject.toml b/odoo-bringout-oca-web-web_environment_ribbon/pyproject.toml new file mode 100644 index 0000000..51e91af --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "odoo-bringout-oca-web-web_environment_ribbon" +version = "16.0.0" +description = "Web Environment Ribbon - Odoo addon" +authors = [ + { name = "Ernad Husremovic", email = "hernad@bring.out.ba" } +] +dependencies = [ + "odoo-bringout-oca-ocb-web>=16.0.0", + "requests>=2.25.1" +] +readme = "README.md" +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Office/Business", +] + +[project.urls] +homepage = "https://github.com/bringout/0" +repository = "https://github.com/bringout/0" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["web_environment_ribbon"] + +[tool.rye] +managed = true +dev-dependencies = [ + "pytest>=8.4.1", +] diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/README.rst b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/README.rst new file mode 100644 index 0000000..9d86098 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/README.rst @@ -0,0 +1,101 @@ +====================== +Web Environment Ribbon +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f15d70ea4272155560e696d4677c06aac24b47b303f75ea305d9c4e5a3991476 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/web_environment_ribbon + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_environment_ribbon + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Mark a Test Environment with a red ribbon on the top left corner in every page + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +* You can change the ribbon's name ("TEST") by editing the default system + parameter "ribbon.name" (in the menu Settings > Parameters > System + Parameters) To hide the ribbon, set this parameter to "False" or delete it. +* You can customize the ribbon color and background color through system + parameters: "ribbon.color", "ribbon.background.color". Fill with valid CSS + colors or just set to "False" to use default values. +* You can add the database name in the ribbon by adding "{db_name}" in the + system parameter "ribbon.name". + +Usage +===== + +To use this module, you need only to install it. After installation, a red +ribbon will be visible on top left corner of every Odoo backend page + +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 +~~~~~~~ + +* Francesco OpenCode Apruzzese +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Francesco Apruzzese +* Javi Melendez +* Antonio Espinosa +* Thomas Binsfeld +* Xavier Jiménez +* Dennis Sluijk +* Eric Lembregts + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/__init__.py b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/__manifest__.py b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/__manifest__.py new file mode 100644 index 0000000..9d99f18 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/__manifest__.py @@ -0,0 +1,27 @@ +# Copyright 2015 Francesco OpenCode Apruzzese +# Copyright 2016 Antonio Espinosa +# Copyright 2017 Thomas Binsfeld +# Copyright 2017 Xavier Jiménez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Environment Ribbon", + "version": "16.0.1.0.0", + "category": "Web", + "author": "Francesco OpenCode Apruzzese, " + "Tecnativa, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "license": "AGPL-3", + "depends": ["web"], + "data": [ + "data/ribbon_data.xml", + ], + "auto_install": False, + "installable": True, + "assets": { + "web.assets_common": [ + "web_environment_ribbon/static/**/*", + ], + }, +} diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/data/ribbon_data.xml b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/data/ribbon_data.xml new file mode 100644 index 0000000..72a5024 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/data/ribbon_data.xml @@ -0,0 +1,20 @@ + + + + + + ribbon.name + ({db_name})]]> + + + + ribbon.color + #f0f0f0 + + + + ribbon.background.color + rgba(255,0,0,.6) + + diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/bs.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/bs.po new file mode 100644 index 0000000..2377695 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/bs.po @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Pozadina trake okoline" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/ca.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/ca.po new file mode 100644 index 0000000..57a4eb2 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/ca.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-02 22:13+0000\n" +"Last-Translator: eduardgm \n" +"Language-Team: none\n" +"Language: ca\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" +"X-Generator: Weblate 3.10\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Backend \"Web Environment Ribbon\"" + +#~ msgid "Display Name" +#~ msgstr "Nom mostrat" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificació el" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/de.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/de.po new file mode 100644 index 0000000..f89b15d --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/de.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2020-07-22 12:19+0000\n" +"Last-Translator: c2cdidier \n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\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" +"X-Generator: Weblate 3.10\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Web-Umgebung Ribbon-Backend" + +#~ msgid "Display Name" +#~ msgstr "Anzeigename" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Zuletzt geändert am" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/es.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/es.po new file mode 100644 index 0000000..39ffdbe --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/es.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-08-04 17:44+0000\n" +"Last-Translator: eduardgm \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 3.7.1\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Backend \"Web Environment Ribbon\"" + +#~ msgid "Display Name" +#~ msgstr "Nombre mostrado" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación el" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/fr.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/fr.po new file mode 100644 index 0000000..905b8dc --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/fr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# OCA Transbot , 2017 +# Quentin THEURET , 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 , 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_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Backend du bandeau de l'environnement Web" + +#~ msgid "Display Name" +#~ msgstr "Nom affiché" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/hr.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/hr.po new file mode 100644 index 0000000..25ce1d7 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/hr.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2023-01-04 02:41+0000\n" +"Last-Translator: Bole \n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Pozadina trake okoline" + +#~ msgid "Display Name" +#~ msgstr "Naziv za prikaz" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Zadnje modificirano" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/it.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/it.po new file mode 100644 index 0000000..7dda6ec --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/it.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:34+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Nastro ambiente web backend" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/nl.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/nl.po new file mode 100644 index 0000000..16b808e --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/nl.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-17 20:47+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Web Environment Ribbon Backend" + +#~ msgid "Display Name" +#~ msgstr "Weergavenaam" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Laatst Gewijzigd op" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/nl_NL.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/nl_NL.po new file mode 100644 index 0000000..4db8e2b --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/nl_NL.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2021-04-22 15:47+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Weergavenaam" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Laatst bijgewerkt op" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/pt.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/pt.po new file mode 100644 index 0000000..9a8c210 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/pt.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-08-12 11:44+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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" +"X-Generator: Weblate 3.7.1\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Nome a Exibir" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificação em" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/pt_BR.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/pt_BR.po new file mode 100644 index 0000000..5af7c82 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/pt_BR.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Rodrigo de Almeida Sottomaior Macedo , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2018-08-03 12:34+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\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" +"X-Generator: Weblate 3.1.1\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Back-end da fita do ambiente da Web" + +#~ msgid "Display Name" +#~ msgstr "Exibir Nome" + +#~ msgid "ID" +#~ msgstr "Identificação" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificação em" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/sl.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/sl.po new file mode 100644 index 0000000..59a7d9f --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/sl.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2017-07-13 16:06+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" + +#~ msgid "ID" +#~ msgstr "ID" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/web_environment_ribbon.pot b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/web_environment_ribbon.pot new file mode 100644 index 0000000..57b0824 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/web_environment_ribbon.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/zh.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/zh.po new file mode 100644 index 0000000..0a6c105 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/zh.po @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +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: zh\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/zh_CN.po b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/zh_CN.po new file mode 100644 index 0000000..f5a4fd3 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/i18n/zh_CN.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 12:52+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Web环境功能区后台" + +#~ msgid "Display Name" +#~ msgstr "显示名称" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "最后修改时间" diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/models/__init__.py b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/models/__init__.py new file mode 100644 index 0000000..18368b4 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/models/__init__.py @@ -0,0 +1 @@ +from . import web_environment_ribbon_backend diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/models/web_environment_ribbon_backend.py b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/models/web_environment_ribbon_backend.py new file mode 100644 index 0000000..5932d7b --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/models/web_environment_ribbon_backend.py @@ -0,0 +1,36 @@ +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class WebEnvironmentRibbonBackend(models.AbstractModel): + + _name = "web.environment.ribbon.backend" + _description = "Web Environment Ribbon Backend" + + @api.model + def _prepare_ribbon_format_vals(self): + return {"db_name": self.env.cr.dbname} + + @api.model + def _prepare_ribbon_name(self): + name_tmpl = self.env["ir.config_parameter"].sudo().get_param("ribbon.name") + vals = self._prepare_ribbon_format_vals() + return name_tmpl and name_tmpl.format(**vals) or name_tmpl + + @api.model + def get_environment_ribbon(self): + """ + This method returns the ribbon data from ir config parameters + :return: dictionary + """ + ir_config_model = self.env["ir.config_parameter"] + name = self._prepare_ribbon_name() + return { + "name": name, + "color": ir_config_model.sudo().get_param("ribbon.color"), + "background_color": ir_config_model.sudo().get_param( + "ribbon.background.color" + ), + } diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/CONFIGURE.rst b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/CONFIGURE.rst new file mode 100644 index 0000000..8542c72 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/CONFIGURE.rst @@ -0,0 +1,8 @@ +* You can change the ribbon's name ("TEST") by editing the default system + parameter "ribbon.name" (in the menu Settings > Parameters > System + Parameters) To hide the ribbon, set this parameter to "False" or delete it. +* You can customize the ribbon color and background color through system + parameters: "ribbon.color", "ribbon.background.color". Fill with valid CSS + colors or just set to "False" to use default values. +* You can add the database name in the ribbon by adding "{db_name}" in the + system parameter "ribbon.name". diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/CONTRIBUTORS.rst b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..257e450 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Francesco Apruzzese +* Javi Melendez +* Antonio Espinosa +* Thomas Binsfeld +* Xavier Jiménez +* Dennis Sluijk +* Eric Lembregts diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/DESCRIPTION.rst b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/DESCRIPTION.rst new file mode 100644 index 0000000..c52ab9b --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Mark a Test Environment with a red ribbon on the top left corner in every page diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/USAGE.rst b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/USAGE.rst new file mode 100644 index 0000000..408d88c --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/readme/USAGE.rst @@ -0,0 +1,2 @@ +To use this module, you need only to install it. After installation, a red +ribbon will be visible on top left corner of every Odoo backend page diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/icon.png b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/icon.png new file mode 100644 index 0000000..78b52ae Binary files /dev/null and b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/icon.png differ diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/index.html b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/index.html new file mode 100644 index 0000000..66bc30b --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/index.html @@ -0,0 +1,448 @@ + + + + + + +Web Environment Ribbon + + + +
+

Web Environment Ribbon

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

Mark a Test Environment with a red ribbon on the top left corner in every page

+

Table of contents

+ +
+

Configuration

+
    +
  • You can change the ribbon’s name (“TEST”) by editing the default system +parameter “ribbon.name” (in the menu Settings > Parameters > System +Parameters) To hide the ribbon, set this parameter to “False” or delete it.
  • +
  • You can customize the ribbon color and background color through system +parameters: “ribbon.color”, “ribbon.background.color”. Fill with valid CSS +colors or just set to “False” to use default values.
  • +
  • You can add the database name in the ribbon by adding “{db_name}” in the +system parameter “ribbon.name”.
  • +
+
+
+

Usage

+

To use this module, you need only to install it. After installation, a red +ribbon will be visible on top left corner of every Odoo backend page

+
+
+

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

+
    +
  • Francesco OpenCode Apruzzese
  • +
  • Tecnativa
  • +
+
+
+

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.

+

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/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/screenshot.png b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/screenshot.png new file mode 100644 index 0000000..3024565 Binary files /dev/null and b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/description/screenshot.png differ diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/src/css/ribbon.css b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/src/css/ribbon.css new file mode 100644 index 0000000..cbf4a40 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/src/css/ribbon.css @@ -0,0 +1,36 @@ +/* Copyright 2015 Francesco OpenCode Apruzzese + Copyright 2017 Thomas Binsfeld + Copyright 2021 Andreas Perhab + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +.test-ribbon { + width: 300px; + top: 25px; + left: -100px; + text-align: center; + padding: 10px; + line-height: 20px; + letter-spacing: 1px; + color: #f0f0f0; + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); + z-index: 9999; + position: fixed; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); + background: rgba(255, 0, 0, 0.6); + pointer-events: none; +} + +.test-ribbon b { + font-size: 20px; +} + +header:hover ~ .test-ribbon, +nav:hover ~ .test-ribbon { + /* Ease out ribbon when user is using the navigation in Odoo */ + opacity: 0; + transition: 0.2s ease; +} diff --git a/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/src/js/ribbon.js b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/src/js/ribbon.js new file mode 100644 index 0000000..67a4571 --- /dev/null +++ b/odoo-bringout-oca-web-web_environment_ribbon/web_environment_ribbon/static/src/js/ribbon.js @@ -0,0 +1,62 @@ +/* Copyright 2015 Sylvain Calador + Copyright 2015 Javi Melendez + Copyright 2016 Antonio Espinosa + Copyright 2017 Thomas Binsfeld + Copyright 2017 Xavier Jiménez + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define("web_environment_ribbon.ribbon", function (require) { + "use strict"; + var rpc = require("web.rpc"); + var core = require("web.core"); + + // Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/ + function validStrColour(strToTest) { + if (strToTest === "") { + return false; + } + if (strToTest === "inherit") { + return true; + } + if (strToTest === "transparent") { + return true; + } + var image = document.createElement("img"); + image.style.color = "rgb(0, 0, 0)"; + image.style.color = strToTest; + if (image.style.color !== "rgb(0, 0, 0)") { + return true; + } + image.style.color = "rgb(255, 255, 255)"; + image.style.color = strToTest; + return image.style.color !== "rgb(255, 255, 255)"; + } + + core.bus.on("web_client_ready", null, function () { + var ribbon = $('