去掉工单输出
This commit is contained in:
@@ -238,7 +238,6 @@ class MrpProduction(models.Model):
|
|||||||
ret = requests.post(config_url, json=res, data=None, headers=config_header)
|
ret = requests.post(config_url, json=res, data=None, headers=config_header)
|
||||||
ret = ret.json()
|
ret = ret.json()
|
||||||
result = json.loads(ret['result'])
|
result = json.loads(ret['result'])
|
||||||
logging.info('cron_get_programming_state-ret:%s' % result)
|
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['programming_list']:
|
for item in result['programming_list']:
|
||||||
if not self:
|
if not self:
|
||||||
@@ -246,7 +245,6 @@ class MrpProduction(models.Model):
|
|||||||
if rp.programming_no == item['programming_no']:
|
if rp.programming_no == item['programming_no']:
|
||||||
rp.write({'programming_state': '已编程未下发' if item[
|
rp.write({'programming_state': '已编程未下发' if item[
|
||||||
'programming_state'] == '已编程' else '编程中'})
|
'programming_state'] == '已编程' else '编程中'})
|
||||||
logging.info('rp:%s' % rp.name)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return item
|
return item
|
||||||
@@ -795,8 +793,6 @@ class MrpProduction(models.Model):
|
|||||||
cloud_programming = None
|
cloud_programming = None
|
||||||
if self.programming_state in ['已编程']:
|
if self.programming_state in ['已编程']:
|
||||||
cloud_programming = self._cron_get_programming_state()
|
cloud_programming = self._cron_get_programming_state()
|
||||||
logging.info('cloud_programming_state:%s' % cloud_programming['programming_state'])
|
|
||||||
logging.info('programming_state:%s' % self.programming_state)
|
|
||||||
return {
|
return {
|
||||||
'name': _('返工'),
|
'name': _('返工'),
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
@@ -1088,18 +1084,3 @@ class sf_processing_panel(models.Model):
|
|||||||
|
|
||||||
name = fields.Char('加工面')
|
name = fields.Char('加工面')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
# @api.model
|
|
||||||
# def name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
|
|
||||||
# if self.env.user.has_group('sf_base.group_sf_order_user'):
|
|
||||||
# if self._context.get('product_id'):
|
|
||||||
# product = self.env['product.product'].search([('id', '=', self._context.get('product_id'))])
|
|
||||||
# if product:
|
|
||||||
# panel = self.env['sf.processing.panel'].search([('name', 'ilike', 'ZM')])
|
|
||||||
# if panel:
|
|
||||||
# ids = [t.id for t in panel]
|
|
||||||
# domain = [('id', 'in', ids)]
|
|
||||||
# else:
|
|
||||||
# domain = [('id', '=', False)]
|
|
||||||
# return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
|
||||||
# return super()._name_search(name, args, operator, limit, name_get_uid)
|
|
||||||
|
|||||||
@@ -844,16 +844,6 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
('state', 'in', ['done'])])
|
('state', 'in', ['done'])])
|
||||||
if workorder.state not in ['cancel', 'progress', 'rework']:
|
if workorder.state not in ['cancel', 'progress', 'rework']:
|
||||||
if workorder.production_id.state == 'rework':
|
if workorder.production_id.state == 'rework':
|
||||||
logging.info('len(re_work):%s' % len(re_work))
|
|
||||||
logging.info('len(cnc_workorder):%s' % len(cnc_workorder))
|
|
||||||
logging.info('len(cnc_workorder_pending):%s' % len(cnc_workorder_pending))
|
|
||||||
logging.info('工序:%s' % workorder.routing_type)
|
|
||||||
logging.info('状态:%s' % workorder.state)
|
|
||||||
logging.info('is_rework:%s' % workorder.is_rework)
|
|
||||||
logging.info('production_id.is_rework:%s' % workorder.production_id.is_rework)
|
|
||||||
logging.info('面:%s' % workorder.processing_panel)
|
|
||||||
logging.info('编程状态:%s' % workorder.production_id.programming_state)
|
|
||||||
logging.info('制造状态:%s' % workorder.production_id.state)
|
|
||||||
if workorder.routing_type == '装夹预调' and workorder.state not in ['done', 'rework',
|
if workorder.routing_type == '装夹预调' and workorder.state not in ['done', 'rework',
|
||||||
'cancel']:
|
'cancel']:
|
||||||
# # 有返工工单
|
# # 有返工工单
|
||||||
@@ -884,16 +874,6 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# if workorder.production_id.is_rework is True:
|
# if workorder.production_id.is_rework is True:
|
||||||
# workorder.state = 'waiting'
|
# workorder.state = 'waiting'
|
||||||
elif workorder.production_id.state == 'progress':
|
elif workorder.production_id.state == 'progress':
|
||||||
logging.info('len(re_work):%s' % len(re_work))
|
|
||||||
logging.info('len(cnc_workorder):%s' % len(cnc_workorder))
|
|
||||||
logging.info('len(cnc_workorder_pending):%s' % len(cnc_workorder_pending))
|
|
||||||
logging.info('工序:%s' % workorder.routing_type)
|
|
||||||
logging.info('状态:%s' % workorder.state)
|
|
||||||
logging.info('is_rework:%s' % workorder.is_rework)
|
|
||||||
logging.info('production_id.is_rework:%s' % workorder.production_id.is_rework)
|
|
||||||
logging.info('面:%s' % workorder.processing_panel)
|
|
||||||
logging.info('编程状态:%s' % workorder.production_id.programming_state)
|
|
||||||
logging.info('制造状态:%s' % workorder.production_id.state)
|
|
||||||
if workorder.routing_type == '装夹预调' and workorder.production_id.programming_state == '已编程' and \
|
if workorder.routing_type == '装夹预调' and workorder.production_id.programming_state == '已编程' and \
|
||||||
workorder.is_rework is False and workorder.state not in [
|
workorder.is_rework is False and workorder.state not in [
|
||||||
'done', 'rework',
|
'done', 'rework',
|
||||||
@@ -957,9 +937,6 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logging.info('工序:%s' % workorder.sequence)
|
|
||||||
logging.info('工单最终状态:%s' % workorder.state)
|
|
||||||
|
|
||||||
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
|
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
|
||||||
# 'rework']:
|
# 'rework']:
|
||||||
# per_work = self.env['mrp.workorder'].search(
|
# per_work = self.env['mrp.workorder'].search(
|
||||||
|
|||||||
Reference in New Issue
Block a user