Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] pos_product_template: Migration to 16.0 #1170

Open
wants to merge 53 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4464eff
[ADD] 'pos_product_template'
legalsylvain Dec 9, 2014
fcd1732
[IMP] better display of attributes values;
legalsylvain Dec 18, 2014
554d26a
[ADD] fr translation;
legalsylvain Dec 18, 2014
4913648
[REF] remove useless variable, courtesy to Sylvain C;
legalsylvain Jan 25, 2015
d23864e
[FIX] Typo
legalsylvain Jan 25, 2015
c5dab10
[ADD] 'pos_product_template' pot file
legalsylvain Jan 25, 2015
c5e9774
[ADD] Add extra demo data that generate display bug
legalsylvain Jan 28, 2015
dfcb9fc
[FIX] hide product attribute value in POS if value has no product ass…
legalsylvain Jan 28, 2015
6bbeba8
[IMP] description of the module in openerp.py file;
legalsylvain Jan 28, 2015
d9d9de8
[REF]
legalsylvain Jan 28, 2015
8bdd388
[IMP] Add screenshot descrption;
legalsylvain Jan 28, 2015
53600f9
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
6edf7ce
Move module icon in static/description
yvaucher Mar 3, 2015
b177865
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
a52d4f1
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
7d8f4b9
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
e809f2e
Updated pos_product_template addon to Odoo 9
navarromiguel Apr 12, 2016
811c430
Added Spanish translation to pos_product_template (es.po)
navarromiguel Apr 12, 2016
45da370
[FIX] Change the version number to 9 and make module installable.
damendieta Feb 5, 2017
0412733
Migrate to v10
hparfr Apr 12, 2018
460aa6c
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
16b12ad
[UPD] Update pos_product_template.pot
oca-travis Jun 22, 2018
f2367d7
[MIG] pos_product_template
hugosantosred Aug 16, 2018
21fb8c5
[MIG] Migrated to odoo 12.0. No real changes done. Just splitted READ…
wpichler Nov 19, 2019
d68844b
[FIX] pos_product_template was incombatible with the pos_cache module…
wpichler May 7, 2019
b80bd06
[FIX] Use xml demo fiels instead of yml files. Removed yml file which…
wpichler Nov 19, 2019
d173d8a
[FIX] Added pos_fix_search_limit dependency. Added base 10 to parseIn…
wpichler Nov 19, 2019
3399c44
[UPD] Update pos_product_template.pot
oca-travis Dec 26, 2021
a675cf8
[UPD] README.rst
OCA-git-bot Dec 26, 2021
2d9f9e7
pos_product_template 12.0.1.0.1
OCA-git-bot Dec 26, 2021
36dd811
[IMP] pos_product_template: black, isort, prettier
antoniocanovas Jun 20, 2022
25848d8
[MIG] pos_product_template: Migration to 14.0
antoniocanovas Jun 20, 2022
c6d4982
[UPD] Update pos_product_template.pot
Jul 4, 2022
38084ec
Added translation using Weblate (Italian)
francesco-ooops Jul 5, 2022
54e7f2e
Translated using Weblate (Italian)
francesco-ooops Jul 5, 2022
b1af776
[14.0][FIX] pos_product_template, check variant product_template_attr…
GSLabIt Jul 6, 2022
2d94875
[UPD] README.rst
OCA-git-bot Jul 6, 2022
e14430d
pos_product_template 14.0.1.0.1
OCA-git-bot Jul 6, 2022
282b34f
[IMP] pos_product_template: hint if variant exists
Jul 11, 2022
a87966f
[IMP] allow to hide the variants in a product template selection
Jul 13, 2022
63c0eb0
[UPD] Update pos_product_template.pot
Dec 19, 2022
2240e90
pos_product_template 14.0.1.0.2
OCA-git-bot Dec 19, 2022
00b98d8
Update translation files
weblate Dec 19, 2022
e94eb83
[IMP] pos_product_template: Sort product attribute by sequence
ygcarvalh Nov 8, 2022
aa29389
[IMP] Allows SelectVariantPopup to be updated when chained to itself
luismalta Nov 17, 2022
107e192
Translated using Weblate (Italian)
mymage Mar 16, 2023
33a7109
pos_product_template 14.0.1.0.3
OCA-git-bot Jul 18, 2023
0fcd36b
Translated using Weblate (Spanish)
anmarmo1 Jul 26, 2023
eb1be67
[UPD] README.rst
OCA-git-bot Sep 3, 2023
4c2808c
[IMP] pos_product_template: black, isort, prettier
zamberjo Sep 18, 2023
f48b395
[MIG] pos_product_template: Migration to 15.0
zamberjo Sep 18, 2023
de87176
[UPD] Update pos_product_template.pot
Dec 18, 2023
4f28024
[16.0][MIG] pos_product_template: Migration to 16.0
Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions pos_product_template/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ POS - Product Template
: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/15.0/pos_product_template
:target: https://github.com/OCA/pos/tree/16.0/pos_product_template
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-15-0/pos-15-0-pos_product_template
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_product_template
: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=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -48,6 +48,8 @@ POS - Product Template
Usage
=====

