跳至内容
菜单
此问题已终结
2 回复
3930 查看

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.

形象
丢弃
编写者 最佳答案

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

形象
丢弃
最佳答案

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)
形象
丢弃
相关帖文 回复 查看 活动
1
12月 22
8545
1
3月 19
19214
3
2月 20
10385
3
12月 19
6456
1
11月 24
2078