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

Hi, i have created a custom field, in the maintenance.kind module and i want to call the values from the maintenance.request module with another field.

How can i relate this two custom fields?

Can this be done from the web interface?

Thanks.

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

Hi,

First of all find and get which field links both these model, probably there will be a Many2one relation between these two models.

Using this related field either you can use compute or related fields.


Suppose if you take the example of sale order and sale order line, there is a many2one field named order_id which connects order line with sale order.

So if you need to get the customer in the sale order in order line, you can define a related field in order line like below,


partner_id = fields.Many2one('res.partner, string='Partner', related='order_id.partner_id')


Watch:  https://www.youtube.com/watch?v=poDGUKM-K7Q

Thanks

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

Can this be done from the web interface or i need to create a module for that?


thnks!!

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

You have to inherit the model and do all the stuff in that inherited model.

Hello Luis, where you able to do it in web interface? I do have the same problem

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 25
1681
2
thg 1 24
1882
2
thg 12 23
1825
1
thg 12 23
1690
1
thg 6 23
2111