コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2773 ビュー

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.

関連投稿 返信 ビュー 活動
1
9月 22
2815
3
9月 25
3254
0
8月 25
798
1
8月 25
3012
2
7月 25
8630