Go to "Point of Sale > Configurations > Settings" and select the option "Show product template in PoS".

Open the Point of Sale, search an article with variants.
You will see one article instead of all the variants.

Expand All @@ -62,7 +64,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/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 <https://github.com/OCA/pos/issues/new?body=module:%20pos_product_template%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_product_template%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -91,6 +93,12 @@ Contributors

* Jose Zambudio <jose@aurestic.es>

* `Factor Libre <https://factorlibre.com>`_:

* Daniel Duque (daniel.duque@factorlibre.com)
* Adriana Saiz (adriana.saiz@factorlibre.com)
* Pablo De Andrés (pablo.deandres@factorlibre.com)

Funders
-------

Expand All @@ -111,6 +119,6 @@ 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 <https://github.com/OCA/pos/tree/15.0/pos_product_template>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_product_template>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
8 changes: 4 additions & 4 deletions pos_product_template/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "POS - Product Template",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Point Of Sale",
"author": "Akretion,Odoo Community Association (OCA)",
"summary": "Manage Product Template in Front End Point Of Sale",
"summary": "Manage product template in front end point of sale",
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"depends": [
"point_of_sale",
],
"data": [
"views/pos_config_view.xml",
"views/res_config_settings.xml",
],
"assets": {
"web.assets_qweb": ["pos_product_template/static/src/xml/**/*.xml"],
"point_of_sale.assets": [
"pos_product_template/static/src/**/*.js",
"pos_product_template/static/src/css/ppt.css",
"pos_product_template/static/src/xml/**/*.xml",
],
},
"demo": [
Expand Down
83 changes: 53 additions & 30 deletions pos_product_template/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,50 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-12-18 12:01+0000\n"
"PO-Revision-Date: 2023-07-26 13:10+0000\n"
"Last-Translator: Anna Martínez <anna080678@gmail.com>\n"
"POT-Creation-Date: 2024-04-05 12:09+0000\n"
"PO-Revision-Date: 2024-04-05 12:09+0000\n"
"Last-Translator: \n"
"Language-Team: \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"
"Plural-Forms: \n"

#. module: pos_product_template
#: model:product.attribute.value,name:pos_product_template.attribute_wifi_extra
msgid "2.399GHz"
msgstr "2.399GHz"
msgstr ""

#. module: pos_product_template
#. openerp-web
#. odoo-javascript
#: code:addons/pos_product_template/static/src/xml/SelectVariantPopup.xml:0
#, python-format
msgid "Cancel"
msgstr "Cancelar"

#. module: pos_product_template
#. openerp-web
#: model:ir.model,name:pos_product_template.model_res_config_settings
msgid "Config Settings"
msgstr "Opciones de configuración"

#. module: pos_product_template
#. odoo-javascript
#: code:addons/pos_product_template/static/src/xml/SelectVariantPopup.xml:0
#, python-format
msgid "Confirm"
msgstr "Confirmar"

#. module: pos_product_template
#: model:ir.model.fields,field_description:pos_product_template.field_pos_config__display_name
msgid "Display Name"
msgstr "Nombre a mostrar"

#. module: pos_product_template
#: model:ir.model.fields,field_description:pos_product_template.field_pos_config__id
msgid "ID"
msgstr "ID"
#: model:ir.model.fields,help:pos_product_template.field_pos_config__iface_show_product_template
#: model:ir.model.fields,help:pos_product_template.field_res_config_settings__iface_show_product_template
msgid "Enables product templates in TPV"
msgstr "Activa la selección de plantilla en el TPV"

#. module: pos_product_template
#: model:ir.model.fields,help:pos_product_template.field_pos_config__iface_product_template_show_variants
#: model:ir.model.fields,help:pos_product_template.field_res_config_settings__iface_product_template_show_variants
msgid ""
"If selected the product variant selection screen will show the variants, "
"else it will only allow to confirm once all the attributes are chosen."
Expand All @@ -56,25 +56,48 @@ msgstr ""
"de lo contrario, solo permitirá confirmar una vez elegidos todos los "
"atributos."

#. module: pos_product_template
#: model:ir.model.fields,field_description:pos_product_template.field_pos_config____last_update
msgid "Last Modified on"
msgstr "Última Modificación en"

#. module: pos_product_template
#: model:ir.model,name:pos_product_template.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configuración del punto de venta"
msgstr "Configuración del TPV"

#. module: pos_product_template
#: model:ir.model,name:pos_product_template.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesión TPV"

#. module: pos_product_template
#: model:ir.model.fields,field_description:pos_product_template.field_pos_config__iface_product_template_show_variants
#: model:ir.model.fields,field_description:pos_product_template.field_res_config_settings__iface_product_template_show_variants
msgid "Product template show variants"
msgstr "La plantilla de producto mostrará las variantes"

#, python-format
#~ msgid "Variant Selection of"
#~ msgstr "Seleccina una variante de"
#. module: pos_product_template
#: model_terms:ir.ui.view,arch_db:pos_product_template.res_config_settings_view_form
msgid ""
"Product variant selection screen will show the variants,\n"
" else it will only allow to confirm once all the attributes are chosen."
msgstr ""
"La pantalla de selección de productos muestra las variantes, \n"
"de lo contrario, solo permite confirmar una vez elegidos todos los atributos"

#, python-format
#~ msgid "Variants"
#~ msgstr "Variantes"
#. module: pos_product_template
#: model_terms:ir.ui.view,arch_db:pos_product_template.res_config_settings_view_form
msgid "Show product template in TPV"
msgstr "Plantilla de producto"

#. module: pos_product_template
#: model_terms:ir.ui.view,arch_db:pos_product_template.res_config_settings_view_form
msgid "Show product template variants"
msgstr "Mostrar las variantes en la plantilla de producto"

#. module: pos_product_template
#: model:ir.model.fields,field_description:pos_product_template.field_pos_config__iface_show_product_template
#: model:ir.model.fields,field_description:pos_product_template.field_res_config_settings__iface_show_product_template
msgid "Shows product template in TPV"
msgstr "Plantilla del producto"

#. module: pos_product_template
#: model_terms:ir.ui.view,arch_db:pos_product_template.res_config_settings_view_form
msgid "Shows product template in the product selection screen."
msgstr "Mostrar la plantilla del producto cuando tiene más de una variante disponible."
50 changes: 0 additions & 50 deletions pos_product_template/i18n/pos_product_template.pot

This file was deleted.

2 changes: 2 additions & 0 deletions pos_product_template/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from . import pos_config
from . import pos_session
from . import res_config_settings
6 changes: 6 additions & 0 deletions pos_product_template/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ class PosConfig(models.Model):
help="If selected the product variant selection screen will show the variants,"
" else it will only allow to confirm once all the attributes are chosen.",
)

