1、优化功能刀具预警记录跳转功能刀具拆解单链接方法;2、优化功能刀具预警界面及搜索等方法;3、优化拆解单功能及界面;4、处理功能刀具组装时,刀柄状态不实时变更问题
This commit is contained in:
@@ -947,6 +947,12 @@ class FunctionalToolDismantle(models.Model):
|
|||||||
if self.chuck_freight_id == self.pad_freight_id:
|
if self.chuck_freight_id == self.pad_freight_id:
|
||||||
raise ValidationError('【夹头】和【刀盘】的目标货位重复,请重新选择!')
|
raise ValidationError('【夹头】和【刀盘】的目标货位重复,请重新选择!')
|
||||||
|
|
||||||
|
def tool_scrap(self):
|
||||||
|
self.scrap_boolean = True
|
||||||
|
|
||||||
|
def tool_no_scrap(self):
|
||||||
|
self.scrap_boolean = False
|
||||||
|
|
||||||
def confirmation_disassembly(self):
|
def confirmation_disassembly(self):
|
||||||
logging.info('%s刀具确认开始拆解' % self.dismantle_cause)
|
logging.info('%s刀具确认开始拆解' % self.dismantle_cause)
|
||||||
code = self.code
|
code = self.code
|
||||||
@@ -1016,6 +1022,14 @@ class FunctionalToolDismantle(models.Model):
|
|||||||
'rfid': '%s(已拆解)' % self.rfid,
|
'rfid': '%s(已拆解)' % self.rfid,
|
||||||
'state': '已拆解'
|
'state': '已拆解'
|
||||||
})
|
})
|
||||||
|
# ==================修改刀具预警信息的值============
|
||||||
|
warning_id = self.env['sf.functional.tool.warning'].sudo().search(
|
||||||
|
[('functional_tool_id', '=', self.functional_tool_id.id)])
|
||||||
|
if warning_id:
|
||||||
|
warning_id.sudo().write({
|
||||||
|
'dispose_user': self.env.user.name,
|
||||||
|
'dispose_time': fields.Datetime.now()
|
||||||
|
})
|
||||||
logging.info('【%s】刀具拆解成功!' % self.name)
|
logging.info('【%s】刀具拆解成功!' % self.name)
|
||||||
|
|
||||||
def create_tool_picking_scrap(self, datas):
|
def create_tool_picking_scrap(self, datas):
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ class FunctionalToolWarning(models.Model):
|
|||||||
elif dismantle_ids:
|
elif dismantle_ids:
|
||||||
action.update({
|
action.update({
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
'res_id': dismantle_ids.ids
|
'domain': [('id', 'in', dismantle_ids.ids)],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -803,7 +803,8 @@
|
|||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="functional_tool_id" placeholder="请选择将要拆解的功能刀具"
|
<field name="functional_tool_id" placeholder="请选择将要拆解的功能刀具"
|
||||||
options="{'no_create': True}" attrs="{'readonly': [('state', '=', '已拆解')]}"/>
|
options="{'no_create': True}"
|
||||||
|
attrs="{'readonly': ['|',('state', '=', '已拆解'),('id', '!=', False)]}"/>
|
||||||
<field name="rfid" attrs="{'invisible': [('rfid', '=', '')]}"/>
|
<field name="rfid" attrs="{'invisible': [('rfid', '=', '')]}"/>
|
||||||
<field name="rfid_dismantle" attrs="{'invisible': [('rfid_dismantle', '=', False)]}"/>
|
<field name="rfid_dismantle" attrs="{'invisible': [('rfid_dismantle', '=', False)]}"/>
|
||||||
<field name="tool_type_id"/>
|
<field name="tool_type_id"/>
|
||||||
@@ -833,10 +834,26 @@
|
|||||||
<notebook>
|
<notebook>
|
||||||
<page string="物料组装信息">
|
<page string="物料组装信息">
|
||||||
<group>
|
<group>
|
||||||
<group string="刀柄" attrs="{'invisible': [('handle_product_id', '=', False)]}">
|
<group string="刀柄" attrs="{'invisible': [('handle_product_id', '=', False)]}"
|
||||||
|
col="1">
|
||||||
|
<group attrs="{'invisible': [('dismantle_cause', 'not in', ['寿命到期报废','崩刀报废'])]}">
|
||||||
|
<group col="3">
|
||||||
|
<group>
|
||||||
|
<field name="scrap_boolean" string="是否报废"/>
|
||||||
|
</group>
|
||||||
|
<group> </group>
|
||||||
|
<group>
|
||||||
|
<button string="报废" name="tool_scrap" type="object"
|
||||||
|
class="btn-primary" confirm="是否确认报废刀柄"
|
||||||
|
attrs="{'invisible': [('scrap_boolean', '=', True)]}"/>
|
||||||
|
<button string="取消" name="tool_no_scrap" type="object"
|
||||||
|
class="btn-primary" confirm="是否取消报废刀柄"
|
||||||
|
attrs="{'invisible': [('scrap_boolean', '=', False)]}"/>
|
||||||
|
<group> </group>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="scrap_boolean" string="是否报废"
|
|
||||||
attrs="{'invisible': [('dismantle_cause', 'not in', ['寿命到期报废','崩刀报废'])], 'readonly': [('state', '=', '已拆解')]}"/>
|
|
||||||
<field name="handle_rfid" string="Rfid"/>
|
<field name="handle_rfid" string="Rfid"/>
|
||||||
<field name="handle_lot_id" string="序列号"/>
|
<field name="handle_lot_id" string="序列号"/>
|
||||||
<field name="handle_product_id" string="名称"/>
|
<field name="handle_product_id" string="名称"/>
|
||||||
@@ -952,8 +969,9 @@
|
|||||||
<field name="model">sf.functional.tool.dismantle</field>
|
<field name="model">sf.functional.tool.dismantle</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
|
<field name="rfid"/>
|
||||||
<field name="functional_tool_id"/>
|
<field name="functional_tool_id"/>
|
||||||
<field name="code" string="拆解单编码"/>
|
<field name="code" string="拆解单号"/>
|
||||||
<filter name="no_dismantle_state" string="未拆解" domain="[('state','!=','已拆解')]"/>
|
<filter name="no_dismantle_state" string="未拆解" domain="[('state','!=','已拆解')]"/>
|
||||||
<filter name="dismantle_state" string="已拆解" domain="[('state','=','已拆解')]"/>
|
<filter name="dismantle_state" string="已拆解" domain="[('state','=','已拆解')]"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|||||||
@@ -842,6 +842,8 @@ class StockPicking(models.Model):
|
|||||||
stock_move_id = self.env['stock.move']
|
stock_move_id = self.env['stock.move']
|
||||||
datas = {'data': [], 'picking_id': picking_id}
|
datas = {'data': [], 'picking_id': picking_id}
|
||||||
if obj.handle_code_id:
|
if obj.handle_code_id:
|
||||||
|
# 修改刀柄序列号状态为【在用】
|
||||||
|
obj.handle_code_id.sudo().write({'tool_material_status': '在用'})
|
||||||
datas['data'].append(
|
datas['data'].append(
|
||||||
{'current_location_id': self.env['sf.shelf.location'], 'lot_id': obj.handle_code_id})
|
{'current_location_id': self.env['sf.shelf.location'], 'lot_id': obj.handle_code_id})
|
||||||
if obj.integral_product_id:
|
if obj.integral_product_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user