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
97 changes: 97 additions & 0 deletions pos_product_default_packaging_level/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
===================================
Pos Product Default Packaging Level
===================================

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

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

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

This module allows to display on POS product cards the product default
packaging.

|image|

.. |image| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_product_default_packaging_level/static/description/pos_default_packaging.png

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

When people manipulate products, they need to identify what is the
default packaging in order to be sure they have the good one in hands.

In POS, it is useful to hav it too for those reasons.

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_default_packaging_level%0Aversion:%2018.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
-------

* ACSONE SA/NV

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

- Denis Roussel denis.roussel@acsone.eu

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-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px
:target: https://github.com/rousseldenis
:alt: rousseldenis

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

|maintainer-rousseldenis|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_product_default_packaging_level/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions pos_product_default_packaging_level/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Pos Product Default Packaging Level",
"summary": """This module allows to show product default packaging level""",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"maintainers": ["rousseldenis"],
"website": "https://github.com/OCA/pos",
"depends": ["point_of_sale", "product_packaging_level"],
"assets": {
"point_of_sale._assets_pos": [
"pos_product_default_packaging_level/static/src/ProductScreen.esm.js",
"pos_product_default_packaging_level/static/src/**/*.xml",
]
},
}
2 changes: 2 additions & 0 deletions pos_product_default_packaging_level/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_product
from . import product_packaging
29 changes: 29 additions & 0 deletions pos_product_default_packaging_level/models/product_packaging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models
from odoo.osv.expression import OR, is_leaf


class ProductPackaging(models.Model):
_inherit = "product.packaging"

@api.model
def _load_pos_data_domain(self, data) -> list:
"""
Find the barcode domain to add packaging that have
the default level.
"""
domain = super()._load_pos_data_domain(data)
new_domain = list()
for element in domain:
found = False
if is_leaf(element):
if element[0] == "barcode":
new_element = OR(
[[element], [("packaging_level_id.is_default", "=", True)]]
)
new_domain.extend(new_element)
found = True
if not found:
new_domain.append(element)
return new_domain
13 changes: 13 additions & 0 deletions pos_product_default_packaging_level/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models


class ProductProduct(models.Model):
_inherit = "product.product"

@api.model
def _load_pos_data_fields(self, config_id):
res = super()._load_pos_data_fields(config_id)
res.append("from_default_level_packaging_id")
return res
3 changes: 3 additions & 0 deletions pos_product_default_packaging_level/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions pos_product_default_packaging_level/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
When people manipulate products, they need to identify what is the default
packaging in order to be sure they have the good one in hands.

In POS, it is useful to hav it too for those reasons.
1 change: 1 addition & 0 deletions pos_product_default_packaging_level/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Denis Roussel <denis.roussel@acsone.eu>
4 changes: 4 additions & 0 deletions pos_product_default_packaging_level/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module allows to display on POS product cards the product default packaging.


![image](../static/description/pos_default_packaging.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading