コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4966 ビュー

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?

アバター
破棄
最善の回答

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.

アバター
破棄

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.

最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
2月 22
8894
0
3月 15
4812
2
3月 15
6301
1
2月 22
3202
0
12月 15
3091