1、没绑定工单不能完工,绑定后才可以完工
2、工单绑定后没完工可以换绑 3、工单点完工按钮要有确认弹窗
This commit is contained in:
@@ -606,6 +606,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
if self.routing_type == '装夹预调':
|
||||
if not self.material_center_point and self.X_deviation_angle > 0:
|
||||
raise UserError("请对前置三元检测定位参数进行计算定位")
|
||||
if not self.rfid_code:
|
||||
raise UserError("请扫RFID码进行绑定")
|
||||
if self.picking_out_id:
|
||||
picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)])
|
||||
if picking_out.workorder_out_id:
|
||||
@@ -869,7 +871,8 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
[('production_id', '=', workorder.production_id.id)])
|
||||
if workorder_rfid:
|
||||
for item in workorder_rfid:
|
||||
item.write({'rfid_code': barcode})
|
||||
if item.state == "progress":
|
||||
item.write({'rfid_code': barcode})
|
||||
|
||||
|
||||
class WorkPieceDelivery(models.Model):
|
||||
|
||||
@@ -8,8 +8,8 @@ from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
|
||||
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<field name='user_permissions' invisible="1"/>
|
||||
<field name='name' invisible="1"/>
|
||||
<field name='is_delivery' invisible="1"/>
|
||||
<!-- 工单form页面的开始停工按钮等 -->
|
||||
<!-- 工单form页面的开始停工按钮等 -->
|
||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', '|', '|','|', ('production_state','in', ('draft', 'done',
|
||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||
@@ -114,7 +114,7 @@
|
||||
groups="sf_base.group_sf_mrp_user"
|
||||
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False), ('routing_type', '=', 'CNC加工')]}"/>
|
||||
<button name="button_finish" type="object" string="完成" class="btn-success"
|
||||
groups="sf_base.group_sf_mrp_user"
|
||||
groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"
|
||||
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False), ('routing_type', '=', 'CNC加工')]}"/>
|
||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
@@ -184,7 +184,7 @@
|
||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||
<field name="functional_fixture_type_id"
|
||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||
<field name="rfid_code" force_save="1" readonly="1" class="customRFID"
|
||||
<field name="rfid_code" readonly="1" class="customRFID"
|
||||
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
||||
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
||||
<script src="/sf_manufacturing/static/src/js/customRFID.js"></script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import logging
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo import fields, models, api
|
||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
# from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -8,8 +8,8 @@ from datetime import datetime
|
||||
import requests
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
Reference in New Issue
Block a user