Accept Merge Request #2108: (feature/tool_standard_library_process -> develop)
Merge Request: 调拨单就绪问题处理 Created By: @廖丹龙 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @廖丹龙 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2108
This commit is contained in:
@@ -29,14 +29,6 @@ class MrpProduction(models.Model):
|
||||
采购请求
|
||||
"""
|
||||
self.ensure_one()
|
||||
# pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', self.name),('is_subcontract', '!=', True)])
|
||||
# if self.product_id.product_tmpl_id.single_manufacturing == True and not self.is_remanufacture:
|
||||
# first_order = self.env['mrp.production'].search(
|
||||
# [('origin', '=', self.origin), ('product_id', '=', self.product_id.id)], limit=1, order='id asc')
|
||||
# pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', first_order.name)])
|
||||
# else:
|
||||
# pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', self.name)])
|
||||
# 由于采购申请合并了所有销售订单行的采购,所以不区分产品
|
||||
first_mp = self.env['mrp.production'].search(
|
||||
[('origin', '=', self.origin)], limit=1, order='id asc')
|
||||
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', first_mp.name)])
|
||||
@@ -54,7 +46,7 @@ class MrpProduction(models.Model):
|
||||
else:
|
||||
action.update({
|
||||
'name': _("从 %s生成采购请求单", self.name),
|
||||
'domain': [('id', 'in', pr_ids)],
|
||||
'domain': [('id', 'in', pr_ids.ids)],
|
||||
'view_mode': 'tree,form',
|
||||
})
|
||||
return action
|
||||
|
||||
@@ -24,6 +24,8 @@ class SfProductionProcessParameter(models.Model):
|
||||
obj = super(SfProductionProcessParameter, self).create(vals)
|
||||
return obj
|
||||
def create_service_product(self):
|
||||
if not self.active:
|
||||
return
|
||||
service_categ = self.env.ref(
|
||||
'sf_dlm.product_category_surface_technics_sf').sudo()
|
||||
|
||||
|
||||
@@ -928,6 +928,8 @@ class MrpProduction(models.Model):
|
||||
'sf_stock.stock_route_process_outsourcing').id)]
|
||||
for product_id, request_line_list in grouped_purchase_request_line_sorted_list.items():
|
||||
cur_request_line = request_line_list[0]
|
||||
if cur_request_line['product_qty'] == 1:
|
||||
cur_request_line['product_qty'] = len(request_line_list)
|
||||
# cur_request_line['product_qty'] = cur_request_line['product_qty']
|
||||
cur_request_line['request_id'] = pr.id
|
||||
cur_request_line['origin'] = ", ".join({item['production_name'] for item in request_line_list if item.get('production_name')})
|
||||
|
||||
@@ -1312,6 +1312,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
else:
|
||||
workorder.state = 'ready'
|
||||
continue
|
||||
continue
|
||||
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
|
||||
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
|
||||
or workorder.production_id.schedule_state != '已排'
|
||||
@@ -1327,9 +1328,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
if workorder.is_subcontract is False:
|
||||
workorder.state = 'ready'
|
||||
else:
|
||||
if len(workorder.production_id.picking_ids.filtered(
|
||||
lambda w: w.state not in ['done',
|
||||
'cancel'])) == 0 and workorder.production_id.programming_state == '已编程':
|
||||
if workorder.production_id.programming_state == '已编程':
|
||||
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
||||
if purchase_orders_id:
|
||||
if purchase_orders_id.state == 'purchase':
|
||||
|
||||
@@ -152,6 +152,8 @@ class PurchaseOrder(models.Model):
|
||||
|
||||
for line in self.order_line:
|
||||
# 将产品不追踪序列号的行项目设置qty_done
|
||||
if not line.move_ids:
|
||||
continue
|
||||
if line.move_ids and line.move_ids[0].product_id.tracking == 'none':
|
||||
line.move_ids[0].quantity_done = line.move_ids[0].product_qty
|
||||
return res
|
||||
|
||||
@@ -3,6 +3,9 @@ import logging
|
||||
import os
|
||||
import json
|
||||
import base64
|
||||
import traceback
|
||||
|
||||
|
||||
from odoo import http, fields, models
|
||||
from odoo.http import request
|
||||
from odoo.addons.sf_base.controllers.controllers import MultiInheritController
|
||||
@@ -273,7 +276,8 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
|
||||
except Exception as e:
|
||||
res = {'status': -1, 'message': '系统解析失败'}
|
||||
request.cr.rollback()
|
||||
logging.info('get_cnc_processing_create error:%s' % e)
|
||||
traceback_error = traceback.format_exc()
|
||||
logging.error("get_cnc_processing_create error:%s" % traceback_error)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user