Skip to content

Commit

Permalink
Merge PR #1485 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Nov 30, 2024
2 parents 30eec92 + aa2d4f4 commit fcd3040
Show file tree
Hide file tree
Showing 23 changed files with 1,239 additions and 0 deletions.
119 changes: 119 additions & 0 deletions product_internal_reference_generator/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
====================================
Product Internal Reference Generator
====================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d2409ab426a08e8388230556c37f78dedd1b4893bcdf5613daa663e42c9a0762
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/14.0/product_internal_reference_generator
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_internal_reference_generator
: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/product-attribute&target_branch=14.0
:alt: Try me on Runboat

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

This module allows to generate internal references for Product templates and variants using sequences, setting codes as read-only.

In product template, it's possible to choose among different Internal Reference Templates related to a sequence, and then generate an internal reference with the following structure:

Internal Reference Prefix + progressive number for variant, eg: “Main0001001”, where:

"Main0001" is the prefix generated by sequence and assigned to product template, and

"001" the variant identifier.


Every time a new variant is created, a new internal reference is automatically assigned with progressive variant code.


A specific access rights allows specific users to change internal reference template for a product template once an internal reference has been generated, as well as editing existing ones.

**Table of contents**

.. contents::
:local:

Usage
=====

Go to inventory > Configuration > Internal Reference Templates and set:

the sequence to be used for Internal Reference Prefix generation

the number of digits to be used for variants code (standard is 3)

Now go to product template, select an Internal Reference Template and generate an Internal Reference Prefix. Internal reference field is now read-only.

Each time a new variant is created for this product template, an internal reference is automatically assigned.

Known issues / Roadmap
======================

Due to odoo's behavior in handling internal reference for variants (see for example https://github.com/odoo/odoo/issues/140356 ), removing all attributes from a product template with variants will generate a new internal reference for product template.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/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/product-attribute/issues/new?body=module:%20product_internal_reference_generator%0Aversion:%2014.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
~~~~~~~

* Ilyas
* Ooops

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

* `Ooops404 <https://www.ooops404.com>`__:

* Ilyas <irazor147@gmail.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-ilyasProgrammer| image:: https://github.com/ilyasProgrammer.png?size=40px
:target: https://github.com/ilyasProgrammer
:alt: ilyasProgrammer

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

|maintainer-ilyasProgrammer|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/14.0/product_internal_reference_generator>`_ 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 product_internal_reference_generator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions product_internal_reference_generator/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Product Internal Reference Generator",
"summary": """Product template and variant reference based on sequence""",
"author": "Ilyas, Ooops, Odoo Community Association (OCA)",
"maintainers": ["ilyasProgrammer"],
"license": "AGPL-3",
"website": "https://github.com/OCA/product-attribute",
"category": "Sale",
"version": "16.0.1.0.0",
"depends": ["stock", "base_view_inheritance_extension"],
"data": [
"security/groups.xml",
"security/ir.model.access.csv",
"views/product.xml",
],
"demo": ["demo/product_code_seq_demo.xml"],
"installable": True,
"application": False,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>

<record model="ir.sequence" id="demo_pcs_seq_1">
<field name="name">Good products sequence</field>
<field name="prefix">GOOD</field>
<field name="padding">4</field>
</record>

<record model="ir.sequence" id="demo_pcs_seq_2">
<field name="name">Bad products sequence</field>
<field name="prefix">BAD</field>
<field name="padding">5</field>
</record>

<record model="product.code.sequence" id="demo_pcs_1">
<field name="name">Good products</field>
<field name="variant_reference_numbers">3</field>
<field
name="sequence_id"
ref="product_internal_reference_generator.demo_pcs_seq_1"
/>
</record>

<record model="product.code.sequence" id="demo_pcs_2">
<field name="name">Bad products</field>
<field name="variant_reference_numbers">4</field>
<field
name="sequence_id"
ref="product_internal_reference_generator.demo_pcs_seq_2"
/>
</record>

</odoo>
143 changes: 143 additions & 0 deletions product_internal_reference_generator/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_internal_reference_generator
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-27 12:36+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\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: product_internal_reference_generator
#: model_terms:ir.ui.view,arch_db:product_internal_reference_generator.product_template_form_view_inherit
msgid ""
"Are you sure want to generate a new reference prefix?"
" If variants already exist for this product, the new"
" internal reference will be assigned only to those "
"variants that do not already have an internal "
"reference set."
msgstr ""
"Sei sicuro di voler generare un nuovo prefisso riferimento "
"interno? Se esistono già varianti per questo "
"prodotto, il nuovo riferimento interno sarà "
"assegnato solo alle varianti che non hanno già un "
"riferimento interno impostato."

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__create_uid
msgid "Created by"
msgstr "Creato da"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__create_date
msgid "Created on"
msgstr "Creato il"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__variant_reference_numbers
msgid "Digits"
msgstr "Cifre"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__display_name
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_product__display_name
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_template__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: product_internal_reference_generator
#: model_terms:ir.ui.view,arch_db:product_internal_reference_generator.product_template_form_view_inherit
msgid "Generate"
msgstr "Genera"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__id
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_product__id
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_template__id
msgid "ID"
msgstr "ID"

#. module: product_internal_reference_generator
#: model_terms:ir.ui.view,arch_db:product_internal_reference_generator.product_template_form_view_inherit
msgid "Int. Ref. Prefix"
msgstr "Prefisso rif. int."

#. module: product_internal_reference_generator
#: model_terms:ir.ui.view,arch_db:product_internal_reference_generator.product_template_form_view_inherit
msgid "Int. Ref. Template"
msgstr "Modello rif. int."

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_product__variants_prefix
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_template__variants_prefix
msgid "Internal Reference Prefix"
msgstr "Prefisso riferimento interno"

#. module: product_internal_reference_generator
#: model:ir.model,name:product_internal_reference_generator.model_product_code_sequence
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_product__int_ref_template_id
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_template__int_ref_template_id
msgid "Internal Reference Template"
msgstr "Modello riferimento interno"

#. module: product_internal_reference_generator
#: model:ir.actions.act_window,name:product_internal_reference_generator.action_internal_reference_template
#: model:ir.ui.menu,name:product_internal_reference_generator.menu_internal_reference_template
msgid "Internal Reference Templates"
msgstr "Modelli riferimento interno"

#. module: product_internal_reference_generator
#: model:res.groups,name:product_internal_reference_generator.group_int_ref_template_always_visible
msgid "Internal reference template always visible"
msgstr "Modello riferimento interno sempre visibile"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence____last_update
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_product____last_update
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_template____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__name
msgid "Name"
msgstr "Nome"

#. module: product_internal_reference_generator
#: model:ir.model,name:product_internal_reference_generator.model_product_product
msgid "Product"
msgstr "Prodotto"

#. module: product_internal_reference_generator
#: model:ir.model,name:product_internal_reference_generator.model_product_template
msgid "Product Template"
msgstr "Modello prodotto"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_code_sequence__sequence_id
msgid "Sequence"
msgstr "Sequenza"

#. module: product_internal_reference_generator
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_product__variants_sequence_id
#: model:ir.model.fields,field_description:product_internal_reference_generator.field_product_template__variants_sequence_id
msgid "Variants Sequence"
msgstr "Sequenza varianti"
Loading

0 comments on commit fcd3040

Please sign in to comment.