From 070890e3b64582f68542edf64edf1dde741646c4 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Mon, 5 Aug 2024 16:26:54 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20=20SF=EF=BC=8C?=
=?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E7=94=9F?=
=?UTF-8?q?=E6=88=90=E7=9A=84=E9=87=87=E8=B4=AD=E5=8D=95=E5=9D=AF=E6=96=99?=
=?UTF-8?q?=E5=85=A5=E5=BA=93=E6=97=B6=E5=88=B0=E5=8E=9F=E6=9D=90=E6=96=99?=
=?UTF-8?q?=E5=BA=93BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/stock.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index 4bf7cc72..c202fc71 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -217,6 +217,23 @@ class StockRule(models.Model):
(
p.move_dest_ids.procure_method != 'make_to_order' and not
p.move_raw_ids and not p.workorder_ids)).action_confirm()
+ # 处理 根据制造订单生成的采购单坯料入库时到原材料库,手动将原材料位置该为坯料存货区
+ for production in productions:
+ if production.picking_ids:
+ product_type_id = production.picking_ids[0].move_ids[0].product_id.categ_id
+ if product_type_id.name == '坯料':
+ location_id = self.env['stock.location'].search([('name', '=', '坯料存货区')])
+ if not location_id:
+ logging.info(f'没有搜索到【坯料存货区】: {location_id}')
+ break
+ for picking_id in production.picking_ids:
+ if picking_id.picking_type_id.name == '内部调拨':
+ if picking_id.location_dest_id.product_type != product_type_id:
+ picking_id.location_dest_id = location_id.id
+ elif picking_id.picking_type_id.name == '生产发料':
+ if picking_id.location_id.product_type != product_type_id:
+ picking_id.location_id = location_id.id
+
for production in productions:
'''
创建制造订单时生成序列号
From e92c9675b6aeb235cf2ad32aed7b24060e4dab58 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Mon, 5 Aug 2024 17:18:54 +0800
Subject: [PATCH 2/3] =?UTF-8?q?1=E3=80=81=20=E5=A4=84=E7=90=86=20=E5=86=85?=
=?UTF-8?q?=E9=83=A8=E8=B0=83=E6=8B=A8=E5=8D=95=EF=BC=8C=E5=9C=A8=E9=80=89?=
=?UTF-8?q?=E6=8B=A9=E7=9B=AE=E6=A0=87=E8=B4=A7=E4=BD=8D=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E9=9A=90=E8=97=8F=E5=B8=A6=E5=BE=AA=E7=8E=AF=E8=B4=A7=E4=BD=8D?=
=?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=9A=84=E8=B4=A7=E4=BD=8D=E4=B8=8D=E8=BF=9B?=
=?UTF-8?q?=E8=A1=8C=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_base/views/fixture_view.xml | 14 +++++++-------
sf_warehouse/views/change_stock_move_views.xml | 3 ++-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/sf_base/views/fixture_view.xml b/sf_base/views/fixture_view.xml
index 0e86738d..07dadd33 100644
--- a/sf_base/views/fixture_view.xml
+++ b/sf_base/views/fixture_view.xml
@@ -171,7 +171,7 @@
-
+
@@ -197,7 +197,7 @@
-
+
@@ -220,7 +220,7 @@
-
+
@@ -248,7 +248,7 @@
-
+
@@ -278,7 +278,7 @@
-
+
@@ -307,7 +307,7 @@
-
+
@@ -335,7 +335,7 @@
-
+
diff --git a/sf_warehouse/views/change_stock_move_views.xml b/sf_warehouse/views/change_stock_move_views.xml
index c5df0881..9e1073c9 100644
--- a/sf_warehouse/views/change_stock_move_views.xml
+++ b/sf_warehouse/views/change_stock_move_views.xml
@@ -21,7 +21,8 @@
+ '=', there_is_no_sn), ('rotative_Boolean', '=', False)]"
+ options="{'no_create': True,'no_create_edit':True}"/>
From a03cb31b295bc781236c57c6e3fb2fabc9e16c89 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 7 Aug 2024 17:11:12 +0800
Subject: [PATCH 3/3] =?UTF-8?q?1=E3=80=81=E5=A4=84=E7=90=86=20=20SF?=
=?UTF-8?q?=E9=94=80=E5=94=AE=E5=8D=95=E9=9C=80=E6=B1=82=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=20=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_sale/views/sale_order_view.xml | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml
index 7bf352eb..00cca206 100644
--- a/sf_sale/views/sale_order_view.xml
+++ b/sf_sale/views/sale_order_view.xml
@@ -34,15 +34,13 @@
- {'invisible': ['|','&',('state', 'in',
- ['cancel','draft']),('check_status',
- 'in',
- [False,'approved']),'&',('check_status', '=', 'approved'),('state', 'in',
- ['sale','cancel','draft'])]}
+ {'invisible': ['|','&',('check_status', '!=', 'approved'),('state',
+ 'in', ['draft','cancel']),'&','&',('check_status', '=', 'approved'),('state', 'in',
+ ['sale','cancel']),('delivery_status', '!=', False)]}