Skip to content

Commit

Permalink
[16.0][MIG] pos_product_template: Migration to 16.0
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Duque <daniel.duque@factorlibre.com>
Co-authored-by: Adriana Saiz <adriana.saiz@factorlibre.com>
  • Loading branch information
3 people committed Mar 25, 2024
1 parent 2ca2eb8 commit fee39db
Show file tree
Hide file tree
Showing 19 changed files with 346 additions and 284 deletions.
16 changes: 11 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 Down Expand Up @@ -62,7 +62,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 +91,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 +117,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
63 changes: 28 additions & 35 deletions pos_product_template/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,44 @@
#
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-03-21 12:05+0000\n"
"PO-Revision-Date: 2024-03-21 12:05+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"

#. 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 +50,24 @@ 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.fields,field_description:pos_product_template.field_pos_config__iface_product_template_show_variants
msgid "Product template show variants"
msgstr "La plantilla de producto mostrará las variantes"
#: model:ir.model,name:pos_product_template.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesión TPV"

#, python-format
#~ msgid "Variant Selection of"
#~ msgstr "Seleccina una variante de"
#. 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
#: model_terms:ir.ui.view,arch_db:pos_product_template.res_config_settings_view_form
msgid "Show product template"
msgstr "Mostrar la plantilla de producto"

#, 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 template for variants and enable popup for variant selection."
msgstr "Muestra la plantilla para las variantes y activa un popup para la selección de variantes."
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
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"):
params.get("search_params", {}).get("fields").append(

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"
)
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",
],
},
}
9 changes: 9 additions & 0 deletions pos_product_template/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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
)
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
Loading

0 comments on commit fee39db

Please sign in to comment.