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

Hello,

I am learning how to develop my own modules, and for it I need to create a new view with different pages inside.

I wish to be able to insert some of the fields in the main table created by the class, and the fields which are inside the page of the view into another table.

Is this possible? If someone can point me in the right direction I will appreciate it!

Thanks!

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

You can use fields of type related to update fields which are not part of the actual model.

Here is an example from model stock.move:

'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Source", store=True),

This code maps the origin of the stock.picking to the origin of the stock.move. So you can change the origin field of stock.picking from within the stock.move model.

Update:

You can also use a function field and define a method for argument fnct_inv. (See the Developer documentation)

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

Perfect I think this will work. I will test and then come back to mark the answer right. Thanks a lot!

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
12158
2
thg 8 24
2229
Sticky Field Đã xử lý
1
thg 11 19
3463
1
thg 3 15
4784
1
thg 3 15
5289