XMLRPC Search product.template返回空列表

时间:2019-05-20 16:41:54

标签: odoo-10 xml-rpc odoo-12

我在从product.template模型通过xmlrpc获取记录列表时遇到麻烦。

仅在product.template模型中存在此问题,当我尝试将搜索域放入搜索条件时会发生。

# Gets the source records for the model we intend to migrate in the database class of script.
def get_records(self,model,filter,fields):
    return self.models.execute_kw(self.db, 1, self.password,model, 'search_read',filter,fields)

#method call
source_recs = source_db.get_records(source_model, [[[SYNC_FLAG,'=', 
    False]]] , source_fields)

仅当过滤器为[[]]时,对模型的调用才有效。所有其他模型都可以通过此脚本运行而没有问题,但是上面的脚本返回[]而不是记录列表作为字典。

弄清楚为什么我不能在product.template的搜索功能上使用过滤器/域的任何帮助都会很棒。

1 个答案:

答案 0 :(得分:0)

最初在我们的系统中安装并实现Odoo的合作伙伴安装了一个自定义模块,该模块扩展了search_read的产品和模板。此扩展名将清除列表。如果有人使用过OSI并提出了此问题,则模块为osi_default_product_category。

相关问题