Dynamic URL in odoo form

*爱你&永不变心* 提交于 2019-12-11 17:36:12

问题


How can I create a dynamic link in the odoo formview

for example Static text=http://maps.chef-debiscuit.com/map.php?sheetID=

dynamic text = record id

(solution) http://maps.chef-debiscuit.com/map.php?sheetID=32

For the moment i only have

<a href="http://maps.chef-debiscuit.com/map.php?sheetID=" target="_blank">View on Map</a>

回答1:


0) Create new computed field x_url

1) copy ID -> Field x_copy_id

2) Convert x_copy_id to string

3) Combine static text with IDCOPY

for record in self:
IDCOPY = str(record['x_copy_id'])
record['x_url']='http:///maps.chef-debiscuit.com/map.php?sheetID='+IDCOPY


来源:https://stackoverflow.com/questions/46338705/dynamic-url-in-odoo-form

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!