sf优化绑定托盘,工单form显示开始按钮 加工时间
This commit is contained in:
@@ -95,7 +95,7 @@ class MachineTool(models.Model):
|
||||
supplier_id = fields.Many2one('res.partner', string='制造商',
|
||||
domain="[('is_vendor', '=', True)]")
|
||||
registration_date = fields.Date('注册日期')
|
||||
state_zc = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册')
|
||||
state_zc = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册', tracking=True)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@api.constrains('rotate_speed')
|
||||
|
||||
@@ -162,6 +162,9 @@ class MrpProduction(models.Model):
|
||||
for work in rec.workorder_ids:
|
||||
work.sequence = current_sequence
|
||||
current_sequence += 1
|
||||
sfa = rec
|
||||
for a in sfa:
|
||||
print(a)
|
||||
|
||||
def _create_workorder1(self, k):
|
||||
for production in self:
|
||||
@@ -194,7 +197,6 @@ class MrpProduction(models.Model):
|
||||
# 根据加工面板的面数及对应的成品工序模板生成工单
|
||||
i = 0
|
||||
production.product_id.model_processing_panel = k
|
||||
processing_panel_len = len(k)
|
||||
for k in (production.product_id.model_processing_panel.split(',')):
|
||||
routingworkcenter = self.env['sf.product.model.type.routing.sort'].search(
|
||||
[('product_model_type_id', '=', production.product_id.product_model_type_id.id)],
|
||||
|
||||
@@ -171,7 +171,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'domain': [('workorder_id', '=', self.id)]
|
||||
}
|
||||
|
||||
tray_id = fields.Many2one('sf.tray', string="托盘信息")
|
||||
tray_id = fields.Many2one('sf.tray', string="托盘信息", tracking=True)
|
||||
|
||||
# 扫码绑定托盘方法
|
||||
|
||||
@@ -189,6 +189,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'production_id': self.production_id,
|
||||
'state': '占用',
|
||||
})
|
||||
self.work_state = "已绑定"
|
||||
orders = self.env['mrp.workorder'].search([('production_id', '=', self.production_id.id)])
|
||||
for a in orders:
|
||||
a.tray_id = values
|
||||
@@ -288,7 +289,16 @@ class ResMrpWorkOrder(models.Model):
|
||||
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
||||
productions._create_workorder2(self.processing_panel)
|
||||
else:
|
||||
return True
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': '工单详情',
|
||||
'res_model': 'mrp.workorder',
|
||||
'view_mode': 'tree',
|
||||
'context': {'active_id': self.id},
|
||||
'domain': [('state', 'not in', ['done', 'cancel', 'waiting', 'pending'])],
|
||||
'target': 'current',
|
||||
|
||||
}
|
||||
|
||||
# cnc程序获取
|
||||
def fetchCNC(self):
|
||||
@@ -363,7 +373,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 重写工单开始按钮方法
|
||||
def button_start(self):
|
||||
if self.state == 'waiting' or self.state == 'ready':
|
||||
if self.state == 'waiting' or self.state == 'ready' or self.state == 'progress':
|
||||
self.ensure_one()
|
||||
if any(not time.date_end for time in self.time_ids.filtered(lambda t: t.user_id.id == self.env.user.id)):
|
||||
return True
|
||||
@@ -408,7 +418,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
vals['date_planned_finished'] = start_date
|
||||
return self.write(vals)
|
||||
else:
|
||||
raise ValidationError(_('请先完成上一步工单'))
|
||||
raise UserError(_('请先完成上一步工单'))
|
||||
|
||||
|
||||
class CNCprocessing(models.Model):
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<field name="domain">[('state', 'not in', ['done', 'cancel'])]</field>
|
||||
<field name="context">{'search_default_workcenter_id': active_id}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_workorder">
|
||||
<p class="o_view_nocontent_workorder">
|
||||
没有工单要做!
|
||||
</p>
|
||||
<p>
|
||||
@@ -92,7 +92,8 @@
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<sheet position="before">
|
||||
<xpath expr="//field[@name='state']" position="before">
|
||||
|
||||
<field name='user_permissions' invisible="1"/>
|
||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done',
|
||||
@@ -108,9 +109,15 @@
|
||||
<button name="button_unblock" type="object" string="Unblock"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
||||
</sheet>
|
||||
</xpath>
|
||||
|
||||
<field name="production_id" position="after">
|
||||
<group>
|
||||
<field name="duration" widget="mrp_timer"
|
||||
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
|
||||
sum="real duration"/>
|
||||
</group>
|
||||
|
||||
<field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',
|
||||
'前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>
|
||||
</field>
|
||||
|
||||
5856
sf_manufacturing_translation/translation_Po/zh_CN.po
Normal file
5856
sf_manufacturing_translation/translation_Po/zh_CN.po
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,13 @@
|
||||
<field name="payment_term_id" position="after">
|
||||
<field name="deadline_of_delivery"/>
|
||||
</field>
|
||||
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace">
|
||||
<field name="name" widget="section_and_note_text" optional="show"
|
||||
string="参数说明(长宽高,体积,精度,材质)"/>
|
||||
</xpath>
|
||||
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user