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][ADD] pos_product_packaging_multi_barcode #1040

Merged
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
94 changes: 94 additions & 0 deletions pos_product_packaging_multi_barcode/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
===================================
PoS Product packaging multi barcode
===================================

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

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

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

This module allows to use multiple barcode on a product packaging from the PoS

See https://github.com/OCA/stock-logistics-barcode/tree/16.0/product_packaging_multi_barcode

**Table of contents**

.. contents::
:local:

Usage
=====

1. Navigate to *Inventory > Configuration > Product Packagings*.
2. Select a Packaging item and proceed to input one or multiple barcodes.
3. Return to the *Point of Sale*. You can now utilize barcode scanning functionality for the selected Packaging items.

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_packaging_multi_barcode%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.

Credits
=======

Authors
~~~~~~~

* Camptocamp

Contributors
~~~~~~~~~~~~

* Duong (Tran Quoc) <duongtq@trobz.com>

Other credits
~~~~~~~~~~~~~

Inspired by *pos_product_multi_barcode* module

The development of this module has been financially supported by:

* Camptocamp

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.

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_product_packaging_multi_barcode>`_ 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_packaging_multi_barcode/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions pos_product_packaging_multi_barcode/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "PoS Product packaging multi barcode",
"summary": "Make product packaging multi barcodes usable in the point of sale",
"version": "16.0.1.0.0",
"category": "Point of Sale",
"website": "https://github.com/OCA/pos",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"auto_install": True,
"depends": [
"point_of_sale",
"product_packaging_multi_barcode",
],
"assets": {
"point_of_sale.assets": [
"pos_product_packaging_multi_barcode/static/src/js/db.js",
]
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_product_packaging_multi_barcode
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-11 03:37+0000\n"
"PO-Revision-Date: 2023-08-11 03:37+0000\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_product_packaging_multi_barcode
#: model:ir.model.fields,field_description:pos_product_packaging_multi_barcode.field_product_packaging__barcodes_json
msgid "Barcode List"
msgstr ""

#. module: pos_product_packaging_multi_barcode
#: model:ir.model,name:pos_product_packaging_multi_barcode.model_pos_session
msgid "Point of Sale Session"
msgstr ""

#. module: pos_product_packaging_multi_barcode
#: model:ir.model,name:pos_product_packaging_multi_barcode.model_product_packaging
msgid "Product Packaging"
msgstr ""
2 changes: 2 additions & 0 deletions pos_product_packaging_multi_barcode/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import pos_session
from . import product_packaging
13 changes: 13 additions & 0 deletions pos_product_packaging_multi_barcode/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models


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

def _loader_params_product_packaging(self):
result = super()._loader_params_product_packaging()
result["search_params"]["fields"].append("barcodes_json")
return result
17 changes: 17 additions & 0 deletions pos_product_packaging_multi_barcode/models/product_packaging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import json

from odoo import fields, models


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

# Technical field used in POS frontend
barcodes_json = fields.Char("Barcode List", compute="_compute_barcodes_json")

def _compute_barcodes_json(self):
for packaging in self:
packaging.barcodes_json = json.dumps(packaging.mapped("barcode_ids.name"))

Check warning on line 17 in pos_product_packaging_multi_barcode/models/product_packaging.py

View check run for this annotation

Codecov / codecov/patch

pos_product_packaging_multi_barcode/models/product_packaging.py#L17

Added line #L17 was not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Duong (Tran Quoc) <duongtq@trobz.com>
5 changes: 5 additions & 0 deletions pos_product_packaging_multi_barcode/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Inspired by *pos_product_multi_barcode* module

The development of this module has been financially supported by:

* Camptocamp
3 changes: 3 additions & 0 deletions pos_product_packaging_multi_barcode/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module allows to use multiple barcode on a product packaging from the PoS

See https://github.com/OCA/stock-logistics-barcode/tree/16.0/product_packaging_multi_barcode
3 changes: 3 additions & 0 deletions pos_product_packaging_multi_barcode/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. Navigate to *Inventory > Configuration > Product Packagings*.
2. Select a Packaging item and proceed to input one or multiple barcodes.
3. Return to the *Point of Sale*. You can now utilize barcode scanning functionality for the selected Packaging items.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading