Accept Merge Request #866: (feature/制造代码优化 -> develop)

Merge Request: 处理排程处按钮的显隐规则

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/866?initial=true
This commit is contained in:
马广威
2024-02-27 17:33:50 +08:00
committed by Coding
3 changed files with 10 additions and 8 deletions

View File

@@ -693,7 +693,7 @@ class CNCprocessing(models.Model):
workorder = self.env['mrp.workorder'].search([('production_id.name', '=', ret['production_order_no']),
('processing_panel', '=', obj['processing_panel']),
('routing_type', '=', 'CNC加工')])
logging.info('workorder:%s' % workorder.name)
logging.info('workorder:%s' % workorder.id)
logging.info('obj:%s' % obj)
if obj['program_name'] in program_path:
logging.info('obj:%s' % obj['program_name'])
@@ -711,7 +711,7 @@ class CNCprocessing(models.Model):
'cutting_tool_handle_type': obj['cutting_tool_handle_type'],
'estimated_processing_time': obj['estimated_processing_time'],
'remark': obj['remark'],
'program_path': program_path
'program_path': program_path.replace('/tmp', '')
})
cnc_processing.get_cnc_processing_file(program_path_tmp, cnc_processing, program_path)
# cnc_workorder.state = 'done'

View File

@@ -29,7 +29,6 @@ class FtpController():
logging.info("进入FTP目录 ")
self.ftp.cwd(target_dir) # 切换工作路径
logging.info('FTP目录:%s' % target_dir)
self.ftp.mkd('detection')
remotenames = self.ftp.nlst()
logging.info('FTP目录文件:%s' % remotenames)
for file in remotenames:

View File

@@ -22,12 +22,15 @@
<field name="production_line_id"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="actual_start_time"/>
<field name="actual_end_time"/>
<field name="actual_process_time"/>
<field name="schedule_setting"/>
<button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object"
attrs="{'invisible': [('state', 'not in', ['draft'])]}"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('actual_start_time', '!=', False)]}"
groups="sf_base.group_plan_dispatch"/>
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程"
type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}"
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程" type="object"
attrs="{'invisible': ['|', ('state', '!=', 'done'), ('actual_start_time', '!=', False)]}"
groups="sf_base.group_plan_dispatch"/>
</tree>
</field>
@@ -42,9 +45,9 @@
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"
options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'
groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'done')]}"/>
groups="sf_base.group_plan_dispatch" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('actual_start_time', '!=', False)]}"/>
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"
groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'draft')]}"/>
groups="sf_base.group_plan_dispatch" attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('actual_start_time', '!=', False)]}"/>
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->