Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4961 Lượt xem

When I have a Customer record like this:



When I click a Contact I get this popup:



I want to open the Contact record itself, not have it popup like that.  Is this possible?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can create a Smart Button like this:



Which when clicked shows the original Company plus all the Contacts:



Find the database id of the standard Window Action that open Customers:



Make your own View like this:



<div name="button_box" position="inside">
<button name="55" type="action" string="Contacts" icon="fa-users"
context="{'search_default_parent_id': active_id}"/>
</div>


Depending on how you want the Button to work, you might need to modify the context dictionary.

Ảnh đại diện
Huỷ bỏ

Hello Ray,

Since some time has passed I wanted to check with you to see if you feel this is still the best method to accomplish this. Does anything need to be updated for use with V17?

Thank you.

This works the same way for Odoo 17

Ray,

Would you mind expanding a bit for someone that is proficient in technical details but is an Odoo newbie trying to get a handle on the steps required to implement your solution.

I'm missing some step along the way.

Thanks in advance. 

Ping my prior post from 14 days ago. 😁☝🏻

Please review https://www.odoo.com/forum/help-1/how-can-our-team-hold-and-release-delivery-orders-based-on-the-sales-order-273935 for more information, and if you still need help I suggest you contact your Odoo Advisor or Odoo Partner.

This approach is only for Advanced Odoo Users and you might need several hours of help customized to your skill level.

Câu trả lời hay nhất

Hi,

Add a button with label Open in kanban view itself and in the button action open the record using the code like this,

Inherit the view like this:

<record id="view_partner_form_inherit" model="ir.ui.view">
<field name="name">res.partner.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='child_ids']/kanban/templates//div[@class='oe_kanban_details']" position="after">
<button name="action_open" string="Open" type="object">Open</button>
</xpath>
</field>
</record>

and inside the corresponding model:

def action_open(self):
for rec in self:
return {
"type": "ir.actions.act_window",
"res_model": "res.partner",
"views": [[False, "form"]],
"res_id": rec.id,
}

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 22
8894
0
thg 3 15
4811
2
thg 3 15
6301
1
thg 2 22
3188
0
thg 12 15
3091