Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
10463 Lượt xem
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Yes, you can. From method of your button you can call your onchange method. Onchange will return dictionary, you have to fetch values from dictionary and pass that dictionary in write method.

Sample:

def your_btn_method(self, cr, uid, ids, context=None):
    for rec in self.browse(cr, uid, ids, context=context):
        #Pass required fields value as a parameter in onchange
        res = self.your_onchange(cr, uid, [rec.id], rec.field1, rec.field2)
        if res.has_key('values'):
            self.write(cr, uid, [rec.id], res.get('values'), context=context)
    return True

Hope this will help you.

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

Short: In the standard webclient not.

Before the action of the button is executed it makes a save (or create, when the record is new) and the form is reloaded anyway. This is done so, to have all data from the form on the server when executing the action of the button.

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

actually m new to openerp..but i think we can trigger a function by a button click...we juz have to implement a workflow and in activity we can mentions the method which has to be triggered...also we must map button name with the signal in workflow transition..plz correct me if m wrong

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 15
6653
2
thg 1 22
4694
2
thg 3 23
10086
2
thg 3 23
2482
1
thg 1 24
14336