Generic Tag is a module developed by the Center of Research & Development company. It allows you to create and categorize generic tags (keywords).
With these tags in other applications, you can use the logic associated with them (for example, search and filter objects by tags).
Integration with other modules is realized with the help of additional modules.
- Customize your own categories of tags.
- Create and set up your unique (or completely generic) tags.
- Associate your products, documents, contacts, etc. with created tags.
- Use your tags!
More information read in the Generic Tag Module Guide.
This module is part of the Bureaucrat ITSM project. You can try it by the references below.
Create your own Bureaucrat ITSM database
To add tags to your model do the folowing simple steps:
Add generic_tag module as dependency for your addon.
Use inherit from "generic.tag.mixin" to get tags functionality to your model, like:
class Product(models.Model): _name = "product.product" _inherit = [ "product.product", "generic.tag.mixin", ]
Add record to taggable models registry:
<record model="generic.tag.model" id="generic_tag_model_product_product"> <field name="res_model_id" ref="product.model_product_product"/> </record>
Now you can use
tag_ids
field in your views for your model:
search view:
<field name="tag_ids"/> <field name="search_tag_id"/> <!-- For direct searching (items that contain selected tag)--> <field name="search_no_tag_id"/> <!-- For inverse searching (items that do not contain selected tag)-->See search_tag_id and search_no_tag_id fields. These fields add autocompletition on searching by specific tag. search_tag_id allows to search for records that contain selected tag. search_no_tag_id allows to search for records that have no selected tag.
tree view:
<field name="tag_ids" widget="many2many_tags" placeholder="Tags..." options="{'color_field': 'color'}"/>form view:
<field name="tag_ids" widget="many2many_tags" placeholder="Tags..." context="{'default_model': 'product.product'}" options="{'color_field': 'color'}"/>Pay attention on context field. This will automatically select correct model on tag creation.
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Our web site: https://crnd.pro/
This module is maintained by the Center of Research & Development company.
We can provide you further Odoo Support, Odoo implementation, Odoo customization, Odoo 3rd Party development and integration software, consulting services. Our main goal is to provide the best quality product for you.
For any questions contact us.