【发布时间】:2014-02-04 09:26:16
【问题描述】:
我想将域放在 Sales Person() 上,以便只显示所选销售团队的销售人员。
为此,我在 section_id(sales team) 上创建了 on_change(),并从该方法返回域。虽然当我进入开发者模式时域显示在销售人员(user_id)上,但那里没有显示任何值。
代码如下:
def onchange_section_id(self, cr, uid, ids, section_id, context=None):
crm_case_section_obj = self.pool.get('crm.case.section')
member_ids = []
if section_id:
member_ids = [member_id.id for member_id in crm_case_section_obj.browse(cr, uid, section_id, context=context).member_ids]
return {'domain': {'user_id': [('user_id', 'in', member_ids)]}}
我错过了什么吗?
提前感谢。
【问题讨论】:
-
以另一种方式,我们可以通过在您的模块中获取核心模块和宫殿的整个标签并提供父对象来将域放在 .xml 中。如果你想展示域宫比我会给出答案。因为这个问题我已经面对了。谢谢