Thursday, 13 October 2016

Odoo(OpenERP) : Menu badge count


Steps to add Menu badge as shown in 'Next Activities' menu in Sales Module:
1) Inherit ('ir.needaction_mixin) class in your  the class as shown below.

          class YourClass(models.Model):
                   _name = "your.class"
                   _inherit = ['ir.needaction_mixin']

2) Add '_needaction_domain_get' function in your class as shown below code.Here we have to give domain filter based on which the count is calculatated and displayed in the menu.

         @api.model
         def _needaction_domain_get(self):
                  return [('state', '=', 'on_going')]



No comments:

Post a Comment