diff --git a/pos_default_empty_image/__manifest__.py b/pos_default_empty_image/__manifest__.py index eb2ae81f..18c5dd99 100644 --- a/pos_default_empty_image/__manifest__.py +++ b/pos_default_empty_image/__manifest__.py @@ -13,6 +13,7 @@ ], 'data': [ 'views/templates.xml', + 'views/pos_config.xml', ], 'qweb': [ 'static/src/xml/pos_default_empty_image.xml', diff --git a/pos_default_empty_image/models/__init__.py b/pos_default_empty_image/models/__init__.py index 5c74c8c3..e3f12dd5 100644 --- a/pos_default_empty_image/models/__init__.py +++ b/pos_default_empty_image/models/__init__.py @@ -1 +1,2 @@ +from . import pos_config from . import product_product diff --git a/pos_default_empty_image/models/pos_config.py b/pos_default_empty_image/models/pos_config.py new file mode 100644 index 00000000..1acbec4f --- /dev/null +++ b/pos_default_empty_image/models/pos_config.py @@ -0,0 +1,16 @@ +# Copyright (C) 2020 - Today: +# GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + iface_fixed_font_size = fields.Integer( + string="Fixed Font Size", + help="Font size of the product name, when it has no image." + " Set '0' will set adaptative font-size, depending on the" + " length of the name.") diff --git a/pos_default_empty_image/readme/CONFIGURATION.rst b/pos_default_empty_image/readme/CONFIGURATION.rst new file mode 100644 index 00000000..5773b00a --- /dev/null +++ b/pos_default_empty_image/readme/CONFIGURATION.rst @@ -0,0 +1,7 @@ +* Go to your PoS Configuration + + .. figure:: ../static/description/pos_config_form.png + +* Select the font size used to display product name, when there is no image. + +* If not set, the font size will depend on the name length. diff --git a/pos_default_empty_image/static/description/pos_config_form.png b/pos_default_empty_image/static/description/pos_config_form.png new file mode 100644 index 00000000..e6f0ebc5 Binary files /dev/null and b/pos_default_empty_image/static/description/pos_config_form.png differ diff --git a/pos_default_empty_image/static/src/css/pos_default_empty_image.css b/pos_default_empty_image/static/src/css/pos_default_empty_image.css index 5452eabf..f7b8bbd7 100644 --- a/pos_default_empty_image/static/src/css/pos_default_empty_image.css +++ b/pos_default_empty_image/static/src/css/pos_default_empty_image.css @@ -14,7 +14,6 @@ top:25px !important; padding-top:3px !important; height:80px !important; - font-size: 24px !important; line-height: 20px; text-align: center; word-wrap: break-word; diff --git a/pos_default_empty_image/static/src/xml/pos_default_empty_image.xml b/pos_default_empty_image/static/src/xml/pos_default_empty_image.xml index a76a07c5..41a7a3ed 100644 --- a/pos_default_empty_image/static/src/xml/pos_default_empty_image.xml +++ b/pos_default_empty_image/static/src/xml/pos_default_empty_image.xml @@ -2,6 +2,19 @@
+ + + + + + +
@@ -14,7 +27,7 @@
-
+
diff --git a/pos_default_empty_image/views/pos_config.xml b/pos_default_empty_image/views/pos_config.xml new file mode 100644 index 00000000..f7046875 --- /dev/null +++ b/pos_default_empty_image/views/pos_config.xml @@ -0,0 +1,33 @@ + + + + + + + pos.config + + + + +
+
+
+
+ +
+
+
+ + + + + +