Skip to Content
Menu
This question has been flagged

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'
Avatar
Discard
Best Answer

You need to create act_window for that:

<act_window id="act_create_invoice"
key2="client_action_multi"
name="Create Invoice"
res_model="invoice.popup"
src_model="product.template" # OBJECT NAME WHERE YOU WANT TO ADD THIS ACTION
view_mode="form"
target="new"
/>


Avatar
Discard
Related Posts Replies Views Activity
1
Jun 20
2102
2
Jun 20
5766
1
Mar 18
9939
2
Sep 22
668
1
Jul 22
1451