diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 2cadeef5..20077f3c 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -180,6 +180,11 @@ class ResMrpWorkOrder(models.Model):
detection_report = fields.Binary('检测报告', readonly=True)
is_remanufacture = fields.Boolean(string='是否重新生成制造订单', default=True)
+ @api.onchange('rfid_code')
+ def _onchange(self):
+ if self.rfid_code and self.state == 'progress':
+ self.workpiece_delivery_ids[0].write({'rfid_code': self.rfid_code})
+
def get_plan_workorder(self, production_line):
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
tomorrow_start = tomorrow + ' 00:00:00'
@@ -1106,6 +1111,7 @@ class WorkPieceDelivery(models.Model):
status = fields.Selection(
[('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', default='待下发')
is_cnc_program_down = fields.Boolean('程序是否下发', default=False)
+ rfid_code = fields.Char('rfid码')
active = fields.Boolean(string="有效", default=True)
@api.model
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index 0ebc58bb..9cfb9e40 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -43,7 +43,7 @@
{'invisible':
['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]}
-
+
1
@@ -111,36 +111,38 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/>
+ 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)]}"/>
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -622,12 +624,9 @@
sf.workpiece.delivery
-
-
-
-
+
diff --git a/sf_manufacturing/wizard/workpiece_delivery_wizard.py b/sf_manufacturing/wizard/workpiece_delivery_wizard.py
index e8222a1b..d606b8b2 100644
--- a/sf_manufacturing/wizard/workpiece_delivery_wizard.py
+++ b/sf_manufacturing/wizard/workpiece_delivery_wizard.py
@@ -11,6 +11,11 @@ class WorkpieceDeliveryWizard(models.TransientModel):
delivery_ids = fields.Many2many('sf.workpiece.delivery', string='配送')
workorder_id = fields.Many2one('mrp.workorder', string='工单')
+ production_ids = fields.Many2many('mrp.production', string='制造订单号')
+ destination_production_line_id = fields.Many2one('sf.production.line', '目的生产线')
+ feeder_station_start_id = fields.Many2one('sf.agv.site', '起点接驳站')
+ feeder_station_destination_id = fields.Many2one('sf.agv.site', '目的接驳站')
+
def confirm(self):
if self.workorder_id: