diff --git a/pos_screen_element_custom_size/README.rst b/pos_screen_element_custom_size/README.rst new file mode 100644 index 0000000000..0475cb1b9e --- /dev/null +++ b/pos_screen_element_custom_size/README.rst @@ -0,0 +1,112 @@ +=============================== +POS Screen Elements Custom Size +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:710a3bce85eb1c23dbd7d520cc50d67f82dda4197a94df95ea0be680bb9a141d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/17.0/pos_screen_element_custom_size + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_screen_element_custom_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/pos&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to define custom size values for certain POS screen +elements. + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +POS can be run on different devices with different screen size and +resolution. By default all elements will be automatically scaled to fit +the device screen properly. However sometimes there might be some issues +like product captions do not fit into the tile or product picture looks +too small. + +Configuration +============= + +Go to **POS** -> **Configuration** -> **Settings** select a POS and +scroll down to the **POS Screen Custom Settings** section. + +Configure custom screen settings for selected POS. Leave fields blank to +use the standard values: + +- Product Tile Min Width: Minimum width of the product tile in pixels +- Product Text Font Size: Custom font size of the product name label +- Price Tag Font Size: Custom font size of the price label + +Usage +===== + +Just load POS as usual. Custom interface settings will be applied based +on configuration. + +Known issues / Roadmap +====================== + +TODO: add more settings by inheriting and extending this module. + +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 +------- + +* Cetmix + +Contributors +------------ + +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +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/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_screen_element_custom_size/__init__.py b/pos_screen_element_custom_size/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_screen_element_custom_size/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_screen_element_custom_size/__manifest__.py b/pos_screen_element_custom_size/__manifest__.py new file mode 100644 index 0000000000..d57e200266 --- /dev/null +++ b/pos_screen_element_custom_size/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "POS Screen Elements Custom Size", + "version": "17.0.1.0.0", + "category": "Sales/Point of Sale", + "summary": "Set custom size for POS screen elements", + "license": "AGPL-3", + "website": "https://github.com/OCA/pos", + "author": "Cetmix, Odoo Community Association (OCA)", + "depends": ["point_of_sale"], + "data": [ + "views/res_config_settings_views.xml", + ], + "images": [], + "assets": { + "point_of_sale._assets_pos": [ + "pos_screen_element_custom_size/static/src/js/*.js", + "pos_screen_element_custom_size/static/src/xml/*.xml", + ], + }, + "installable": True, +} diff --git a/pos_screen_element_custom_size/i18n/it.po b/pos_screen_element_custom_size/i18n/it.po new file mode 100644 index 0000000000..d74e8c2500 --- /dev/null +++ b/pos_screen_element_custom_size/i18n/it.po @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_screen_element_custom_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-07-08 11:58+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: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "pixel" +msgstr "pixel" + +#. module: pos_screen_element_custom_size +#: model:ir.model,name:pos_screen_element_custom_size.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Custom font size of the price label" +msgstr "Dimensione carattere personalizzata dell'etichetta prezzo" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Custom font size of the product name label" +msgstr "Dimensione carattere personalizzata dell'etichetta nome prodotto" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Minimum width of the product tile in pixels" +msgstr "Larghezza minima in pixel del titolo prodotto" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "POS Screen Custom Settings" +msgstr "Impostazioni personalizzate schermo POS" + +#. module: pos_screen_element_custom_size +#: model:ir.model,name:pos_screen_element_custom_size.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configurazione punto vendita" + +#. module: pos_screen_element_custom_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_pos_config__price_tag_font_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_res_config_settings__pos_price_tag_font_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Price Tag Font Size" +msgstr "Dimensione carattere etichetta prezzo" + +#. module: pos_screen_element_custom_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_pos_config__product_text_font_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_res_config_settings__pos_product_text_font_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Product Text Font Size" +msgstr "Dimensione carattere testo prodotto" + +#. module: pos_screen_element_custom_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_pos_config__product_title_min_width +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_res_config_settings__pos_product_title_min_width +msgid "Product Title Min Width" +msgstr "Larghezza minima titolo prodotto" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Product Title Mini Width" +msgstr "Larghezza minima titolo prodotto" diff --git a/pos_screen_element_custom_size/i18n/pos_screen_element_custom_size.pot b/pos_screen_element_custom_size/i18n/pos_screen_element_custom_size.pot new file mode 100644 index 0000000000..c27134c593 --- /dev/null +++ b/pos_screen_element_custom_size/i18n/pos_screen_element_custom_size.pot @@ -0,0 +1,74 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_screen_element_custom_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: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "pixel" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model:ir.model,name:pos_screen_element_custom_size.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Custom font size of the price label" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Custom font size of the product name label" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Minimum width of the product tile in pixels" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "POS Screen Custom Settings" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model:ir.model,name:pos_screen_element_custom_size.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_pos_config__price_tag_font_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_res_config_settings__pos_price_tag_font_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Price Tag Font Size" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_pos_config__product_text_font_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_res_config_settings__pos_product_text_font_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Product Text Font Size" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_pos_config__product_title_min_width +#: model:ir.model.fields,field_description:pos_screen_element_custom_size.field_res_config_settings__pos_product_title_min_width +msgid "Product Title Min Width" +msgstr "" + +#. module: pos_screen_element_custom_size +#: model_terms:ir.ui.view,arch_db:pos_screen_element_custom_size.res_config_settings_view_form +msgid "Product Title Mini Width" +msgstr "" diff --git a/pos_screen_element_custom_size/models/__init__.py b/pos_screen_element_custom_size/models/__init__.py new file mode 100644 index 0000000000..2b92809a3b --- /dev/null +++ b/pos_screen_element_custom_size/models/__init__.py @@ -0,0 +1,2 @@ +from . import pos_config +from . import res_config_settings diff --git a/pos_screen_element_custom_size/models/pos_config.py b/pos_screen_element_custom_size/models/pos_config.py new file mode 100644 index 0000000000..b6166fc7e6 --- /dev/null +++ b/pos_screen_element_custom_size/models/pos_config.py @@ -0,0 +1,12 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = "pos.config" + + product_title_min_width = fields.Integer(default=122) + product_text_font_size = fields.Integer(default=12) + price_tag_font_size = fields.Integer(default=12) diff --git a/pos_screen_element_custom_size/models/res_config_settings.py b/pos_screen_element_custom_size/models/res_config_settings.py new file mode 100644 index 0000000000..0181ca47d8 --- /dev/null +++ b/pos_screen_element_custom_size/models/res_config_settings.py @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + pos_product_title_min_width = fields.Integer( + related="pos_config_id.product_title_min_width", readonly=False + ) + pos_product_text_font_size = fields.Integer( + related="pos_config_id.product_text_font_size", readonly=False + ) + pos_price_tag_font_size = fields.Integer( + related="pos_config_id.price_tag_font_size", readonly=False + ) diff --git a/pos_screen_element_custom_size/pyproject.toml b/pos_screen_element_custom_size/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_screen_element_custom_size/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_screen_element_custom_size/readme/CONFIGURE.md b/pos_screen_element_custom_size/readme/CONFIGURE.md new file mode 100644 index 0000000000..fa1eae935a --- /dev/null +++ b/pos_screen_element_custom_size/readme/CONFIGURE.md @@ -0,0 +1,7 @@ +Go to **POS** -> **Configuration** -> **Settings** select a POS and scroll down to the **POS Screen Custom Settings** section. + +Configure custom screen settings for selected POS. Leave fields blank to use the standard values: + +* Product Tile Min Width: Minimum width of the product tile in pixels +* Product Text Font Size: Custom font size of the product name label +* Price Tag Font Size: Custom font size of the price label diff --git a/pos_screen_element_custom_size/readme/CONTEXT.md b/pos_screen_element_custom_size/readme/CONTEXT.md new file mode 100644 index 0000000000..ab91c31ed8 --- /dev/null +++ b/pos_screen_element_custom_size/readme/CONTEXT.md @@ -0,0 +1,3 @@ +POS can be run on different devices with different screen size and resolution. +By default all elements will be automatically scaled to fit the device screen properly. +However sometimes there might be some issues like product captions do not fit into the tile or product picture looks too small. diff --git a/pos_screen_element_custom_size/readme/CONTRIBUTORS.md b/pos_screen_element_custom_size/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..2f6060845e --- /dev/null +++ b/pos_screen_element_custom_size/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/pos_screen_element_custom_size/readme/DESCRIPTION.md b/pos_screen_element_custom_size/readme/DESCRIPTION.md new file mode 100644 index 0000000000..461636d11e --- /dev/null +++ b/pos_screen_element_custom_size/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to define custom size values for certain POS screen elements. diff --git a/pos_screen_element_custom_size/readme/ROADMAP.md b/pos_screen_element_custom_size/readme/ROADMAP.md new file mode 100644 index 0000000000..ce7aef0bc9 --- /dev/null +++ b/pos_screen_element_custom_size/readme/ROADMAP.md @@ -0,0 +1,2 @@ +TODO: add more settings by inheriting and extending this module. + diff --git a/pos_screen_element_custom_size/readme/USAGE.md b/pos_screen_element_custom_size/readme/USAGE.md new file mode 100644 index 0000000000..33594bc4fe --- /dev/null +++ b/pos_screen_element_custom_size/readme/USAGE.md @@ -0,0 +1 @@ +Just load POS as usual. Custom interface settings will be applied based on configuration. diff --git a/pos_screen_element_custom_size/static/description/icon.png b/pos_screen_element_custom_size/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_screen_element_custom_size/static/description/icon.png differ diff --git a/pos_screen_element_custom_size/static/description/index.html b/pos_screen_element_custom_size/static/description/index.html new file mode 100644 index 0000000000..5d18d434c6 --- /dev/null +++ b/pos_screen_element_custom_size/static/description/index.html @@ -0,0 +1,460 @@ + + + + + +POS Screen Elements Custom Size + + + +
+

