diff --git a/jikimo_work_reporting_api/controllers/main.py b/jikimo_work_reporting_api/controllers/main.py index 7976e7de..4ac13b97 100644 --- a/jikimo_work_reporting_api/controllers/main.py +++ b/jikimo_work_reporting_api/controllers/main.py @@ -19,7 +19,10 @@ class MainController(http.Controller): return {'code': 400, 'message': '参数错误'} if not isinstance(maintenance_equipment_id, int) and not isinstance(model_id, str): return {'code': 400, 'message': '参数类型错误'} - maintenance_equipment = request.env['maintenance.equipment'].sudo().search([('id', '=', maintenance_equipment_id)], limit=1) + maintenance_equipment = request.env['maintenance.equipment'].sudo().search( + [('id', '=', maintenance_equipment_id), ('category_id.equipment_type', '=', '机床')], + limit=1 + ) if not maintenance_equipment: return {'code': 400, 'message': '机台不存在,请扫描正确的机台二维码'} product = request.env['product.template'].sudo().search([('model_id', '=', model_id)], limit=1) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index dfc3cc65..e82b1b40 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1821,7 +1821,7 @@ class MrpProduction(models.Model): logging.info('update_programming_state error:%s' % e) raise UserError("更新编程单状态失败,请联系管理员") - model_id = fields.Char('模型id', related='product_id.model_id') + model_id = fields.Char('模型ID', related='product_id.model_id') # 编程记录 diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index b498e978..a36e4b9d 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1814,7 +1814,7 @@ class ResMrpWorkOrder(models.Model): lazy=lazy ) - model_id = fields.Char('模型id', related='production_id.model_id') + model_id = fields.Char('模型ID', related='production_id.model_id') class CNCprocessing(models.Model): diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 2dd79adb..41637123 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -787,7 +787,7 @@ class ResProductMo(models.Model): glb_url = fields.Char('glb文件地址') area = fields.Float('表面积(m²)') auto_machining = fields.Boolean('自动化加工(模型识别)', default=False) - model_id = fields.Char('模型id') + model_id = fields.Char('模型ID') @api.depends('name') diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index f0f480cf..279ac895 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -271,7 +271,7 @@ class ResaleOrderLine(models.Model): embryo_redundancy_id = fields.Many2one('sf.embryo.redundancy', '坯料冗余') manual_quotation = fields.Boolean('人工编程', default=False) model_url = fields.Char('模型文件地址') - model_id = fields.Char('模型id') + model_id = fields.Char('模型ID') delivery_end_date = fields.Date('交货截止日期')