
Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn
由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解
本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!
开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号
如果您登录系统碰到问题,请在微信公众号留言:
【求助贴】关于7.0中的字段引用
-
如图,char字段A是在模型B里面的,且A的值是数字。
现在想在模型D中新建一个字段B,能够引用A的值(数字),并直接显示在模型D的form或者tree上
试过reference字段,但是只能显示A的名称,而不是值
★ 最好是能在前端修改,不需要修改源代码
-
使用 related field。修改模型B的name_get()
-
[quote author=Joshua link=topic=6723.msg16020#msg16020 date=1369964804]
使用 related field。修改模型B的name_get()
[/quote]
7.0字段类型有related ??一定要修改到源代码吗?在前端能够做到吗?
-
[quote author=RSong link=topic=6723.msg16023#msg16023 date=1369965411]
[quote author=Joshua link=topic=6723.msg16020#msg16020 date=1369964804]
使用 related field。修改模型B的name_get()
[/quote]
7.0字段类型有related ??一定要修改到源代码吗?在前端能够做到吗?
[/quote]
有的。product/pricelist.py <br />'company_id': fields.related('pricelist_id','company_id',type='many2one',<br />readonly=True, relation='res.company', string='Company', store=True)
前端能否做到,应该是可以的,不过具体没了解过。
-
[quote author=Joshua link=topic=6723.msg16024#msg16024 date=1369966281]
[quote author=RSong link=topic=6723.msg16023#msg16023 date=1369965411]
[quote author=Joshua link=topic=6723.msg16020#msg16020 date=1369964804]
使用 related field。修改模型B的name_get()
[/quote]
7.0字段类型有related ??一定要修改到源代码吗?在前端能够做到吗?
[/quote]
有的。product/pricelist.py <br />'company_id': fields.related('pricelist_id','company_id',type='many2one',<br />readonly=True, relation='res.company', string='Company', store=True)
前端能否做到,应该是可以的,不过具体没了解过。
[/quote]
嗯,谢谢你提供的答案。7.0前端里面没得直接选择related的字段类型,或许要以别的方式实现