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

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

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

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 

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

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 22
2844
3
ก.ย. 25
3255
0
ส.ค. 25
799
1
ส.ค. 25
3017
2
ก.ค. 25
8651