iface_show_product_template = fields.Boolean(
string="Shows product template in TPV",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TPV is not english.
as it is in pos_config, I guess "Show Product Templates" is enough.

default=True,
help="Enables product templates in TPV",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does'nt bring anything.

)
86 changes: 86 additions & 0 deletions pos_product_template/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
from odoo import api, models


class PosSession(models.Model):
_inherit = "pos.session"

def _loader_params_pos_config(self):
params = super()._loader_params_pos_config()
if params.get("search_params", {}).get("fields"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test are not usefull here, as base function return search_params and fields. (otherwise, the PoS will not work at all...)

params.get("search_params", {}).get("fields").extend(

Check warning on line 10 in pos_product_template/models/pos_session.py

View check run for this annotation

Codecov / codecov/patch

pos_product_template/models/pos_session.py#L10

Added line #L10 was not covered by tests
["iface_product_template_show_variants", "iface_show_product_template"]
)
return params

@api.model
def _pos_ui_models_to_load(self):
models_to_load = super()._pos_ui_models_to_load()
models_to_load.append("product.template")
models_to_load.append("product.attribute")
models_to_load.append("product.attribute.value")
models_to_load.append("product.template.attribute.value")
return models_to_load

def _loader_params_product_product(self):
params = super()._loader_params_product_product()
params["search_params"]["fields"].append("name")
params["search_params"]["fields"].append("product_template_attribute_value_ids")
params["search_params"]["fields"].append("product_variant_count")
return params

def _get_pos_ui_product_template(self, params):
return self.env["product.template"].search_read(**params["search_params"])

def _loader_params_product_template(self):
return {
"search_params": {
"domain": [("sale_ok", "=", True), ("available_in_pos", "=", True)],
"fields": [
"name",
"display_name",
"product_variant_ids",
"product_variant_count",
],
},
}

def _get_pos_ui_product_attribute(self, params):
return self.env["product.attribute"].search_read(**params["search_params"])

def _loader_params_product_attribute(self):
return {
"search_params": {
"fields": ["name", "value_ids", "sequence"],
},
}

def _get_pos_ui_product_attribute_value(self, params):
return self.env["product.attribute.value"].search_read(
**params["search_params"]
)

def _loader_params_product_attribute_value(self):
return {
"search_params": {
"fields": ["name", "attribute_id"],
},
}

def _get_pos_ui_product_template_attribute_value(self, params):
return self.env["product.template.attribute.value"].search_read(
**params["search_params"]
)

def _loader_params_product_template_attribute_value(self):
return {
"search_params": {
"domain": [("product_tmpl_id.available_in_pos", "=", True)],
"fields": [
"name",
"attribute_id",
"product_tmpl_id",
"product_attribute_value_id",
"ptav_product_variant_ids",
],
},
}
13 changes: 13 additions & 0 deletions pos_product_template/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

iface_product_template_show_variants = fields.Boolean(
related="pos_config_id.iface_product_template_show_variants", readonly=False
)

iface_show_product_template = fields.Boolean(
related="pos_config_id.iface_show_product_template", readonly=False
)
6 changes: 6 additions & 0 deletions pos_product_template/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

* Jose Zambudio <jose@aurestic.es>

* `Factor Libre <https://factorlibre.com>`_:

* Daniel Duque (daniel.duque@factorlibre.com)
* Adriana Saiz (adriana.saiz@factorlibre.com)
* Pablo De Andrés (pablo.deandres@factorlibre.com)

Funders
-------

Expand Down
2 changes: 2 additions & 0 deletions pos_product_template/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Go to "Point of Sale > Configurations > Settings" and select the option "Show product template in PoS".

Open the Point of Sale, search an article with variants.
You will see one article instead of all the variants.
Loading
Loading