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

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.

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

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

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

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
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 24
3233
2
thg 1 24
3264
0
thg 11 23
1042
1
thg 5 23
1999
2
thg 4 23
2987