Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
9691 Visualizzazioni

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

%(other_module.xml_id)d

What does it do?

Avatar
Abbandona
Risposta migliore

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"
Avatar
Abbandona
Risposta migliore

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.


 




Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
ago 24
2864
2
giu 24
1904
5
dic 22
14989
3
apr 18
53
0
gen 18
3309