Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
If product inventory is zero (0), process should not continue (SALES ORDER should not continue if the QUANTITY ON HAND of the product is zero. Any help please...
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))
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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
|Asked: 7/15/14, 3:23 AM|
|Seen: 652 times|
|Last updated: 3/16/15, 8:10 AM|