Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
3620 Vues

Hi everyone:

   In V8 :

==================================================================================

def _needaction_count(self, cr, uid, domain=None, context=None):

""" Get the number of actions uid has to perform. """

dom = self._needaction_domain_get(cr, uid, context=context)

if not dom: return 0 res = self.search(cr, uid, (domain or []) + dom,limit=100, order='id DESC', context=context)

return len(res)

==============================================================================================


I would like to rewrite this function, remove the limit of count, but the model is osv.AbstractModel, I do not know how to rewrite this method, please help me!

thank you.

Avatar
Ignorer
Auteur Meilleure réponse

Thanks for your reply, I tried it, it didn't work.

Avatar
Ignorer
Meilleure réponse

Inherit the class and override the function

class ir_needaction_mixin(osv.AbstractModel):
    _inherit = 'ir.needaction_mixin'
    def _needaction_count(self, cr, uid, domain=None, context=None):
    """ Get the number of actions uid has to perform. """
        dom = self._needaction_domain_get(cr, uid, context=context
        if not dom:
       return 0
        res = self.search(cr, uid, (domain or []) + dom, order='id DESC', context=context)
        return len(res)
Avatar
Ignorer
Publications associées Réponses Vues Activité
1
déc. 22
8208
1
mars 19
18785
3
févr. 20
9961
3
déc. 19
6010
1
nov. 24
1611