报废
This commit is contained in:
@@ -187,6 +187,9 @@ class MrpProduction(models.Model):
|
|||||||
production.state = 'rework'
|
production.state = 'rework'
|
||||||
if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids):
|
if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids):
|
||||||
production.state = 'scrap'
|
production.state = 'scrap'
|
||||||
|
if any(dr.test_results == '报废' and dr.handle_result == '已处理' for dr in
|
||||||
|
production.detection_result_ids):
|
||||||
|
production.state = 'cancel'
|
||||||
# 如果制造订单的功能刀具为【无效刀】则制造订单状态改为返工
|
# 如果制造订单的功能刀具为【无效刀】则制造订单状态改为返工
|
||||||
if production.tool_state == '2':
|
if production.tool_state == '2':
|
||||||
production.state = 'rework'
|
production.state = 'rework'
|
||||||
|
|||||||
@@ -533,8 +533,7 @@ class ProductionLot(models.Model):
|
|||||||
class StockPicking(models.Model):
|
class StockPicking(models.Model):
|
||||||
_inherit = 'stock.picking'
|
_inherit = 'stock.picking'
|
||||||
|
|
||||||
# workorder_in_id = fields.One2many('mrp.workorder', 'picking_in_id')
|
surface_technics_parameters_id = fields.Many2one('sf.production.process.parameter', string="表面工艺可选参数")
|
||||||
# workorder_out_id = fields.One2many('mrp.workorder', 'picking_out_id')
|
|
||||||
|
|
||||||
# 设置外协出入单的名称
|
# 设置外协出入单的名称
|
||||||
def _get_name_Res(self, rescode):
|
def _get_name_Res(self, rescode):
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ class ProductionWizard(models.TransientModel):
|
|||||||
self.production_id.update_programming_state()
|
self.production_id.update_programming_state()
|
||||||
self.production_id.action_cancel()
|
self.production_id.action_cancel()
|
||||||
self.production_id.detection_result_ids.write({'handle_result': '已处理'})
|
self.production_id.detection_result_ids.write({'handle_result': '已处理'})
|
||||||
self.production_id.write({'scrap_ids': [(0, 0, {
|
self.production_id.write({'state': 'cancel', 'scrap_ids': [(0, 0, {
|
||||||
|
'name': self.env['ir.sequence'].next_by_code('stock.scrap') or _('New'),
|
||||||
'product_id': self.production_id.product_id.id,
|
'product_id': self.production_id.product_id.id,
|
||||||
'scrap_qty': 1,
|
'scrap_qty': 1,
|
||||||
'lot_id': self.production_id.move_line_raw_ids.lot_id.id,
|
'lot_id': self.production_id.move_line_raw_ids.lot_id.id,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form>
|
||||||
<sheet>
|
<sheet>
|
||||||
<field name="production_id" invisible="True"/>
|
<field name="production_id" invisible="1"/>
|
||||||
<div>
|
<div>
|
||||||
重新生成制造订单
|
重新生成制造订单
|
||||||
<field name="is_remanufacture"/>
|
<field name="is_remanufacture"/>
|
||||||
@@ -28,6 +28,9 @@
|
|||||||
<field name="name">报废</field>
|
<field name="name">报废</field>
|
||||||
<field name="res_model">sf.production.wizard</field>
|
<field name="res_model">sf.production.wizard</field>
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
|
<field name="context">{
|
||||||
|
'default_production_id': active_id}
|
||||||
|
</field>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user