Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug
This commit is contained in:
@@ -9,8 +9,12 @@ access_quality_point_user,quality.point,quality.model_quality_point,quality.grou
|
||||
access_quality_point_test_type_user,quality.point.test_type,quality.model_quality_point_test_type,quality.group_quality_user,1,0,0,0
|
||||
access_quality_check_stock_user,quality.check,quality.model_quality_check,stock.group_stock_user,1,1,1,0
|
||||
access_stock_lot_user,stock.lot,stock.model_stock_lot,quality.group_quality_user,1,0,0,0
|
||||
access_stock_lot_group_quality_manager,stock_lot_group_quality_manager,stock.model_stock_lot,quality.group_quality_manager,1,0,0,0
|
||||
|
||||
access_stock_pack_user,stock.move.line,stock.model_stock_move_line,quality.group_quality_user,1,0,0,0
|
||||
access_stock_picking,stock.move.line,stock.model_stock_picking,quality.group_quality_user,1,0,0,0
|
||||
access_stock_picking_group_quality_user,stock_picking_group_quality_user,stock.model_stock_picking,quality.group_quality_user,1,0,0,0
|
||||
access_stock_picking_group_quality_manager,stock_picking_group_quality_manager,stock.model_stock_picking,quality.group_quality_manager,1,0,0,0
|
||||
|
||||
access_quality_alert_team_manager,quality.alert.team,quality.model_quality_alert_team,quality.group_quality_manager,1,1,1,1
|
||||
access_quality_check_manager,quality.check,quality.model_quality_check,quality.group_quality_manager,1,1,1,1
|
||||
access_quality_alert_manager,quality.alert,quality.model_quality_alert,quality.group_quality_manager,1,1,1,1
|
||||
|
||||
|
@@ -362,7 +362,10 @@ class Manufacturing_Connect(http.Controller):
|
||||
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
||||
[('feeder_station_destination', '=', ret['DeviceId'])])
|
||||
if workpiece_delivery:
|
||||
workpiece_delivery.production_id.write({'production_line_state': '已上产线'})
|
||||
for wd in workpiece_delivery:
|
||||
if wd.production_id.production_line_state == '待上产线':
|
||||
logging.info('wd.production_id:%s' % workpiece_delivery.production_id.id)
|
||||
wd.production_id.write({'production_line_state': '已上产线'})
|
||||
else:
|
||||
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '该DeviceId没有对应的工件配送数据'}
|
||||
else:
|
||||
@@ -391,7 +394,10 @@ class Manufacturing_Connect(http.Controller):
|
||||
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
||||
[('feeder_station_destination', '=', ret['DeviceId'])])
|
||||
if workpiece_delivery:
|
||||
workpiece_delivery.production_id.write({'production_line_state': '已下产线'})
|
||||
for wd in workpiece_delivery:
|
||||
if wd.production_id.production_line_state == '已上产线':
|
||||
logging.info('wd.production_id:%s' % workpiece_delivery.production_id.id)
|
||||
wd.production_id.write({'production_line_state': '已下产线'})
|
||||
else:
|
||||
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '该DeviceId没有对应的工件配送数据'}
|
||||
else:
|
||||
|
||||
@@ -134,18 +134,19 @@ class ResMrpWorkOrder(models.Model):
|
||||
preset_program_information = fields.Char(string="预调程序信息")
|
||||
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
|
||||
is_delivery = fields.Boolean('是否配送完成', default=False)
|
||||
rfid_code = fields.Char('RFID')
|
||||
rfid_code = fields.Char('RFID码')
|
||||
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
|
||||
string='生产线', store=True)
|
||||
production_line_state = fields.Selection(related='production_id.production_line_state',
|
||||
string='上/下产线', store=True)
|
||||
detection_report_path = fields.Char('检测报告链接地址')
|
||||
|
||||
@api.onchange('rfid_code')
|
||||
def compute_rfid(self):
|
||||
workorder = self.env['mrp.workorder'].search([('production_id', '=', self.production_id)])
|
||||
if workorder:
|
||||
for item in workorder:
|
||||
item.rfid_code = self.rfid_code
|
||||
# @api.onchange('rfid_code')
|
||||
# def compute_rfid(self):
|
||||
# workorder = self.env['mrp.workorder'].search([('production_id', '=', self.production_id.id)])
|
||||
# if workorder:
|
||||
# for item in workorder:
|
||||
# item.write({'rfid_code': self.rfid_code})
|
||||
|
||||
def get_plan_workorder(self, production_line):
|
||||
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
|
||||
@@ -821,6 +822,12 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
workpiece_delivery.write({'workpiece_code': embryo_workpiece_code})
|
||||
else:
|
||||
raise UserError('工件生产线不一致,请重新确认')
|
||||
else:
|
||||
workorder_rfid = self.env['mrp.workorder'].search(
|
||||
[('production_id', '=', workorder.production_id.id)])
|
||||
if workorder_rfid:
|
||||
for item in workorder_rfid:
|
||||
item.write({'rfid_code': barcode})
|
||||
|
||||
|
||||
class WorkPieceDelivery(models.Model):
|
||||
|
||||
@@ -166,6 +166,7 @@
|
||||
<field name="duration" widget="mrp_timer"
|
||||
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
|
||||
sum="real duration"/>
|
||||
<field name="glb_file" readonly="1" widget="Viewer3D" string="加工模型"/>
|
||||
<field name="processing_panel" readonly="1"
|
||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||
<field name="equipment_id"
|
||||
@@ -176,17 +177,17 @@
|
||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||
<field name="functional_fixture_code" force_save="1"
|
||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||
<field name="functional_fixture_type_id" force_save="1"
|
||||
<field name="functional_fixture_type_id"
|
||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||
<field name="rfid_code" force_save="1"/>
|
||||
</group>
|
||||
<group attrs='{"invisible": [("routing_type","=","获取CNC加工程序")]}'>
|
||||
<div>
|
||||
<label for="glb_file" string="加工模型"/>
|
||||
<field name="glb_file" readonly="1" widget="Viewer3D"/>
|
||||
</div>
|
||||
<!-- <field name="glb_file" string="模型" readonly="1" widget="Viewer3D"/>-->
|
||||
<field name="rfid_code" force_save="1" readonly="1"/>
|
||||
</group>
|
||||
<!-- <group>-->
|
||||
<!-- <div>-->
|
||||
<!-- <label for="glb_file" string="加工模型"/>-->
|
||||
<!-- <field name="glb_file" readonly="1" widget="Viewer3D"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!– <field name="glb_file" string="模型" readonly="1" widget="Viewer3D"/>–>-->
|
||||
<!-- </group>-->
|
||||
|
||||
<!-- <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',-->
|
||||
<!-- '前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>-->
|
||||
@@ -428,6 +429,7 @@
|
||||
<field name="results" invisible="1"/>
|
||||
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<group>
|
||||
<field name="detection_report_path" attrs='{"invisible":[("results","!=",False)]}'/>
|
||||
<field name="test_results" widget="selection" attrs='{"invisible":[("results","!=",False)]}'/>
|
||||
<field name="results" readonly="1" attrs='{"invisible":[("results","!=","合格")]}'/>
|
||||
</group>
|
||||
|
||||
@@ -331,7 +331,7 @@ class ShelfLocation(models.Model):
|
||||
record.storage_time = False
|
||||
|
||||
name = fields.Char('货位名称', required=True, size=20)
|
||||
barcode = fields.Char('货位编码', copy=False, size=15)
|
||||
barcode = fields.Char('货位编码', copy=False, size=50)
|
||||
# 货架
|
||||
shelf_id = fields.Many2one('sf.shelf', string='货架')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user