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

Example: In product.product there is field qty_available which is compute field and no store, so in the change of that field i want to put some logic if quantity will less than zero.


Thanks

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

You can override compute method and add your custom code to track changes of that field and make your custom code work.Try below code.

def _compute_quantities(self):
    super()._compute_quantities()
    # Add Your custom code here 

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

Thanks, I thought too this same but this method is using by many fields so i thought it will risky but let's try if no any other alternative solution is there.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 22
2008
0
thg 5 25
12
2
thg 1 25
2431
1
thg 12 24
6136
1
thg 11 24
2574