Guys, how to do it:
#Read quantity from table, if qty_available <50 send message
(example)
[code]
def _get_current_stock(self, cr, uid, ids, field_name, arg, context=None):
res = []
tot_qty = 0
product_id = 0
for obj in self.browse(cr, uid, ids, context=context):
cr.execute(""" select sum(qty) from stock_quant where product_id = %s and location_id != 7;""" %(obj.product_id.id))
tot_qty = cr.fetchall()
if tot_qty<50: #here message sending procedure, how to send message ?
print '==========================================='
print '|| Product QTY ', res
print '==========================================='
return res
[/code]