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

This is not a question, it is a hint I found useful to share.

I needed to customize the confirm button functionality in a Purchase Order by saving a special account # in the account_id field. My first problem was that I don't know the sequence of the of methods called to know where to put my update. I tried the idea to inherit the account_invoice class and put a breakpoint on the 'create' and 'write' methods, just to stop the calling flow and examine the code sequence.

I added this peice of code just to put a breakpoint to enable me do the trace

class account_invoice(osv.osv):
    _inherit = "account.invoice"
    def create(self, cr, uid, vals, context=None):
        return super(account_invoice, self).create(cr, uid, vals, context=context)

    def write(self, cr, uid, ids, vals, context=None):
        res = super(account_invoice, self).write(cr, uid, ids, vals, context=context)
        return res
account_invoice()

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 11 20
11054
1
thg 7 17
4804
1
thg 3 15
5249
1
thg 3 15
5092