跳至内容
菜单
此问题已终结
2 回复
9681 查看

I've seen this in buttons and other operations, surrounding an xml_id like this:

%(other_module.xml_id)d

What does it do?

形象
丢弃
最佳答案

To expand on Jeremy's answer:

The reason you want to do this is that the ID is not always portable between databases and should not be relied on to locate a record, but is the way some buttons are identified in Odoo XML files once they are inside the database.

If you see this:

<button name="396" string="Convert to Opportunity" type="action" help="Convert to Opportunity" class="oe_highlight"/>

You can locate it the button using:

name="396"

... but it is safer to locate it with:

name="%(crm.action_crm_lead2opportunity_partner)d"
形象
丢弃
最佳答案

Hello


When the xml template will be parsed  by Odoo and inserted in the database (in table ir.ui.view); the %(xmlid)d will be replaced by the real id from this record.


 




形象
丢弃
相关帖文 回复 查看 活动
2
8月 24
2817
2
6月 24
1860
5
12月 22
14972
3
4月 18
53
0
1月 18
3308