增加解绑托盘功能
This commit is contained in:
@@ -135,6 +135,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
surface_technics_picking_count = fields.Integer("外协出入库", compute='_compute_surface_technics_picking_ids')
|
surface_technics_picking_count = fields.Integer("外协出入库", compute='_compute_surface_technics_picking_ids')
|
||||||
surface_technics_purchase_count = fields.Integer("外协采购", compute='_compute_surface_technics_purchase_ids')
|
surface_technics_purchase_count = fields.Integer("外协采购", compute='_compute_surface_technics_purchase_ids')
|
||||||
|
|
||||||
|
# 是否绑定托盘
|
||||||
|
is_trayed = fields.Boolean(string='是否绑定托盘', default=False)
|
||||||
|
|
||||||
@api.depends('name', 'production_id.name')
|
@api.depends('name', 'production_id.name')
|
||||||
def _compute_surface_technics_picking_ids(self):
|
def _compute_surface_technics_picking_ids(self):
|
||||||
for workorder in self:
|
for workorder in self:
|
||||||
@@ -1248,6 +1251,18 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
record.production_id.button_mark_done1()
|
record.production_id.button_mark_done1()
|
||||||
# record.production_id.state = 'done'
|
# record.production_id.state = 'done'
|
||||||
|
|
||||||
|
# 解绑托盘
|
||||||
|
def unbind_tray(self):
|
||||||
|
self.write({
|
||||||
|
'rfid_code': False,
|
||||||
|
'tray_serial_number': False,
|
||||||
|
'tray_product_id': False,
|
||||||
|
'tray_brand_id': False,
|
||||||
|
'tray_type_id': False,
|
||||||
|
'tray_model_id': False,
|
||||||
|
'is_trayed': False
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
# 将FTP的检测报告文件下载到临时目录
|
# 将FTP的检测报告文件下载到临时目录
|
||||||
def download_reportfile_tmp(self, workorder, reportpath):
|
def download_reportfile_tmp(self, workorder, reportpath):
|
||||||
@@ -1556,6 +1571,7 @@ class SfWorkOrderBarcodes(models.Model):
|
|||||||
raise UserError('该Rfid【%s】绑定的是【%s】, 不是托盘!!!' % (barcode, lot.product_id.name))
|
raise UserError('该Rfid【%s】绑定的是【%s】, 不是托盘!!!' % (barcode, lot.product_id.name))
|
||||||
self.process_state = '待检测'
|
self.process_state = '待检测'
|
||||||
self.date_start = datetime.now()
|
self.date_start = datetime.now()
|
||||||
|
self.is_trayed = True
|
||||||
else:
|
else:
|
||||||
raise UserError('没有找到Rfid为【%s】的托盘信息!!!' % barcode)
|
raise UserError('没有找到Rfid为【%s】的托盘信息!!!' % barcode)
|
||||||
# stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
|
# stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
<field name='name' invisible="1"/>
|
<field name='name' invisible="1"/>
|
||||||
<field name='is_rework' invisible="1"/>
|
<field name='is_rework' invisible="1"/>
|
||||||
<field name='is_delivery' invisible="1"/>
|
<field name='is_delivery' invisible="1"/>
|
||||||
|
<field name="is_trayed" invisible="1"/>
|
||||||
<!-- <field name='is_send_program_again' invisible="1"/>-->
|
<!-- <field name='is_send_program_again' invisible="1"/>-->
|
||||||
<!-- 工单form页面的开始停工按钮等 -->
|
<!-- 工单form页面的开始停工按钮等 -->
|
||||||
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
|
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
|
||||||
@@ -192,6 +193,9 @@
|
|||||||
<button name="button_rework_pre" type="object" string="返工"
|
<button name="button_rework_pre" type="object" string="返工"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('state','!=','progress'),('is_rework','=',True)]}"/>
|
attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('state','!=','progress'),('is_rework','=',True)]}"/>
|
||||||
|
<button name="unbind_tray" type="object" string="解绑托盘"
|
||||||
|
class="btn-primary"
|
||||||
|
attrs="{'invisible': ['|', '|', ('routing_type','!=','装夹预调'),('state','!=','progress'), ('is_trayed', '=', False)]}"/>
|
||||||
<button name="print_method" type="object" string="打印二维码" class="btn-primary"
|
<button name="print_method" type="object" string="打印二维码" class="btn-primary"
|
||||||
attrs="{'invisible': ['|',('routing_type','!=','解除装夹'),('state','!=','done')]}"/>
|
attrs="{'invisible': ['|',('routing_type','!=','解除装夹'),('state','!=','done')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user