迭代Odoo中自定义模块内其他模型记录的数据

时间:2016-02-18 07:16:03

标签: python openerp erp

我想在自定义模块中迭代account.invoice。我正在使用以下行进行迭代,但它无法正常工作。

  

for filex in   self.env [' account.invoice&#39]。search_read([],[' PARTNER_ID''状态'' date_due']) :

1 个答案:

答案 0 :(得分:1)

search_read 返回一个字典(check this),因此你需要像这样迭代:

for (key, value) in self.env['account.invoice'].search_read([],['partner_id','status','date_due']).iteritems():