在巡演中表格:-在
当前显示
酒店-->;酒店名称与城市名称
在旅游树上视图:-在
酒店-->;酒店名称与城市名称
实际需求
在巡演中表格:-在
酒店-->;酒店名称与城市名称
在树上游览视图:-在
酒店-->酒店名称
class obj_ghotel(osv.osv):
_name = "obj.ghotel"
_description = "Objet ghotel"
_rec_name = "nom_hotel"
@api.multi
def name_get(self):
res = []
for asset in self:
res.append((asset.id,asset.nom_hotel + ' - ' + asset.id_ville.nom))
return res
_columns = {
'nom_hotel': fields.char("Nom d'hotel", required=True),
'id_ville': fields.many2one('obj.ville', 'ville', selection=_get_selection),
}
这可以通过上下文实现。在窗体视图中的字段上传递一些上下文,检查name_get方法中的上下文值,如果满足则只传递ville nom。在
相关问题 更多 >
编程相关推荐