我已经搜索了论坛并尝试了我找到的所有解决方案,但直到现在还没有。我目前是这样的:
class open_classB(osv.osv):
_name = "open.classB"
_rec_name = 'desc'
_columns = {
'desc':fields.char("Description:", size = 50, required = True),
}
open_classB()
class open_classA(osv.osv):
_name = 'open.classA'
_columns = {
'notes':fields.text('Notes:'),
'desc_id':fields.many2one('open.classB', 'Description:', 'desc'),
}
open_classA()
而不是下拉显示类似: 'Yellow' ; '蓝色的'; 它显示:'open.classB,1';'open.classB, 2' 我已经尝试将“_rec_name”也放在“open_classA”上,但它是一样的。
在 XML 中,我只放:
<field name="desc_id"/>
谢谢。