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

Hello,

1) - I'd like to create a dialog (instead of a form -> because I will not save anything) just to get the info chosen by the user and then use it like I want. The following image represents what I want. (I don't have enough karma to put the entirely link, so please see at: oi39.tinypic.com/2vb1mpg.jpg

As you may know, the months are always the same (January, February..etc), but the year can change. So, I'm also trying to retrieve the years from database. I already accomplished this last one, but I don't know how to send it to the selection field.

def get_years(self, cr, uid, context=None):
        years = cr.execute("SELECT DISTINCT(EXTRACT(YEAR FROM date_registered)) FROM services")
        years.fetchall()
        for item in years:
            return {'value': {'field_years': item},} # But I don't think this will work, probably more likely:
           return {'append': {'field_years': item},}  # or something

2) - To accomplish this dialog, do I need to create the default class?

 class name(osv.osv):
    _name = '...'
   _columns = { 
         ...
   }

And by that, create the default XML as well.

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

Solved. I just looked into the "Human Resources" module, which has a dialog box.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
8014
0
thg 3 15
2892
2
thg 4 15
28392
1
thg 3 15
7562
1
thg 3 15
3564