修复外协采购
This commit is contained in:
@@ -966,12 +966,14 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
else:
|
else:
|
||||||
production_programming = self.env['mrp.production'].search(
|
production_programming = self.env['mrp.production'].search(
|
||||||
[('programming_no', '=', self.production_id.programming_no)], order='name asc')
|
[('programming_no', '=', self.production_id.programming_no)], order='name asc')
|
||||||
|
production_no_remanufacture = production_programming.filtered(
|
||||||
|
lambda a: a.is_remanufacture is False)
|
||||||
production_list = [production.name for production in production_programming]
|
production_list = [production.name for production in production_programming]
|
||||||
purchase_orders = self.env['purchase.order'].search(
|
purchase_orders = self.env['purchase.order'].search(
|
||||||
[('origin', '=', ','.join(production_list))])
|
[('origin', 'ilike', ','.join(production_list))])
|
||||||
for line in purchase_orders.order_line:
|
for line in purchase_orders.order_line:
|
||||||
if line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id and line.product_qty == len(
|
if line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id and line.product_qty == len(
|
||||||
production_programming):
|
production_no_remanufacture):
|
||||||
if purchase_orders.state == 'purchase':
|
if purchase_orders.state == 'purchase':
|
||||||
workorder.state = 'ready'
|
workorder.state = 'ready'
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user