Skip to content

Commit

Permalink
[ADD]pos_product_packaging_multi_barcode
Browse files Browse the repository at this point in the history
  • Loading branch information
duongtq committed Aug 11, 2023
1 parent 1b8714c commit 44c9cae
Show file tree
Hide file tree
Showing 15 changed files with 641 additions and 0 deletions.
87 changes: 87 additions & 0 deletions pos_product_packaging_multi_barcode/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
===================================
PoS Product packaging multi barcode
===================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d2df36c904c00fa60083d13c2f59000891497effa6f268e04c77452eb83cc318
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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:

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
18 changes: 18 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,18 @@
# 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:
barcodes = [barcode for barcode in packaging.mapped("barcode_ids.name")]
packaging.barcodes_json = json.dumps(barcodes)
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 44c9cae

Please sign in to comment.