콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
5056 화면

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
8967
0
3월 15
4882
2
3월 15
6394
1
2월 22
5562
0
12월 15
3142