工艺确认弹框优化
This commit is contained in:
@@ -378,10 +378,31 @@ class MrpProduction(models.Model):
|
|||||||
if process_parameters:
|
if process_parameters:
|
||||||
raise UserError(_("【工艺设计】-【参数】为%s的在【产品】中不存在,请先创建", ", ".join(process_parameters)))
|
raise UserError(_("【工艺设计】-【参数】为%s的在【产品】中不存在,请先创建", ", ".join(process_parameters)))
|
||||||
if production_confirmed:
|
if production_confirmed:
|
||||||
|
production_count = self.env['mrp.production'].search_count([
|
||||||
|
('origin', '=', self.origin),
|
||||||
|
('product_id', '=', self.product_id.id),
|
||||||
|
('state', '=', 'confirmed')
|
||||||
|
])
|
||||||
|
if production_count > 1:
|
||||||
return {
|
return {
|
||||||
'name': _('退回调整'),
|
'name': _('退回调整'),
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'view_mode': 'form',
|
'views': [(self.env.ref(
|
||||||
|
'sf_manufacturing.sf_production_technology_re_adjust_wizard_form_view').id,
|
||||||
|
'form')],
|
||||||
|
'res_model': 'sf.production.technology.re_adjust.wizard',
|
||||||
|
'target': 'new',
|
||||||
|
'context': {
|
||||||
|
'default_production_id': self.id,
|
||||||
|
'default_origin': self.origin,
|
||||||
|
}}
|
||||||
|
else:
|
||||||
|
return {
|
||||||
|
'name': _('退回调整'),
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'views': [(self.env.ref(
|
||||||
|
'sf_manufacturing.sf_production_technology_re_adjust_wizard_confirm_form_view').id,
|
||||||
|
'form')],
|
||||||
'res_model': 'sf.production.technology.re_adjust.wizard',
|
'res_model': 'sf.production.technology.re_adjust.wizard',
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
'context': {
|
'context': {
|
||||||
@@ -441,10 +462,31 @@ class MrpProduction(models.Model):
|
|||||||
error_panel.append(design.panel)
|
error_panel.append(design.panel)
|
||||||
else:
|
else:
|
||||||
if not error_panel and not process_parameters:
|
if not error_panel and not process_parameters:
|
||||||
|
production_count = self.env['mrp.production'].search_count([
|
||||||
|
('origin', '=', self.origin),
|
||||||
|
('product_id', '=', self.product_id.id),
|
||||||
|
('state', '=', 'technology_to_confirmed')
|
||||||
|
])
|
||||||
|
if production_count > 1:
|
||||||
return {
|
return {
|
||||||
'name': _('工艺确认'),
|
'name': _('工艺确认'),
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'view_mode': 'form',
|
'views': [(self.env.ref(
|
||||||
|
'sf_manufacturing.sf_production_technology_wizard_form_view').id,
|
||||||
|
'form')],
|
||||||
|
'res_model': 'sf.production.technology.wizard',
|
||||||
|
'target': 'new',
|
||||||
|
'context': {
|
||||||
|
'default_production_id': self.id,
|
||||||
|
'default_origin': self.origin,
|
||||||
|
}}
|
||||||
|
else:
|
||||||
|
return {
|
||||||
|
'name': _('工艺确认'),
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'views': [(self.env.ref(
|
||||||
|
'sf_manufacturing.sf_production_technology_wizard_confirm_form_view').id,
|
||||||
|
'form')],
|
||||||
'res_model': 'sf.production.technology.wizard',
|
'res_model': 'sf.production.technology.wizard',
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
'context': {
|
'context': {
|
||||||
@@ -774,6 +816,7 @@ class MrpProduction(models.Model):
|
|||||||
for workorders in reversed(proc_workorders):
|
for workorders in reversed(proc_workorders):
|
||||||
self.env['stock.picking'].create_outcontract_picking(workorders, production, sorted_workorders)
|
self.env['stock.picking'].create_outcontract_picking(workorders, production, sorted_workorders)
|
||||||
self.env['purchase.order'].get_purchase_order(workorders, production, product_id_to_production_names)
|
self.env['purchase.order'].get_purchase_order(workorders, production, product_id_to_production_names)
|
||||||
|
|
||||||
# 工单排序
|
# 工单排序
|
||||||
def _reset_work_order_sequence1(self, k):
|
def _reset_work_order_sequence1(self, k):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|||||||
@@ -21,6 +21,26 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="sf_production_technology_re_adjust_wizard_confirm_form_view">
|
||||||
|
<field name="name">sf.production.technology.re_adjust.wizard.form.view</field>
|
||||||
|
<field name="model">sf.production.technology.re_adjust.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form>
|
||||||
|
<sheet>
|
||||||
|
<field name="production_id" invisible="1"/>
|
||||||
|
<field name="origin" invisible="1"/>
|
||||||
|
<div>
|
||||||
|
是否确认退回调整
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<button string="确认" name="confirm" type="object" class="oe_highlight"/>
|
||||||
|
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||||
|
</footer>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="action_sf_production_technology_re_adjust_wizard" model="ir.actions.act_window">
|
<record id="action_sf_production_technology_re_adjust_wizard" model="ir.actions.act_window">
|
||||||
<field name="name">工艺退回调整</field>
|
<field name="name">工艺退回调整</field>
|
||||||
<field name="res_model">sf.production.technology.re_adjust.wizard</field>
|
<field name="res_model">sf.production.technology.re_adjust.wizard</field>
|
||||||
|
|||||||
@@ -13,7 +13,28 @@
|
|||||||
对当前制造订单,同一销售订单相同产品所生成的制造订单统一进行工艺调整与确认
|
对当前制造订单,同一销售订单相同产品所生成的制造订单统一进行工艺调整与确认
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<button string="确认" name="confirm" type="object" class="oe_highlight" confirm="是否确认工艺调整"/>
|
<button string="确认" name="confirm" type="object" class="oe_highlight"
|
||||||
|
confirm="是否确认工艺调整"/>
|
||||||
|
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||||
|
</footer>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="sf_production_technology_wizard_confirm_form_view">
|
||||||
|
<field name="name">sf.production.technology.wizard.form.view</field>
|
||||||
|
<field name="model">sf.production.technology.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form>
|
||||||
|
<sheet>
|
||||||
|
<field name="production_id" invisible="1"/>
|
||||||
|
<field name="origin" invisible="1"/>
|
||||||
|
<div>
|
||||||
|
是否确认工艺调整
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<button string="确认" name="confirm" type="object" class="oe_highlight"/>
|
||||||
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||||
</footer>
|
</footer>
|
||||||
</sheet>
|
</sheet>
|
||||||
|
|||||||
Reference in New Issue
Block a user