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

Hi everybody 

I have created a custom field ( x_name )  with type char in the account.invoice and i want get the value from another existed field  in res.partner

for now and don't now how to make  a relation between existed field and my new custom field


http://imgur.com/GNM2t1u

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

i use odoo v 9 

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

The way to do this via Developer mode is described in https://www.odoo.com/forum/help-1/question/is-it-possible-to-add-a-field-from-related-model-b-to-a-view-for-model-a-using-only-the-odoo-ui-99820

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

thanks so so much very helpful

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

The easier way is to set the relation in the declaration of your field.

It should be as follows, in your module.py:

new_field = fields.Char(string='...', related="partner_id.partner_field_name")

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

thanks for the reply, but is there another way to make this from odoo ( developper mode ) without enter to the module .py because i'm using lunix and i dont know how and were to find such as files as you said ( hh and this is also another probleme ) thanks

Tác giả

I found module.py but really I cant understood where to add your code plz can you make for me some catch of screen I will be very grateful i'm new on odoo plateforme, and i hope find the support here thanks so much

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 23
5736
3
thg 9 23
2579
0
thg 5 23
2585
1
thg 5 23
2067
1
thg 4 23
1871