Merge branch 'develop' into feature/验证合并的逻辑
This commit is contained in:
@@ -62,7 +62,7 @@ patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
|
|||||||
const dom1 = buttonsDom.children('.o_form_button_save')
|
const dom1 = buttonsDom.children('.o_form_button_save')
|
||||||
const dom2 = buttonsDom.children('.o_form_button_cancel')
|
const dom2 = buttonsDom.children('.o_form_button_cancel')
|
||||||
dom1.append('保存')
|
dom1.append('保存')
|
||||||
dom2.append('放弃保存')
|
dom2.append('不保存')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
|||||||
@@ -596,6 +596,9 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
if panel_workorder:
|
if panel_workorder:
|
||||||
panel_workorder.write({'production_line_state': '已下产线'})
|
panel_workorder.write({'production_line_state': '已下产线'})
|
||||||
workorder.write({'state': 'to be detected'})
|
workorder.write({'state': 'to be detected'})
|
||||||
|
workorder.check_ids.filtered(
|
||||||
|
lambda ch: ch.quality_state == 'waiting').write(
|
||||||
|
{'quality_state': 'none'})
|
||||||
else:
|
else:
|
||||||
res = {'Succeed': False, 'ErrorCode': 204,
|
res = {'Succeed': False, 'ErrorCode': 204,
|
||||||
'Error': 'DeviceId为%s没有对应的已配送工件数据' % ret['DeviceId']}
|
'Error': 'DeviceId为%s没有对应的已配送工件数据' % ret['DeviceId']}
|
||||||
|
|||||||
@@ -1674,13 +1674,13 @@ class MrpProduction(models.Model):
|
|||||||
url = '/api/intelligent_programming/reset_state_again'
|
url = '/api/intelligent_programming/reset_state_again'
|
||||||
config_url = configsettings['sf_url'] + url
|
config_url = configsettings['sf_url'] + url
|
||||||
ret = requests.post(config_url, json=res, data=None, headers=config_header)
|
ret = requests.post(config_url, json=res, data=None, headers=config_header)
|
||||||
ret = ret.json()
|
# ret = ret.json()
|
||||||
result = json.loads(ret['result'])
|
# result = json.loads(ret['result'])
|
||||||
logging.info('update_programming_state-ret:%s' % result)
|
# logging.info('update_programming_state-ret:%s' % result)
|
||||||
if result['status'] == 1:
|
# if result['status'] == 1:
|
||||||
self.write({'is_rework': True})
|
# self.write({'is_rework': True})
|
||||||
else:
|
# else:
|
||||||
raise UserError(ret['message'])
|
# raise UserError(ret['message'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.info('update_programming_state error:%s' % e)
|
logging.info('update_programming_state error:%s' % e)
|
||||||
raise UserError("更新编程单状态失败,请联系管理员")
|
raise UserError("更新编程单状态失败,请联系管理员")
|
||||||
|
|||||||
@@ -1543,7 +1543,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# 修改工单状态
|
# 修改工单状态
|
||||||
self.write({'state': 'to be detected'})
|
self.write({'state': 'to be detected'})
|
||||||
# 若关联的【质量检查_需送检】=true,则质量检查单的状态从“等待”更新为“待处理”
|
# 若关联的【质量检查_需送检】=true,则质量检查单的状态从“等待”更新为“待处理”
|
||||||
self.check_ids.filtered(lambda ch: ch.is_inspect is True).write({'quality_state': 'none'})
|
self.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write(
|
||||||
|
{'quality_state': 'none'})
|
||||||
|
|
||||||
|
|
||||||
class CNCprocessing(models.Model):
|
class CNCprocessing(models.Model):
|
||||||
|
|||||||
@@ -74,7 +74,9 @@
|
|||||||
<xpath expr="//field[@name='production_real_duration']" position="attributes">
|
<xpath expr="//field[@name='production_real_duration']" position="attributes">
|
||||||
<attribute name="invisible">1</attribute>
|
<attribute name="invisible">1</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='state']" position="after">
|
||||||
|
<field name="programming_state" optional="hide"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@
|
|||||||
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
||||||
<button name="button_finish" type="object" string="完成" class="btn-success" confirm="是否确认完工"
|
<button name="button_finish" type="object" string="完成" class="btn-success" confirm="是否确认完工"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|', '|',('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False),'&','&',('state', 'in', ('progress')), ('is_inspect', '=', True), ('routing_type','!=','CNC加工')]}"/>
|
||||||
|
|
||||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞"
|
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞"
|
||||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
@@ -533,7 +533,7 @@
|
|||||||
<page string="后置三元检测" attrs='{"invisible": [("individuation_page_PTD", "=", False)]}'>
|
<page string="后置三元检测" attrs='{"invisible": [("individuation_page_PTD", "=", False)]}'>
|
||||||
<group>
|
<group>
|
||||||
<field name="test_results"
|
<field name="test_results"
|
||||||
attrs='{"readonly":[("state","!=","to be detected"), "|",("routing_type","=","CNC加工"),("is_inspect", "=", True)],
|
attrs='{"readonly":["&","|",("state","!=","to be detected"), "|",("routing_type","=","CNC加工"),("is_inspect", "=", True),("state","in",["done","rework"])],
|
||||||
"invisible":[("results","!=",False)]}'/>
|
"invisible":[("results","!=",False)]}'/>
|
||||||
<!-- <field name="is_remanufacture" attrs='{"invisible":[("test_results","!=","报废")]}'/>-->
|
<!-- <field name="is_remanufacture" attrs='{"invisible":[("test_results","!=","报废")]}'/>-->
|
||||||
<!-- <field name="is_fetchcnc"-->
|
<!-- <field name="is_fetchcnc"-->
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class QualityCheck(models.Model):
|
|||||||
@api.depends('point_id.is_inspect')
|
@api.depends('point_id.is_inspect')
|
||||||
def _compute_quality_state(self):
|
def _compute_quality_state(self):
|
||||||
for qc in self:
|
for qc in self:
|
||||||
if qc.point_id.is_inspect and qc.quality_state == 'none':
|
if qc.point_id.is_inspect and qc.quality_state == 'none' and qc.workorder_id.state != 'to be detected':
|
||||||
qc.quality_state = 'waiting'
|
qc.quality_state = 'waiting'
|
||||||
elif not qc.point_id.is_inspect and qc.quality_state == 'waiting':
|
elif not qc.point_id.is_inspect and qc.quality_state == 'waiting':
|
||||||
qc.quality_state = 'none'
|
qc.quality_state = 'none'
|
||||||
@@ -62,7 +62,9 @@ class QualityCheck(models.Model):
|
|||||||
def do_pass(self):
|
def do_pass(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
super().do_pass()
|
super().do_pass()
|
||||||
if self.workorder_id and self.individuation_page_PTD is True:
|
if self.workorder_id:
|
||||||
|
if self.workorder_id.state in ('pending', 'waiting'):
|
||||||
|
raise ValidationError('工单未就绪!')
|
||||||
# 1)将页签“判定结果”的检测结果值同步到【工单_后置三元检测_检测结果】
|
# 1)将页签“判定结果”的检测结果值同步到【工单_后置三元检测_检测结果】
|
||||||
if self.test_results in ['返工', '报废']:
|
if self.test_results in ['返工', '报废']:
|
||||||
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
||||||
@@ -74,7 +76,9 @@ class QualityCheck(models.Model):
|
|||||||
def do_fail(self):
|
def do_fail(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
super().do_fail()
|
super().do_fail()
|
||||||
if self.workorder_id and self.individuation_page_PTD is True:
|
if self.workorder_id:
|
||||||
|
if self.workorder_id.state in ('pending', 'waiting'):
|
||||||
|
raise ValidationError('工单未就绪!')
|
||||||
# 1)将页签“判定结果”的检测结果值同步到【工单_后置三元检测_检测结果】
|
# 1)将页签“判定结果”的检测结果值同步到【工单_后置三元检测_检测结果】
|
||||||
if not self.test_results:
|
if not self.test_results:
|
||||||
raise ValidationError('请填写【判定结果】里的信息')
|
raise ValidationError('请填写【判定结果】里的信息')
|
||||||
|
|||||||
@@ -9,22 +9,24 @@
|
|||||||
<field name="production_id" invisible="1"/>
|
<field name="production_id" invisible="1"/>
|
||||||
<field name="work_state" invisible="1"/>
|
<field name="work_state" invisible="1"/>
|
||||||
<field name="individuation_page_PTD" invisible="1"/>
|
<field name="individuation_page_PTD" invisible="1"/>
|
||||||
<field name="production_line_id" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}"/>
|
<field name="production_line_id" attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||||
<field name="equipment_id" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}"/>
|
<field name="equipment_id" attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||||
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||||
attrs="{'invisible': ['|', '|',('model_file', '=', False), ('production_id', '=', False), ('individuation_page_PTD', '=', False)]}"/>
|
attrs="{'invisible': ['|',('model_file', '=', False), ('production_id', '=', False)]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='partner_id']" position="after">
|
<xpath expr="//field[@name='partner_id']" position="after">
|
||||||
<field name="processing_panel" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}"/>
|
<field name="processing_panel" attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||||
|
<!-- <field name="production_id" string="制造订单" readonly="1"-->
|
||||||
|
<!-- attrs="{'invisible': [('production_id', '=', False)]}"/>-->
|
||||||
<field name="workorder_id" string="工单号" readonly="1"
|
<field name="workorder_id" string="工单号" readonly="1"
|
||||||
attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}"/>
|
attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||||
<field name="is_inspect" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}"/>
|
<field name="is_inspect" attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[@name='notes']" position="before">
|
<xpath expr="//page[@name='notes']" position="before">
|
||||||
<page string="检测报告" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}">
|
<page string="检测报告" attrs="{'invisible': [('production_id', '=', False)]}">
|
||||||
<field name="detection_report" string="" widget="pdf_viewer"/>
|
<field name="detection_report" string="" widget="pdf_viewer"/>
|
||||||
</page>
|
</page>
|
||||||
<page string="判定结果" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}">
|
<page string="判定结果" attrs="{'invisible': [('production_id', '=', False)]}">
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="test_results" attrs="{'readonly': [('quality_state','in', ['pass', 'fail'])]}"/>
|
<field name="test_results" attrs="{'readonly': [('quality_state','in', ['pass', 'fail'])]}"/>
|
||||||
@@ -35,25 +37,33 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
<page string="2D图纸" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}">
|
<page string="2D图纸" attrs="{'invisible': [('production_id', '=', False)]}">
|
||||||
<field name="machining_drawings" string="" widget="adaptive_viewer"/>
|
<field name="machining_drawings" string="" widget="adaptive_viewer"/>
|
||||||
</page>
|
</page>
|
||||||
<page string="客户质量标准" attrs="{'invisible': ['|',('production_id', '=', False), ('individuation_page_PTD', '=', False)]}">
|
<page string="客户质量标准" attrs="{'invisible': [('production_id', '=', False)]}">
|
||||||
<field name="quality_standard" string="" widget="adaptive_viewer"/>
|
<field name="quality_standard" string="" widget="adaptive_viewer"/>
|
||||||
</page>
|
</page>
|
||||||
<page string="其他"
|
<page string="其他"
|
||||||
attrs="{'invisible': ['|','|', ('quality_state', 'not in', ['pass', 'fail']), ('production_id', '=', False),('individuation_page_PTD', '=', False)]}">
|
attrs="{'invisible': ['|',('quality_state', 'not in', ['pass', 'fail']), ('production_id', '=', False)]}">
|
||||||
<group>
|
<group>
|
||||||
<field name="write_uid" widget='many2one_avatar_user' string="判定人" readonly="1"/>
|
<field name="write_uid" widget='many2one_avatar_user' string="判定人" readonly="1"/>
|
||||||
<field name="write_date" string="判定时间" readonly="1"/>
|
<field name="write_date" string="判定时间" readonly="1"/>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='do_pass'][1]" position="attributes">
|
||||||
|
<attribute name="string">合格</attribute>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//header//button[@name='do_pass'][2]" position="attributes">
|
<xpath expr="//header//button[@name='do_pass'][2]" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'fail'),('work_state','in', ('done', 'rework'))]}</attribute>
|
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'fail'),('work_state','in', ('done', 'rework'))]}</attribute>
|
||||||
|
<attribute name="string">合格</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='do_fail'][1]" position="attributes">
|
||||||
|
<attribute name="string">不合格</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//header//button[@name='do_fail'][2]" position="attributes">
|
<xpath expr="//header//button[@name='do_fail'][2]" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'pass'),('work_state','in', ('done', 'rework'))]}</attribute>
|
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'pass'),('work_state','in', ('done', 'rework'))]}</attribute>
|
||||||
|
<attribute name="string">不合格</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user