odoo15 xmlrpc many2one字段查询不到
odoo15 xmlrpc many2one字段查询不到
lxr = pcon.api.execute(pcon.db, pcon.uid, pcon.pwd, 'res.users', 'search_read',[('partner_id.name', '=', uname),('qu_id','=',1511])
print('联系人',lxr)
if len(lxr)>0:
news['user_id'] = lxr[0]['id']
自定义字段为什么查询不到,真怪,有哪位高手知道,望指教
@api.model def default_get(self, fields): rec = super(Partner, self).default_get(fields) active_model = self.env.context.get('active_model') if active_model == 'crm.lead' and len(self.env.context.get('active_ids', [])) <= 1: lead = self.env[active_model].browse(self.env.context.get('active_id')).exists() if lead: rec.update( phone=lead.phone, mobile=lead.mobile,