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

Hello, I have this model here which has all available rooms.


I want a way to be able to count all available rooms but I don't particularly know how because these rooms are shown as a tree table in xml:

string="Hotel Room">

name="name"/>
name="categ_id"/>
name="list_price" string="Room rate"/>
name="status"/>
name="capacity"/>


I have tried creating many2one field to this model to get the records but it shows none. Could someone help me?

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

Hi,

Upon reading the post, am not sure about what exactly you are looking for.

In the last part of the post, you specified the many2one is coming as none, if this is the problem, see whether you have added defined rec_name for the newly added model or name_get function.

To understand better about how the values are displayed in the many2one field, i recommend you to have a look at this video:  https://www.youtube.com/watch?v=aT_tsfW5HaQ


And if you are looking to get room count to a particular field ? In this case a compute or related field can help as per your need.

Odoo Compute Field:  https://www.youtube.com/watch?v=RirBoceNT5Q&t=17s

Related Field Odoo:   https://www.youtube.com/watch?v=rLlUQ9GAan8&t=46s


Thanks

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

I wanted the total number of rooms available as shown at the picture above. But I was able to solve it. Thanks for your time!

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 11 23
17447
3
thg 11 24
25105
1
thg 4 23
6154
2
thg 12 22
6899
1
thg 11 22
4058