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

Hi,


I created a custom object 'Building' which has a many2one-field 'Analytic Account', which is linked to the standard Analytic Account object.

In the 'Building' object, I want access to all Analytic Account Lines of the Analytic Account, specified in the field mentioned above; if possible in a table or with a Smart button.

What I basically try to do is to link an object (analytic account line) to another (building) via a third object (analytic account). Any suggestions? I am a bit lost here.


Bart

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

These customization tips will help you: https://sites.google.com/view/thinkincode/erp/odoo

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

Hi,
You can create a One2many field in your Building object related to the Many2one field

analytic_line_ids = fields.One2many(related='analytic_id.analytic_line_ids', string='Analytic Account Lines')

Here 'analytic_id is your many2one field in the Building object. And the 2nd ‘analytic_line_ids’ is the One2many field in ‘analytic account’ object. You can add this field in xml view definition inside a notebook.

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 21
4551
1
thg 1 21
5097
6
thg 6 20
12405
1
thg 1 25
1445
4
thg 5 24
12326