Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4866 มุมมอง

hello everybody,

i want to override this function, to make changes, but its not considered, here it is the function


def _get_invoice_line_vals(self, cr, uid, move, partner, inv_type, context=None):

       res = super(stock_move, self)._get_invoice_line_vals(cr, uid, move, partner, inv_type, context=context)

       if inv_type == 'in_invoice' and move.purchase_line_id:

       purchase_line = move.purchase_line_id

       res['invoice_line_tax_id'] = [(6, 0, [x.id for x in purchase_line.taxes_id])]

       res['price_unit'] = purchase_line.price_unit

       elif inv_type == 'in_refund' and move.origin_returned_move_id.purchase_line_id:

       purchase_line = move.origin_returned_move_id.purchase_line_id

       res['invoice_line_tax_id'] = [(6, 0, [x.id for x in purchase_line.taxes_id])]

       res['price_unit'] = purchase_line.price_unit

       return res

its already overridden in diffrent places, i did the same thing in my class but it didnt work

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

- put stock module in depends of your module

- take copy of that function field from base file and put it in your file.

- update the module and refresh the view

Hope this will solve your problem.

อวตาร
ละทิ้ง
ผู้เขียน

thank you that's solved my problem

welcome and all the best.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 17
4831
How to override a global function? แก้ไขแล้ว
1
ส.ค. 15
9655
0
ส.ค. 25
4
1
ก.ค. 25
492
0
ก.ค. 25
548