Skip to Content
Menú
This question has been flagged
1 Respondre
1933 Vistes

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

Avatar
Descartar
Best Answer

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 

Avatar
Descartar
Autor

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 Respostes Vistes Activitat
1
de set. 22
2004
0
de maig 25
12
2
de gen. 25
2425
1
de des. 24
6129
1
de nov. 24
2566