I need to link a menu item in Odoo to an external link, but this external link is a string stored in model and it is different for every user. I'm not sure how to code this inside the eval attribute of field name url. Or is this possible?
<openerp>
<data>
<record id="open_retainer" model="ir.actions.act_url">
<field name="name">Pay Retainer</field>
<field name="type">ir.actions.act_url</field>
<field name="target">new</field>
<field name="url" eval="'some_url' if True else ''"/>
</record>
<menuitem
name="Pay Retainer"
id="menu_pay_retainer"
groups="base.group_portal"
action="open_retainer"
parent="portal.portal_orders"/>
</data>
</openerp>
Instead of having as menu, you can try by clicking a button in the user screen and redirect to the specific url.
You can try following:
return { 'type': 'ir.actions.act_url', 'url': your_url, 'nodestroy': True, 'target': 'new' }
where 'your_url' is the url string stored for each user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With