修复外协采购单

This commit is contained in:
jinling.yang
2024-08-29 14:21:18 +08:00
parent 821a7a63be
commit 804bdb60e8
6 changed files with 32 additions and 40 deletions

View File

@@ -184,17 +184,12 @@ class ResMrpWorkOrder(models.Model):
if order.routing_type == '表面工艺':
production_programming = self.env['mrp.production'].search(
[('programming_no', '=', order.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]
purchase = self.env['purchase.order'].search([('origin', '=', ','.join(production_list))])
for line in purchase.order_line:
if line.product_id.server_product_process_parameters_id == order.surface_technics_parameters_id and line.product_qty == len(
production_programming):
# server_product = self.env['product.template'].search(
# [('server_product_process_parameters_id', '=', pp.id),
# ('detailed_type', '=', 'service')])
# purchase_order_line = self.env['purchase.order.line'].search(
# [('product_id', '=', server_product.id), ('product_qty', '=', len(production_programming))])
# if purchase_order_line:
production_no_remanufacture):
order.surface_technics_purchase_count = len(purchase)
else:
order.surface_technics_purchase_count = 0