Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8497 มุมมอง

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'
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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"
/>


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 20
2247
2
มิ.ย. 20
6029
1
มี.ค. 18
10095
2
ก.ย. 22
668
1
ก.ค. 22
1602