Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
8549 Prikazi

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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jun. 20
2283
2
jun. 20
6086
1
mar. 18
10114
2
sep. 22
668
1
jul. 22
1628