GithubHelp home page GithubHelp logo

base_tags's Introduction

Generic tags (base_tags)

Base tags implementation for Odoo

Consists of set of modules to add tags to standard Odoo models.

At this moment there are modules to add tags for models:

  • account.invoice model
  • product.product model

Compatability:

  • Odoo version 7.0: works fine
  • Odoo version 8.0 and higher: not tested

Usage

To add tags to your model You need to folow folowing simple steps:

  1. Add base_tags module as dependency for your module

  2. Use inherit from "res.tag.mixin" to get tags functionality to Your model, like:

     class Product(orm.Model):
         _name = "product.product"
         _inherit = ["product.product",
                     "res.tag.mixin"]
     Product()
  3. Add record to taggable models registry:

     <record model="res.tag.model" id="res_tag_model_product_product">
       <field name="name">Product</field>
       <field name="model">product.product</field>
     </record>
  4. Now You can use tag_ids field in Your views for Your model:

    • search view:
    <field name="tag_ids" string="Tag"
           filter_domain="['|',('tag_ids.name','ilike',self),('tag_ids.code','ilike',self)]"/>
    <field name="no_tag_id" string="No tag"/>  <!-- For invers searching (items that do not contain tag)-->
    • tree view:
    <field name="tag_ids" widget="many2many_tags" placeholder="Tags..."/>
    • form view:
    <field name="tag_ids"
           widget="many2many_tags"
           placeholder="Tags..."
           context="{'default_model': 'product.product'}"/>

    Pay attention on context field. This will allow to avoid tag form popup when adding tag from form field

Future plans

  • custom widget to show help/comment on tags mous over
  • ability to show tags same in form view and in tree/list view
  • make tags colored (any tag could have ovn color to fill backround in)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.