Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
3629 Ansichten

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
Verwerfen
Autor Beste Antwort

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

Avatar
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Dez. 22
8212
1
März 19
18789
3
Feb. 20
9963
3
Dez. 19
6015
1
Nov. 24
1614