Odoo - Cannot loop through model records

空扰寡人 提交于 2019-12-06 15:28:02

use new api

@api.multi    #if you use the new api you don't have to list all parameter in the function
def _my_method(self): 

but you can keep it like that and do a pool on your model than loop throw the result that you get don't use self if you use the new api use : self.env['model_name'].search([domain])

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!