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

I would like to change the partner in invoice and I suggested that the corresponding prices, taxes and accounts were changed on the fly in the invoice lines. Unfortunately it is not working - all the old (wrong) variables are still present. 

What can I do to make them change automatically on partner update? 

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

Write an onchange method for partner and in it manually call the tax change methods.

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

I have tried that already with no success. The tax change method uses self.fiscal_position_id which is changed in _onchange_partner_id(). The change is not written to database, so the old fiscal_position_id is taken...