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
68 changes: 68 additions & 0 deletions product_barcode_generator/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
====================================
(Obsolete) Product Barcode Generator
====================================

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

.. |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-beescoop%2FObeesdoo-lightgray.png?logo=github
:target: https://github.com/beescoop/Obeesdoo/tree/16.0/product_barcode_generator
:alt: beescoop/Obeesdoo

|badge1| |badge2| |badge3|

This module is obsolete, has been emptied and can be safely uninstalled.

It is replaced by |barcodes_generator_product|_.

.. |barcodes_generator_product| replace:: ``barcodes_generator_product``
.. _barcodes_generator_product: https://odoo-community.org/shop/generate-barcodes-for-products-558#attr=25819

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/beescoop/Obeesdoo/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/beescoop/Obeesdoo/issues/new?body=module:%20product_barcode_generator%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
~~~~~~~

* Coop IT Easy SC

Maintainers
~~~~~~~~~~~

.. |maintainer-victor-champonnois| image:: https://github.com/victor-champonnois.png?size=40px
:target: https://github.com/victor-champonnois
:alt: victor-champonnois

Current maintainer:

|maintainer-victor-champonnois|

This module is part of the `beescoop/Obeesdoo <https://github.com/beescoop/Obeesdoo/tree/16.0/product_barcode_generator>`_ project on GitHub.

You are welcome to contribute.
3 changes: 3 additions & 0 deletions product_barcode_generator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2022 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later
17 changes: 17 additions & 0 deletions product_barcode_generator/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2022 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

{
"name": "(Obsolete) Product Barcode Generator",
"summary": "Emptied, can be safely uninstalled",
"version": "16.0.1.0.0",
"category": "Product",
"website": "https://github.com/beescoop/Obeesdoo",
"author": "Coop IT Easy SC",
"maintainers": ["victor-champonnois"],
"license": "AGPL-3",
"depends": [
"barcodes_generator_product",
],
}
75 changes: 75 additions & 0 deletions product_barcode_generator/migrations/16.0.1.0.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# SPDX-FileCopyrightText: 2025 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from openupgradelib import openupgrade


def convert_product_barcode_generator_barcode_rule(env):
barcode_rule = env.ref(
"product_barcode_generator.product_barcode_generator_rule",
raise_if_not_found=False,
)
if not barcode_rule:
# barcode rule not found, nothing to do.
return
barcode_rule.write(
{
# ensure pattern is of form "{prefix}......." (12 characters, to
# comply to ean-13 encoding).
"pattern": barcode_rule.pattern + "." * (12 - len(barcode_rule.pattern)),
"generate_type": "sequence",
"generate_model": "product.product",
}
)
# clear obsolete ir.model.data to ensure that the barcode rule does not
# get deleted when the module is updated.
env["ir.model.data"].search(
[
("module", "=", "product_barcode_generator"),
("name", "=", "product_barcode_generator_rule"),
]
).unlink()


def convert_pos_price_to_weight_barcode_rule(env):
barcode_rule = env.ref(
"pos_price_to_weight.rule_price_to_weight", raise_if_not_found=False
)
if not barcode_rule:
# barcode rule not found, nothing to do.
return
barcode_rule_vals = {
"generate_type": "sequence",
"generate_model": "product.product",
}
sequence = env.ref(
"product_barcode_generator.seq_ean_product_internal_ref",
raise_if_not_found=False,
)
if sequence:
# rename the sequence to use the same name and code as the
# auto-generated one instead of "Internal reference" and
# "product.internal.code".
sequence.write(
{
"name": "Sequence - Price Barcodes (Computed Weight)",
"code": False,
}
)
barcode_rule_vals["sequence_id"] = sequence.id
# clear obsolete ir.model.data and ensure that the sequence does not
# get deleted when the module is updated.
env["ir.model.data"].search(
[
("module", "=", "product_barcode_generator"),
("name", "=", "seq_ean_product_internal_ref"),
]
).unlink()
barcode_rule.write(barcode_rule_vals)


@openupgrade.migrate()
def migrate(env, version):
convert_product_barcode_generator_barcode_rule(env)
convert_pos_price_to_weight_barcode_rule(env)
6 changes: 6 additions & 0 deletions product_barcode_generator/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This module is obsolete, has been emptied and can be safely uninstalled.

It is replaced by |barcodes_generator_product|_.

.. |barcodes_generator_product| replace:: ``barcodes_generator_product``
.. _barcodes_generator_product: https://odoo-community.org/shop/generate-barcodes-for-products-558#attr=25819
Loading