This commit is contained in:
gqh
2023-01-12 14:16:05 +08:00
parent f5cfd50d33
commit c212810d60
2 changed files with 6 additions and 9 deletions

View File

@@ -228,14 +228,8 @@ class ResMrpWorkOrder(models.Model):
tray = self.env['sf.tray'].search([("production_id", "=", self.production_id.id)])
if tray:
tray.unclamp()
return {
'name': _("工单"),
'view_mode': 'form',
'res_model': 'mrp.workorder',
'res_id': self.id,
'type': 'ir.actions.act_window',
'target': 'new'
}
self.tray_id = tray
# return {
# 'name': _('New Maintenance Request'),

View File

@@ -11,6 +11,9 @@
</field>
<field name="name" position="after">
<field name="processing_panel"/>
</field>
<field name="state" position="after">
<field name="work_state"/>
</field>
<xpath expr="//button[@name='button_start']" position="attributes">
<attribute name="attrs">{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done',
@@ -286,7 +289,7 @@
<div class="col-12 col-lg-6 o_setting_box">
<button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"
attrs='{"invisible": ["|",("state","!=","progress"),("user_permissions","=",False)]}'/>
attrs='{"invisible": ["|","|",("tray_id","!=",False),("state","!=","progress"),("user_permissions","=",False)]}'/>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<button type="action" class="oe_highlight" name="sf_manufacturing.label_sf_tray_code1"