POS Screen Elements Custom Size

+ + +

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

+

This module allows to define custom size values for certain POS screen +elements.

+

Table of contents

+ +
+

Use Cases / Context

+

POS can be run on different devices with different screen size and +resolution. By default all elements will be automatically scaled to fit +the device screen properly. However sometimes there might be some issues +like product captions do not fit into the tile or product picture looks +too small.

+
+
+

Configuration

+

Go to POS -> Configuration -> Settings select a POS and +scroll down to the POS Screen Custom Settings section.

+

Configure custom screen settings for selected POS. Leave fields blank to +use the standard values:

+
    +
  • Product Tile Min Width: Minimum width of the product tile in pixels
  • +
  • Product Text Font Size: Custom font size of the product name label
  • +
  • Price Tag Font Size: Custom font size of the price label
  • +
+
+
+

Usage

+

Just load POS as usual. Custom interface settings will be applied based +on configuration.

+
+
+

Known issues / Roadmap

+

TODO: add more settings by inheriting and extending this module.

+
+
+

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

+
    +
  • Cetmix
  • +
+
+
+

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/pos project on GitHub.

+

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

+
+
+
+ + diff --git a/pos_screen_element_custom_size/static/src/js/ProductCard.esm.js b/pos_screen_element_custom_size/static/src/js/ProductCard.esm.js new file mode 100644 index 0000000000..a052cf51c8 --- /dev/null +++ b/pos_screen_element_custom_size/static/src/js/ProductCard.esm.js @@ -0,0 +1,12 @@ +/** @odoo-module */ + +import {ProductCard} from "@point_of_sale/app/generic_components/product_card/product_card"; +import {usePos} from "@point_of_sale/app/store/pos_hook"; +import {patch} from "@web/core/utils/patch"; + +patch(ProductCard.prototype, { + setup() { + super.setup(); + this.pos = usePos(); + }, +}); diff --git a/pos_screen_element_custom_size/static/src/xml/ProductCard.xml b/pos_screen_element_custom_size/static/src/xml/ProductCard.xml new file mode 100644 index 0000000000..23f112bb12 --- /dev/null +++ b/pos_screen_element_custom_size/static/src/xml/ProductCard.xml @@ -0,0 +1,17 @@ + + + + + + + font-size: {{pos.config.product_text_font_size or 12}}px !important; + + + + + font-size: {{this.pos.config.price_tag_font_size or 12}}px !important; + + + + + diff --git a/pos_screen_element_custom_size/static/src/xml/ProductsWidget.xml b/pos_screen_element_custom_size/static/src/xml/ProductsWidget.xml new file mode 100644 index 0000000000..f4790903ec --- /dev/null +++ b/pos_screen_element_custom_size/static/src/xml/ProductsWidget.xml @@ -0,0 +1,15 @@ + + + + + + + grid-template-columns: repeat(auto-fill, minmax({{pos.config.product_title_min_width or 122 }}px, 1fr)) !important; + + + + + diff --git a/pos_screen_element_custom_size/views/res_config_settings_views.xml b/pos_screen_element_custom_size/views/res_config_settings_views.xml new file mode 100644 index 0000000000..412e2eaa68 --- /dev/null +++ b/pos_screen_element_custom_size/views/res_config_settings_views.xml @@ -0,0 +1,68 @@ + + + + + res.config.settings.inherited.view + res.config.settings + + + +

POS Screen Custom Settings

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +