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