Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug

This commit is contained in:
qihao.gong@jikimo.com
2024-01-16 14:30:26 +08:00
29 changed files with 256 additions and 155 deletions

View File

@@ -1 +1,2 @@
from . import models
from . import controllers

View File

@@ -0,0 +1 @@
from . import controllers

View File

@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
import logging
import json
import base64
from odoo import http
from odoo.http import request
class Manufacturing_Connect(http.Controller):
@http.route('/AutoDeviceApi/GetWoInfo', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
cors="*")
def get_Work_Info(self, **kw):
"""
自动化传递工单号获取工单信息
:param kw:
:return:
"""
logging.info('get_Work_Info:%s' % kw)
try:
res = {'Succeed': True, 'Datas': []}
datas = request.httprequest.data
ret = json.loads(datas)
ret = json.loads(ret['result'])
logging.info('RfidCode:%s' % ret)
workorder = request.env['mrp.workorder'].sudo().search([('name', '=', ret['RfidCode'])])
if workorder:
for item in workorder:
res['Datas'].append({
'BillId': item.production_id.name,
'ProductionLine': item.production_line,
'CraftName': item.name,
'Quantity': 1,
'MaterialId': item.product_id.default_code,
'MaterialName': item.product_id.name,
# 'Spec':item.mat,
'Material': item.materials_type_id.name
})
except Exception as e:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
logging.info('get_Work_Info error:%s' % e)
return json.JSONEncoder().encode(res)

View File

@@ -6,6 +6,7 @@ import requests
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.addons.sf_base.commons.common import Common
from odoo.tools import float_compare, float_round, float_is_zero, format_datetime
from odoo.tools import float_compare, float_is_zero

View File

@@ -437,7 +437,7 @@ class ResProductMo(models.Model):
cutting_tool_blade_diameter = fields.Float('刃径/刃部直径(mm)')
cutting_tool_cutter_arbor_diameter = fields.Float('刀杆直径(mm)')
cutting_tool_min_machining_aperture = fields.Integer('最小加工孔径(mm)')
cutting_tool_install_blade_tip_num = fields.Integer('可装刀片数/齿数(个)', size=20)
cutting_tool_install_blade_tip_num = fields.Integer('可装刀片数/齿数(个)')
cutting_tool_installing_structure = fields.Char('安装结构', size=20)
cutting_tool_blade_id = fields.Many2one(
'sf.cutting_tool.standard.library',

View File

@@ -89,13 +89,15 @@ access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model
access_mrp_production,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0
access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,1,1,0
access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0
access_sf_production_line_group_plan_director,sf.production.line,model_sf_production_line,sf_base.group_plan_director,1,1,1,0
access_sf_production_line,sf.production.line,model_sf_production_line,sf_maintenance.sf_group_equipment_user,1,1,1,0
access_mrp_workcenter,mrp_workcenter,model_mrp_workcenter,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_bom,mrp.bom,mrp.model_mrp_bom,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_bom_line,mrp.bom.line,mrp.model_mrp_bom_line,sf_base.group_plan_dispatch,1,0,0,0
access_mrp_unbuild,mrp.unbuild,mrp.model_mrp_unbuild,sf_base.group_plan_dispatch,1,1,1,0
access_stock_scrap,stock.scrap,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,1,1,0
access_stock_scrap_group_plan_dispatch,stock.scrap,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
access_sf_model_type,sf.model.type,model_sf_model_type,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_routing_workcenter,mrp.routing.workcenter,mrp.model_mrp_routing_workcenter,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_document,mrp.document,mrp.model_mrp_document,sf_base.group_plan_dispatch,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
89 access_mrp_workorder mrp_workorder model_mrp_workorder sf_base.group_plan_dispatch 1 1 1 0
90 access_sf_production_line access_sf_production_line_group_plan_dispatch sf.production.line model_sf_production_line sf_base.group_plan_dispatch 1 1 0 1 0 0
91 access_sf_production_line access_sf_production_line_group_plan_director sf.production.line model_sf_production_line sf_maintenance.sf_group_equipment_user sf_base.group_plan_director 1 1 1 0
92 access_mrp_workcenter access_sf_production_line mrp_workcenter sf.production.line model_mrp_workcenter model_sf_production_line sf_base.group_plan_dispatch sf_maintenance.sf_group_equipment_user 1 1 1 0
93 access_mrp_workcenter mrp_workcenter model_mrp_workcenter sf_base.group_plan_dispatch 1 1 1 0
94 access_mrp_bom mrp.bom mrp.model_mrp_bom sf_base.group_plan_dispatch 1 1 1 0
95 access_mrp_bom_line mrp.bom.line mrp.model_mrp_bom_line sf_base.group_plan_dispatch 1 0 0 0
96 access_mrp_unbuild mrp.unbuild mrp.model_mrp_unbuild sf_base.group_plan_dispatch 1 1 1 0
97 access_stock_scrap access_stock_scrap_group_plan_dispatch stock.scrap stock.model_stock_scrap sf_base.group_plan_dispatch 1 1 0 1 0 0
98 access_sf_model_type sf.model.type model_sf_model_type sf_base.group_plan_dispatch 1 1 1 0
99 access_mrp_routing_workcenter mrp.routing.workcenter mrp.model_mrp_routing_workcenter sf_base.group_plan_dispatch 1 1 1 0
100 access_mrp_document mrp.document mrp.model_mrp_document sf_base.group_plan_dispatch 1 0 0 0
101 access_mrp_document access_sf_product_model_type_routing_sort mrp.document sf.product.model.type.routing.sort mrp.model_mrp_document model_sf_product_model_type_routing_sort sf_base.group_plan_dispatch 1 0 0 0
102 access_sf_product_model_type_routing_sort access_sf_embryo_model_type_routing_sort sf.product.model.type.routing.sort sf.embryo.model.type.routing.sort model_sf_product_model_type_routing_sort model_sf_embryo_model_type_routing_sort sf_base.group_plan_dispatch 1 0 0 0
103 access_sf_embryo_model_type_routing_sort access_sf_surface_technics_model_type_routing_sort sf.embryo.model.type.routing.sort sf.surface_technics.model.type.routing.sort model_sf_embryo_model_type_routing_sort model_sf_surface_technics_model_type_routing_sort sf_base.group_plan_dispatch 1 0 0 0