【发布时间】:2017-08-12 12:38:57
【问题描述】:
我是我的模型,我有一个字段“mentor_id”,定义为:
mentor_id = fields.Many2one('hr.employee', string='Mentor')
在我的 SearchView 中,我需要添加一个过滤器,该过滤器仅显示具有指导者 ID = 当前用户的 Employee_id 的记录 所以我补充说:
<filter string="My :" name="my" domain="[('mentor_id','in',uid.employee_ids)]"/>
但它似乎没有工作,我得到这个错误:
Uncaught Error: Failed to evaluate search criterions:
{"code":400,"message":"Evaluation Error","data":{"type":"local_exception","debug":"Local evaluation failure\nAttributeError: object has no attribute 'employee_ids'\n\n{\"domains\":[[],\"[('mentor_id','in',uid.employee_ids)]\"],\"contexts\":[{\"lang\":\"en_US\",\"tz\":false,\"uid\":1,\"params\":{\"action\":324}},{}],\"group_by_seq\":[]}"}}
uid 指的是当前用户不是吗?那么为什么错误说:“该对象没有属性'employee_ids'”。 任何帮助将不胜感激。
【问题讨论】:
标签: xml filter openerp searchview odoo-10