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

The way we name projects isn't very unique (a lot of the same projects) and we rely on the customer name a lot. This is fine in most areas but I am really struggling with the calendar views.


I cannot seem to be able to change the primary text shown on the calendar, adding additional field in the view add those fields to the popup, but nothing I do seems to change the primary text from project_id.

อวตาร
ละทิ้ง

Could you please provide an image of the current module where you want to add the customer field?

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

In Odoo 17, you can override _compute_display_name​, to show customer name instead:

def _compute_display_name(self):
for record in self:
record.display_name = record.partner_id.name
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi

Please try to inherit the project.task model, then you can add your own field on the calendar view


<record id="view_task_calendar" model="ir.ui.view">
<field name="name">project.task.calendar.view.calendar. inherit. module.name</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="purchase.view_task_calendar"/>
      <field name="arch" type="XML">
<xpath expr="/calendar/field[@name='project_id']" position="after">
                        <field name="my_date"/>
                 </xpath>
      </field>
</record>

Hope it helps

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

This is just showing another field to the popup and not changing the name shown on the calendar???

Related Posts ตอบกลับ มุมมอง กิจกรรม
Change the record name in calendar views แก้ไขแล้ว
1
เม.ย. 24
3493
2
ม.ค. 24
3622
0
พ.ย. 23
1239
1
พ.ค. 23
2160
Value set to false by default? แก้ไขแล้ว
2
เม.ย. 23
3245