1、库位变更接口、库位信息接口优化;2、功能刀具模型from页面按钮样式及显示优化;
This commit is contained in:
@@ -450,10 +450,12 @@ class Manufacturing_Connect(http.Controller):
|
||||
if tool:
|
||||
location_id.product_sn_id = tool.barcode_id.id
|
||||
# 修改功能刀具状态
|
||||
# tool_install_time = {'Nomal': '正常', 'Warning': '报警'}
|
||||
# tool.write({
|
||||
# 'functional_tool_status': tool_install_time.get(item['State'])
|
||||
# })
|
||||
tool_state = {'Nomal': '正常', 'Warning': '报警'}
|
||||
if tool_state.get(item.get('State')):
|
||||
if tool_state.get(item.get('State')) != tool.functional_tool_status:
|
||||
tool.write({
|
||||
'functional_tool_status': tool_state.get(item['State'])
|
||||
})
|
||||
else:
|
||||
location_id.product_sn_id = False
|
||||
logging.info('货架已获取信息:%s' % item)
|
||||
|
||||
@@ -41,7 +41,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
max_lifetime_value = fields.Integer(string='最大寿命值(min)', readonly=True)
|
||||
alarm_value = fields.Integer(string='报警值(min)', readonly=True)
|
||||
used_value = fields.Integer(string='已使用值(min)', readonly=True)
|
||||
functional_tool_status = fields.Selection([('报警', '报警'), ('正常', '正常'), ('已拆除', '已拆除')],
|
||||
functional_tool_status = fields.Selection([('正常', '正常'), ('报警', '报警'), ('已拆除', '已拆除')],
|
||||
string='状态', store=True, default='正常')
|
||||
current_location_id = fields.Many2one('stock.location', string='当前位置', compute='_compute_current_location_id',
|
||||
store=True)
|
||||
@@ -256,6 +256,15 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
functional_tool_model_ids.append(functional_tool_model.id)
|
||||
return [(6, 0, functional_tool_model_ids)]
|
||||
|
||||
dismantle_num = fields.Integer('拆解单数量', compute='_compute_dismantle_num', store=True)
|
||||
dismantle_ids = fields.One2many('sf.functional.tool.dismantle', 'functional_tool_id', '拆解单')
|
||||
|
||||
@api.depends('dismantle_ids')
|
||||
def _compute_dismantle_num(self):
|
||||
for item in self:
|
||||
if item:
|
||||
item.dismantle_num = len(item.dismantle_ids)
|
||||
|
||||
def open_functional_tool_dismantle_form(self):
|
||||
self.ensure_one()
|
||||
dismantle_ids = self.env['sf.functional.tool.dismantle'].sudo().search([('functional_tool_id', '=', self.id)])
|
||||
|
||||
@@ -53,12 +53,14 @@
|
||||
<!-- type="object" class="btn-primary"/>-->
|
||||
<button class="oe_stat_button" groups="sf_base.group_sf_mrp_user"
|
||||
name="open_functional_tool_dismantle_form"
|
||||
icon="fa-list-ul"
|
||||
type="object">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span>
|
||||
拆解单
|
||||
icon="fa-credit-card"
|
||||
type="object"
|
||||
attrs="{'invisible': [('dismantle_num', '=', 0)]}">
|
||||
<div name="dismantle_num" class="o_field_widget o_readonly_modifier o_field_statinfo">
|
||||
<span class="o_stat_info o_stat_value">
|
||||
<field name="dismantle_num"/>
|
||||
</span>
|
||||
<span class="o_stat_text">拆解单</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="oe_stat_button" groups="sf_base.group_sf_mrp_user"
|
||||
|
||||
@@ -121,10 +121,12 @@ class MrsShelfLocationDataSync(models.Model):
|
||||
if tool:
|
||||
location_id.product_sn_id = tool.barcode_id.id
|
||||
# 修改功能刀具状态
|
||||
# tool_install_time = {'Nomal': '正常', 'Warning': '报警'}
|
||||
# tool.write({
|
||||
# 'functional_tool_status': tool_install_time.get(item['State'])
|
||||
# })
|
||||
tool_state = {'Nomal': '正常', 'Warning': '报警'}
|
||||
if tool_state.get(item.get('State')):
|
||||
if tool_state.get(item.get('State')) != tool.functional_tool_status:
|
||||
tool.write({
|
||||
'functional_tool_status': tool_state.get(item['State'])
|
||||
})
|
||||
else:
|
||||
location_id.product_sn_id = False
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user