Odoo Help

0

What is the magic Behind bubble notification of menu item?

By
Jamshid Chungath
on 1/8/15, 4:51 AM 1,487 views

i find the source code of oe_stat button i couldnt figure out how menu item showing notification of you have 2 unread messages?

where can i configure in menu item?

0

You need to inherit 'ir.needaction_mixin' to your model
I took the example with Mail message model (https://github.com/odoo/odoo/blob/8.0/addons/mail/mail_message.py#L63)

class mail_message(osv.Model):
    _name = 'mail.message'
    _description = 'Message'
    _inherit = ['ir.needaction_mixin']
    def _needaction_domain_get(self, cr, uid, context=None):
        return [('to_read', '=', True)]

So, the same can be applied to your model and set the condition using DOMAIN

Hi , i want to count the list of rows in a remibnder and display the number of this list , what can i change in this function to display the number in the menuitem:

class Reminders(http.Controller):

_inherit = ['ir.needaction_mixin']

@http.route('/general_reminders/all_reminder', type='json', auth="public")

def all_reminder(self):

reminder = []

nb=0

for i in request.env['popup.reminder'].search([]):

reminder.append(i.name)

nb=nb+1

return reminder

khadhraoui
on 7/18/17, 4:40 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 1/8/15, 4:51 AM
Seen: 1487 times
Last updated: 3/16/15, 8:10 AM