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
108 changes: 108 additions & 0 deletions product_tags_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================
Product Tags Code
=================

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

.. |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/license-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/19.0/product_tags_code
: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-19-0/product-attribute-19-0-product_tags_code
: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=19.0
:alt: Try me on Runboat

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

Allows to reference tag records through a unique code.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Go to the product form view.
2. Create and edit tags using the form view

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_tags_code%0Aversion:%2019.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 SA

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

- Thomas Nowicki <thomas.nowicki@camptocamp.com>

- Simone Orsi <simahawk@gmail.com>

- [Trobz] (`https://trobz.com/ <https://trobz.com/>`__):

- Dung Tran <dungtd@trobz.com>
- Khoi (Kien Kim) <khoikk@trobz.com>

Other credits
-------------

The migration of this module from 14.0 to 18.0 was financially supported
by:

- Camptocamp

The migration of this module from 18.0 to 19.0 was financially supported
by:

- PLEDRA NETCOM S.R.L

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/product-attribute <https://github.com/OCA/product-attribute/tree/19.0/product_tags_code>`_ 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_tags_code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions product_tags_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Product Tags Code",
"summary": "This addon allow to add code on products tags",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"depends": ["product"],
"data": ["views/product_tag_views.xml"],
}
47 changes: 47 additions & 0 deletions product_tags_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_template_tags_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-15 16:36+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\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_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag__code
msgid "Code"
msgstr "Código"

#. module: product_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"

#. module: product_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag__id
msgid "ID"
msgstr "ID"

#. module: product_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: product_template_tags_code
#: model:ir.model,name:product_template_tags_code.model_product_template_tag
msgid "Product Tag"
msgstr "Etiqueta de producto"

#. module: product_template_tags_code
#: model:ir.model.constraint,message:product_template_tags_code.constraint_product_template_tag_code_uniq
msgid "Product template tag code already exists"
msgstr "El código de etiqueta de la plantilla de producto ya existe"
47 changes: 47 additions & 0 deletions product_tags_code/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_template_tags_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-06 08:37+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag__code
msgid "Code"
msgstr "Codice"

#. module: product_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: product_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag__id
msgid "ID"
msgstr "ID"

#. module: product_template_tags_code
#: model:ir.model.fields,field_description:product_template_tags_code.field_product_template_tag____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: product_template_tags_code
#: model:ir.model,name:product_template_tags_code.model_product_template_tag
msgid "Product Tag"
msgstr "Etichetta prodotto"

#. module: product_template_tags_code
#: model:ir.model.constraint,message:product_template_tags_code.constraint_product_template_tag_code_uniq
msgid "Product template tag code already exists"
msgstr "Codice etichetta modello prodotto già esistente"
29 changes: 29 additions & 0 deletions product_tags_code/i18n/product_tags_code.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_tags_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \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: product_tags_code
#: model:ir.model.fields,field_description:product_tags_code.field_product_tag__code
msgid "Code"
msgstr ""

#. module: product_tags_code
#: model:ir.model,name:product_tags_code.model_product_tag
msgid "Product Tag"
msgstr ""

#. module: product_tags_code
#: model:ir.model.constraint,message:product_tags_code.constraint_product_tag_code_uniq
msgid "Product template tag code already exists"
msgstr ""
1 change: 1 addition & 0 deletions product_tags_code/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_tag
32 changes: 32 additions & 0 deletions product_tags_code/models/product_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ProductTag(models.Model):
_inherit = "product.tag"

code = fields.Char(
compute="_compute_code",
readonly=False,
inverse="_inverse_code",
store=True,
)

_code_uniq = models.Constraint(
"unique (code)",
"Product template tag code already exists",
)

@api.depends("name", "code")
def _compute_code(self):
for rec in self:
if rec.name and rec.name.strip():
rec.code = self.env["ir.http"]._slugify(rec.name)
else:
rec.code = ""

def _inverse_code(self):
for rec in self:
rec.code = self.env["ir.http"]._slugify(rec.code)
3 changes: 3 additions & 0 deletions product_tags_code/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 product_tags_code/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To configure this module, you need to:

1. Go to the product form view.
2. Create and edit tags using the form view
6 changes: 6 additions & 0 deletions product_tags_code/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Thomas Nowicki \<<thomas.nowicki@camptocamp.com>\>
- Simone Orsi \<<simahawk@gmail.com>\>

- [Trobz] (https://trobz.com/):
- Dung Tran \<<dungtd@trobz.com>\>
- Khoi (Kien Kim) \<<khoikk@trobz.com>\>
7 changes: 7 additions & 0 deletions product_tags_code/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The migration of this module from 14.0 to 18.0 was financially supported by:

- Camptocamp

The migration of this module from 18.0 to 19.0 was financially supported by:

- PLEDRA NETCOM S.R.L
1 change: 1 addition & 0 deletions product_tags_code/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allows to reference tag records through a unique code.
Binary file added product_tags_code/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading