From 3404cccdc8e0e7dde762a77988e14b675658d407 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 16 Jul 2024 15:33:27 +0800
Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E8=B4=A7=E6=9E=B6=E3=80=81?=
=?UTF-8?q?=E8=B4=A7=E4=BD=8D=E6=B7=BB=E5=8A=A0=E5=BE=AA=E7=8E=AF=E8=B4=A7?=
=?UTF-8?q?=E4=BD=8D=E6=A0=87=E7=AD=BE=EF=BC=9B2=E3=80=81=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=88=80=E5=85=B7=E6=8B=86=E8=A7=A3=E9=80=89=E5=8F=96?=
=?UTF-8?q?=E6=B3=95=E4=BA=BA=E8=B4=A7=E4=BD=8D=E6=B7=BB=E5=8A=A0=E5=8F=AA?=
=?UTF-8?q?=E8=83=BD=E9=80=89=E6=8B=A9=E5=BE=AA=E7=8E=AF=E8=B4=A7=E4=BD=8D?=
=?UTF-8?q?=E7=9A=84=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/base.py | 10 +++++-----
sf_warehouse/models/model.py | 2 ++
sf_warehouse/views/shelf_location.xml | 2 ++
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index 182141cf..0fb31704 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -803,7 +803,7 @@ class FunctionalToolDismantle(models.Model):
integral_lot_id = fields.Many2one('stock.lot', string='整体式刀具批次', compute='_compute_functional_tool_num',
store=True)
integral_freight_id = fields.Many2one('sf.shelf.location', '整体式刀具目标货位',
- domain="[('product_id', 'in', (integral_product_id, False))]")
+ domain="[('product_id', 'in', (integral_product_id, False)),('rotative_Boolean', '=', True)]")
# 刀片
blade_product_id = fields.Many2one('product.product', string='刀片', compute='_compute_functional_tool_num',
@@ -813,7 +813,7 @@ class FunctionalToolDismantle(models.Model):
blade_brand_id = fields.Many2one('sf.machine.brand', string='刀片品牌', related='blade_product_id.brand_id')
blade_lot_id = fields.Many2one('stock.lot', string='刀片批次', compute='_compute_functional_tool_num', store=True)
blade_freight_id = fields.Many2one('sf.shelf.location', '刀片目标货位',
- domain="[('product_id', 'in', (blade_product_id, False))]")
+ domain="[('product_id', 'in', (blade_product_id, False)),('rotative_Boolean', '=', True)]")
# 刀杆
bar_product_id = fields.Many2one('product.product', string='刀杆', compute='_compute_functional_tool_num',
@@ -823,7 +823,7 @@ class FunctionalToolDismantle(models.Model):
bar_brand_id = fields.Many2one('sf.machine.brand', string='刀杆品牌', related='bar_product_id.brand_id')
bar_lot_id = fields.Many2one('stock.lot', string='刀杆批次', compute='_compute_functional_tool_num', store=True)
bar_freight_id = fields.Many2one('sf.shelf.location', '刀杆目标货位',
- domain="[('product_id', 'in', (bar_product_id, False))]")
+ domain="[('product_id', 'in', (bar_product_id, False)),('rotative_Boolean', '=', True)]")
# 刀盘
pad_product_id = fields.Many2one('product.product', string='刀盘', compute='_compute_functional_tool_num',
@@ -833,7 +833,7 @@ class FunctionalToolDismantle(models.Model):
pad_brand_id = fields.Many2one('sf.machine.brand', string='刀盘品牌', related='pad_product_id.brand_id')
pad_lot_id = fields.Many2one('stock.lot', string='刀盘批次', compute='_compute_functional_tool_num', store=True)
pad_freight_id = fields.Many2one('sf.shelf.location', '刀盘目标货位',
- domain="[('product_id', 'in', (pad_product_id, False))]")
+ domain="[('product_id', 'in', (pad_product_id, False)),('rotative_Boolean', '=', True)]")
# 夹头
chuck_product_id = fields.Many2one('product.product', string='夹头', compute='_compute_functional_tool_num',
@@ -843,7 +843,7 @@ class FunctionalToolDismantle(models.Model):
chuck_brand_id = fields.Many2one('sf.machine.brand', string='夹头品牌', related='chuck_product_id.brand_id')
chuck_lot_id = fields.Many2one('stock.lot', string='夹头批次', compute='_compute_functional_tool_num', store=True)
chuck_freight_id = fields.Many2one('sf.shelf.location', '夹头目标货位',
- domain="[('product_id', 'in', (chuck_product_id, False))]")
+ domain="[('product_id', 'in', (chuck_product_id, False)),('rotative_Boolean', '=', True)]")
@api.onchange('functional_tool_id')
def _onchange_freight(self):
diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py
index ee212b2a..770d2672 100644
--- a/sf_warehouse/models/model.py
+++ b/sf_warehouse/models/model.py
@@ -254,6 +254,7 @@ class SfShelf(models.Model):
shelf_height = fields.Float(string='货架高度(m)')
shelf_layer = fields.Integer(string='货架层数')
layer_capacity = fields.Integer(string='层数容量')
+ shelf_rotative_Boolean = fields.Boolean('循环货架', default=False)
# 是否有货位
is_there_area = fields.Boolean(string='是否有货位', compute='_compute_is_there_area', default=False, store=True)
@@ -361,6 +362,7 @@ class ShelfLocation(models.Model):
name = fields.Char('货位名称', required=True, size=20)
barcode = fields.Char('货位编码', copy=False, size=50)
+ rotative_Boolean = fields.Boolean('循环货位', related='shelf_id.shelf_rotative_Boolean', store=True)
qr_code = fields.Binary(string='二维码', compute='_compute_location_qr_code', store=True)
# 货架
diff --git a/sf_warehouse/views/shelf_location.xml b/sf_warehouse/views/shelf_location.xml
index 418f7d5c..747c25a2 100644
--- a/sf_warehouse/views/shelf_location.xml
+++ b/sf_warehouse/views/shelf_location.xml
@@ -23,6 +23,7 @@
+
@@ -169,6 +170,7 @@
+
From 9655281b671b83a2d17f08f3efc4a16620ab9e2a Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Thu, 25 Jul 2024 15:21:36 +0800
Subject: [PATCH 2/2] =?UTF-8?q?1=E3=80=81=E8=A7=A3=E5=86=B3=20=E7=BC=BA?=
=?UTF-8?q?=E5=88=80=E7=8A=B6=E6=80=81=E7=AC=AC=E4=B8=80=E5=BC=A0=E5=B7=A5?=
=?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E4=B8=8D=E5=AF=B9=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_workorder.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 520af4f4..dc172a46 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -820,6 +820,10 @@ class ResMrpWorkOrder(models.Model):
# else:
# if workorder.state not in ['cancel', 'rework']:
# workorder.state = 'rework'
+ if workorder.production_id.state == 'pending_cam':
+ if workorder.routing_type == '装夹预调' and workorder.state in ['ready', 'waiting']:
+ if workorder.production_id.tool_state in ['1', '2']:
+ workorder.state = 'waiting'
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
# 'rework']:
# per_work = self.env['mrp.workorder'].search(
@@ -870,8 +874,12 @@ class ResMrpWorkOrder(models.Model):
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
else:
if self.production_id.tool_state in ['1', '2']:
+ if self.production_id.tool_state == '1':
+ state = '缺刀'
+ else:
+ state = '无效刀'
raise UserError(
- f'制造订单【{self.production_id.name}】功能刀具状态为【{self.production_id.tool_state}】!')
+ f'制造订单【{self.production_id.name}】功能刀具状态为【{state}】!')
if self.routing_type == '解除装夹':
'''
记录开始时间