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

Hello everybody,

Very new in Odoo so thank you for your understanding :-)

What I'm trying to do: I have "service" records linked to "vehicle" record (Many2One). When I validate a "service" I would like to update the field description in the related "vehicle" record with the date of the current "service" record.

So in the automation rule I have entered the following:

​record['vehicle_id.description'] = record.date

I can save but when I run the automation I have the following error:

ValueError: KeyError('vehicle_id.description') while evaluating
"record['vehicle_id.description'] = record.date"

I suppose that I cannot call directly vehicle_id.description

So I have 2 questions:

  • where I can learn how to access correctly fields in the context of automation (didn't find detailled explaination) ?
  • could you help me to find the right way to update this field ?

Thank you in advance for your help

Philippe

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I find this syntaxt:

linked_vehicle = record.vehicle_id
linked_vehicle['description'] = record.date


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 24
2718
1
thg 1 25
1478
0
thg 7 24
1264