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

Hello,


I want to add a field or a few fields to an existing form or list view.

some need to be in specific places others just need to be added to the end of the existing list.

I know i can just add them in the Edit view in the debug menu , but was wondering how should do this as an addon?


Cheers
kym

อวตาร
ละทิ้ง
ผู้เขียน

Thank you

คำตอบที่ดีที่สุด

Hi,

To add this from the code, create a module, add necessary files like init and manifest, then its all about the xml file where you will add the inherited view.

If you are adding new fields, you have to inherit the corresponding model in the python and you have to add the new fields, once this is done, you can inherit the view and add the new field or existing fields to the view.


Sample:


<record id="view_crm_meeting_search" model="ir.ui.view">
<field name="name">calendar.event.form.inheritfield>
<field name="model">calendar.eventfield>
<field name="inherit_id" ref="calendar.view_calendar_event_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='description']" position="after">
<field name="opportunity_id"/>
xpath>
field>
record>



Tutorial:  How To Inherit And Add Field To A Model In Odoo

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
ต.ค. 23
27109
odoo16 windows addons installation แก้ไขแล้ว
2
พ.ย. 22
5591
2
ส.ค. 25
159
3
ส.ค. 25
2316
4
ก.ค. 25
503