Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造代码优化
This commit is contained in:
@@ -497,3 +497,10 @@ div:has(.o_required_modifier) > label::before {
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
// 修改 【批量排程】【配送】 按钮UI
|
||||
.btn-secondary {
|
||||
color: #fff;
|
||||
background-color: #4A4F59;
|
||||
border-color: #4A4F59;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import requests
|
||||
import logging
|
||||
import time
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
@@ -21,10 +22,15 @@ class AgvSetting(models.Model):
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
# token = sf_sync_config['token'Ba F2CF5DCC-1A00-4234-9E95-65603F70CC8A]
|
||||
headers = {'Authorization': config['center_control_Authorization']}
|
||||
center_control_url = config['center_control_url'] + "/AutoDeviceApi/GetAgvStationState"
|
||||
center_control_url = config['center_control_url'] + "/AutoDeviceApi/GetAgvStationState?date="
|
||||
timestamp = int(time.time())
|
||||
center_control_url += str(timestamp)
|
||||
logging.info('工件配送-请求中控地址:%s' % center_control_url)
|
||||
center_control_r = requests.get(center_control_url, params={}, headers=headers)
|
||||
ret = center_control_r.json()
|
||||
logging.info('工件配送-请求中控站点信息:%s' % ret)
|
||||
self.env['center_control.interface.log'].sudo().create(
|
||||
{'content': ret, 'name': 'AutoDeviceApi/GetAgvStationState?date=%s' % str(timestamp)})
|
||||
if ret['Succeed'] is True:
|
||||
datas = ret['Datas']
|
||||
for item in self:
|
||||
|
||||
@@ -644,10 +644,13 @@ class ResMrpWorkOrder(models.Model):
|
||||
def _compute_state(self):
|
||||
for workorder in self:
|
||||
if workorder.routing_type == '装夹预调':
|
||||
if not workorder.cnc_ids:
|
||||
cnc_workorder = self.search(
|
||||
[('production_id', '=', workorder.production_id.id), ('routing_type', '=', 'CNC加工')],
|
||||
limit=1, order='id asc')
|
||||
if not cnc_workorder:
|
||||
workorder.state = 'waiting'
|
||||
else:
|
||||
for item in workorder.cnc_ids:
|
||||
for item in cnc_workorder.cnc_ids:
|
||||
functional_cutting_tool = self.env['sf.functional.cutting.tool.entity'].search(
|
||||
[('tool_name_id.name', '=', item.cutting_tool_name)])
|
||||
if not functional_cutting_tool:
|
||||
|
||||
Reference in New Issue
Block a user