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

I am programming a custom module to apply a discount to sale orders (please avoid suggesting existing discount modules, I have tried several without success and also I want to learn how to do this stuff, thanks).

I have added the fields and modified _amount_all function and everything works fine, BUT I noted that it only works when you change something from the sale order item list. If you press update link in the subtotals and you did not change anything from the items the method _amount_all is not invoked at all. I added a "discount" field so if I modify later that discount value without modifying the items the user can not reflect the changes in the totals.

Now I am struggling to understand what triggers _amount_all and how can I force that updating a given field can trigger that function when user clicks on update link too.

Any help is really welcomed.

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

This question is better formulated and properly answered here:

https://www.odoo.com/es_ES/forum/help-1/question/understanding-old-api-what-does-store-in-fields-function-actually-do-97717

Ả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 25
1099
2
thg 5 25
1015
1
thg 2 22
4822
0
thg 4 19
2704
3
thg 3 18
6059