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

I have many2one field in sales order. I call it x_order_type

im trying to compute a field on the sale order line from that x_order_type field

my order line field is x_studio_type

Here is my code:


when im trying to save i get the message of unknown field in decency.


What am I doing wrong?

Thanks in Advance 




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

Hi,

Try changing the dependencies to order_id.x_order_type and the compute function to

for record in self:
record["x_studio_type"] = record.order_id.x_order_type.name

Regards

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

that worked. thank you