Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
108 changes: 108 additions & 0 deletions pos_sale_product_config_no_variant/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=====================================
POS - Product Configurator No Variant
=====================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7806b7163f3b49db86af253fcd57d1721478999b30aa08c1a5c1b6e6a2b8c74a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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/19.0/pos_sale_product_config_no_variant
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-19-0/pos-19-0-pos_sale_product_config_no_variant
: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=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allow user to see the selected attribute values into POS
order line

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Configure the product with variant creation mode no Variant
2. Open the POS Session add that product with attribute values
3. The POS Order will be created
4. the selected attribute values stored in to the POS order line 'Extra
Values' list view optional hide field

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_sale_product_config_no_variant%0Aversion:%2019.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.

Credits
=======

Authors
-------

* Open Source Integrators

Contributors
------------

- Sandip Vyas <svyas@opensourceintegrators.com>

Other credits
-------------

The development of this module has been financially supported by:

- Open Source Integrators
<`https://opensourceintegrators.com\\> <https://opensourceintegrators.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-ursais| image:: https://github.com/ursais.png?size=40px
:target: https://github.com/ursais
:alt: ursais

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ursais|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/19.0/pos_sale_product_config_no_variant>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions pos_sale_product_config_no_variant/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
16 changes: 16 additions & 0 deletions pos_sale_product_config_no_variant/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "POS - Product Configurator No Variant",
"version": "19.0.1.0.0",
"summary": "Manage Point Of Sale via Configurator of no variant",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Point of Sale",
"maintainer": "Open Source Integrators",
"website": "https://github.com/OCA/pos",
"depends": ["point_of_sale"],
"data": ["views/pos_order_views.xml"],
"maintainers": ["ursais"],
"installable": True,
}
44 changes: 44 additions & 0 deletions pos_sale_product_config_no_variant/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_sale_product_config_no_variant
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-11 18:34+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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: pos_sale_product_config_no_variant
#: model:ir.model.fields,field_description:pos_sale_product_config_no_variant.field_pos_order_line__product_no_variant_attribute_value_ids
msgid "Extra Values"
msgstr "Valores Añadidos"

#. module: pos_sale_product_config_no_variant
#. odoo-javascript
#: code:addons/pos_sale_product_config_no_variant/static/src/js/ProductScreen.js:0
#, python-format
msgid "Lot/Serial Number(s) Required"
msgstr "Número(s) de lote/serie obligatorio(s)"

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_order_line
msgid "Point of Sale Order Lines"
msgstr "Líneas de Pedidos en el Punto de Venta"

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_order
msgid "Point of Sale Orders"
msgstr "Pedidos en el Punto de Venta"

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesión del Punto de Venta"
44 changes: 44 additions & 0 deletions pos_sale_product_config_no_variant/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_sale_product_config_no_variant
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-24 17:34+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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: pos_sale_product_config_no_variant
#: model:ir.model.fields,field_description:pos_sale_product_config_no_variant.field_pos_order_line__product_no_variant_attribute_value_ids
msgid "Extra Values"
msgstr "Valori extra"

#. module: pos_sale_product_config_no_variant
#. odoo-javascript
#: code:addons/pos_sale_product_config_no_variant/static/src/js/ProductScreen.js:0
#, python-format
msgid "Lot/Serial Number(s) Required"
msgstr "Richiesto numero(i) di lotto/serie"

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_order_line
msgid "Point of Sale Order Lines"
msgstr "Righe ordine punto vendita"

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_order
msgid "Point of Sale Orders"
msgstr "Ordini punto vendita"

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_session
msgid "Point of Sale Session"
msgstr "Sessione punto vendita"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_sale_product_config_no_variant
#
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_sale_product_config_no_variant
#: model:ir.model.fields,field_description:pos_sale_product_config_no_variant.field_pos_order_line__product_no_variant_attribute_value_ids
msgid "Extra Values"
msgstr ""

#. module: pos_sale_product_config_no_variant
#. odoo-javascript
#: code:addons/pos_sale_product_config_no_variant/static/src/js/ProductScreen.js:0
#, python-format
msgid "Lot/Serial Number(s) Required"
msgstr ""

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_order_line
msgid "Point of Sale Order Lines"
msgstr ""

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_order
msgid "Point of Sale Orders"
msgstr ""

#. module: pos_sale_product_config_no_variant
#: model:ir.model,name:pos_sale_product_config_no_variant.model_pos_session
msgid "Point of Sale Session"
msgstr ""
120 changes: 120 additions & 0 deletions pos_sale_product_config_no_variant/migration19.0/migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Migration Notes - Odoo 19.0

## Scope

This document describes the migration of `pos_sale_product_config_no_variant` from a
legacy POS integration pattern (Odoo 16 style) to the Odoo 19 POS architecture while
preserving functional behavior.

## Functional Goal Kept

The module still ensures that **no-variant attribute values selected in POS** are
available on `pos.order.line` and visible in backend order lines through the **Extra
Values** field.

## Why Changes Were Needed

Odoo 19 POS uses a different frontend and data-loading architecture:

- Legacy frontend extension style (`odoo.define`, `Registries`) is obsolete for this use
case.
- Legacy backend hooks used by older POS flows are no longer valid in Odoo 19:
- `_order_line_fields`
- `_get_fields_for_order_line`
- `_loader_params_*` style hooks used in this module
- Odoo 19 already provides native attribute propagation through `attribute_value_ids` on
`pos.order.line`.

## Implemented Changes

### 1) Backend model logic aligned with Odoo 19

Updated `models/pos_order_line.py`:

- Kept `product_no_variant_attribute_value_ids` as a stored computed field.
- Reworked compute dependencies to rely on native Odoo 19 data:
- `@api.depends("product_id", "attribute_value_ids")`
- Compute now derives values from `attribute_value_ids` filtered by:
- same product template
- `create_variant == "no_variant"`

This removes custom parsing/normalization logic that is no longer required in Odoo 19.

### 2) Removed obsolete backend overrides

Deleted files no longer valid in Odoo 19:

- `models/pos_order.py`
- `models/pos_session.py`

Updated `models/__init__.py` accordingly.

### 3) Removed legacy POS JS patches

Deleted legacy JS files:

- `static/src/js/ProductScreen.js`
- `static/src/js/OrderLines.js`
- `static/src/js/PosProductConfig.js`

Reason: Odoo 19 already handles configurator payload and selected attribute values
natively in POS app models/services.

### 4) Manifest cleanup

Updated `__manifest__.py`:

- Removed obsolete POS asset bundle declaration for legacy JS patches.
- Kept only required module metadata and backend view data.

## Compatibility and Behavior

- The feature remains available from a business perspective: users can still see
selected no-variant values in POS order lines (`Extra Values`).
- The implementation now follows Odoo 19 native mechanisms, reducing technical debt and
migration risk.

## Validation Performed

- Static code validation reported no errors after cleanup.
- Repository status confirmed expected file modifications/deletions.

## Automated Tests Added (TransactionCase)

A dedicated TransactionCase test suite was added to validate the compute logic in an
Odoo 19-compatible way:

- `tests/test_pos_order_line.py`

Test design:

- Uses `setUpClass` to create all required fixtures (attributes, attribute values,
product templates, PTAVs).
- Verifies `_compute_no_variant_attribute_values` keeps only:
- values from the same product template
- values with `create_variant == "no_variant"`
- Verifies compute result is empty when `product_id` is not set.

This test scope is focused on functional correctness of the migrated compute path for
`pos.order.line`.

## Coverage Objective

The target is to push module coverage close to 97% for the migrated logic area. Exact
global coverage depends on the full project test matrix execution and coverage tooling
configuration in the target CI environment.

## Recommended Runtime Validation

1. Upgrade the module in a test database.
2. Create/use a product template with attributes configured as `no_variant`.
3. In POS, add product and select attribute values.
4. Confirm order and inspect backend POS order line.
5. Verify `Extra Values` contains the selected no-variant attribute values.

## Notes for Future Maintenance

- Prefer extending Odoo 19 POS through native model/serialization flow before
introducing custom frontend patches.
- Keep this module focused on backend visibility/reporting of no-variant values, not on
replacing core configurator behavior.
4 changes: 4 additions & 0 deletions pos_sale_product_config_no_variant/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import pos_order_line
Loading
Loading