This is my xml.
<record model="ir.actions.act_window" id="real_estate.action_invoice_popup">
<field name="name">Create Invoice</field>
<field name="res_model">invoice.popup</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="type">ir.actions.act_window</field>
<field name="target">new</field>
</record>
<menuitem
id="real_estate.create_invoice"
name="Create Invoice"
action="real_estate.action_invoice_popup"
parent="real_estate.invoices"
sequence="5"
/>
First I was using this action
<button name="%(real_estate.action_invoice_popup)d" type="action" string="Create Invoice" class="oe_highlight"/>
But now i want this action on menu item. When I tried it gives this error:
File "/home/hamza/custom/programming/enviornments/flectra/env/env_ADHL/addons/rsms/real_estate/models/file.py", line 720, in <lambda> name = fields.Char('File',default = lambda self:self.env['file'].browse(self._context['active_id']).name, readonly=True) KeyError: 'active_id'
Action / Server Action in Odoo:
1- https://goo.gl/UnHzS8
2- https://goo.gl/Vpb2Fv
3- http://learnopenerp.blogspot.com/2020/01/odoo-server-action.html