Odoo Help

0
2 Answers
0
Alcaline
7/22/14, 8:35 PM

my problem got solved by adding this code in  action_wait:

 order_line_ids = self.pool.get('sale.order.line').search(cr, uid, [('order_id', '=', o.id)])
            for so_line in self.pool.get('sale.order.line').browse(cr, uid, order_line_ids):
                  so_line_id = self.pool.get('product.product').search(cr, uid, [('id', '=', so_line.product_id.id)])
                  for bom in self.pool.get('mrp.bom').browse(cr, uid, so_line_id):   
                      xbom_id = self.pool.get('mrp.bom').search(cr, uid, [('product_id', '=', bom.id)]
                      for child_bom in self.pool.get('mrp.bom').browse(cr,uid,xbom_id):
                          child_bom_ids = self.pool.get('mrp.bom').search(cr,uid,[('id','=',child_bom.id)]
                          if (child_bom.product_id > child_bom.product_id.qty_available):  
                                raise osv.except_osv(_('Not enough Stock !'), _('You requested %.2f.The available Components is %s !') %(child_bom.product_qty, child_bom.product_id.qty_available))
                         

 

 

3
Avatar

Remya

--Remya--

5652
| 7 8 8
Thiruvananthapuram, India
--Remya--

Working as an Senior ODOO developer. http://in.linkedin.com/pub/remya-r/69/a23/298

Remya
7/15/14, 4:43 AM

We can user warning_alert for showing the alert that, stock is low. Then we can block the sales quotation.

1 Comment
Alcaline
7/16/14, 9:17 PM

where can i see the warning_alert? in sales module?

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now