From 90f8c4143e6228a0821306ffe67f8b8c91983157 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Tue, 23 Jan 2024 10:34:49 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E7=89=A9=E6=B5=81=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E5=A2=9E=E9=87=8F=E5=BC=80=E5=8F=91=EF=BC=8C=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=8E=9F=E7=94=9F=E6=8C=89=E9=92=AE=EF=BC=8C?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_bf_connect/controllers/controllers.py | 1 +
sf_bf_connect/models/jd_eclp.py | 12 +++++++
sf_bf_connect/views/view.xml | 24 +++++++++++--
sf_maintenance/security/ir.model.access.csv | 3 +-
sf_maintenance/security/ir_rule_data.xml | 13 +++++++
.../views/mrp_production_addional_change.xml | 36 +++++++++----------
sf_sale/models/sale_order.py | 1 +
7 files changed, 69 insertions(+), 21 deletions(-)
diff --git a/sf_bf_connect/controllers/controllers.py b/sf_bf_connect/controllers/controllers.py
index 1a5f3fa5..b90a1645 100644
--- a/sf_bf_connect/controllers/controllers.py
+++ b/sf_bf_connect/controllers/controllers.py
@@ -33,6 +33,7 @@ class Sf_Bf_Connect(http.Controller):
aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)])
logging.info('get_bfm_process_or===================================:%s' % order_id.name)
aa.default_code = kw['order_number']
+ aa.logistics_way = kw['logistics_way']
logging.info('get_bfm_process_order_listaaaaaaaaaaaaaaaaaaaaaaaaaaaa================:%s' % aa.default_code)
for item in bfm_process_order_list:
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,
diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py
index 85092b57..8961e482 100644
--- a/sf_bf_connect/models/jd_eclp.py
+++ b/sf_bf_connect/models/jd_eclp.py
@@ -42,6 +42,14 @@ class JdEclp(models.Model):
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
bill_show = fields.Binary(string='物流面单展示', readonly=True)
check_out = fields.Char(string='查询是否为出库单', compute='_check_is_out')
+ # 是否下了快递单
+ is_bill = fields.Boolean(string='是否下了快递单', default=False)
+ # 物流状态
+ logistics_status = fields.Selection([('0', '未下单'), ('1', '已下单'), ('2', '已获取物流面单'), ('3', '已打印物流单')],
+ string='物流状态', default='0')
+
+ logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
+
@api.depends('name')
def _check_is_out(self):
@@ -68,6 +76,7 @@ class JdEclp(models.Model):
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
# self.receiverCountyName and self.receiverTownName:
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
+ self.logistics_way = sale_order_id.logistics_way
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
# if sale_order_id.address_of_delivery != False:
# if not sale_order_id:
@@ -141,6 +150,8 @@ class JdEclp(models.Model):
response = requests.post(url2, json=json2, data=None)
# _logger.info('调用成功2', response.json()['result']['wbNo'])
self.carrier_tracking_ref = response.json()['result']['wbNo']
+ self.is_bill = True
+ self.logistics_status = '1'
# else:
# raise UserError("选择京东物流才能下单呦")
@@ -180,3 +191,4 @@ class JdEclp(models.Model):
# 'model_name': 'stock.picking',
})
_logger.info(attachment)
+ self.logistics_status = '2'
diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml
index c4f0e446..90d36123 100644
--- a/sf_bf_connect/views/view.xml
+++ b/sf_bf_connect/views/view.xml
@@ -12,16 +12,29 @@
+
+
+
+
+
+
+
+
+
+
+
物流
stock.picking
+
+
+ attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提']}"/>
+ attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', False), ('logistics_way', '=', '自提']]}"/>
@@ -31,6 +44,12 @@
stock.picking
+
+
+
+
+
+
@@ -48,6 +67,7 @@
+
diff --git a/sf_maintenance/security/ir.model.access.csv b/sf_maintenance/security/ir.model.access.csv
index ca18d942..1ff4f5e0 100644
--- a/sf_maintenance/security/ir.model.access.csv
+++ b/sf_maintenance/security/ir.model.access.csv
@@ -12,7 +12,8 @@ access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equi
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_manager,1,1,1,0
-access_maintenance_request_group_plan_dispatch,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0
+access_maintenance_system_user,equipment.request system user,maintenance.model_maintenance_request,base.group_user,1,0,0,0
+
access_maintenance_equipment_group_plan_dispatch,maintenance.equipment,maintenance.model_maintenance_equipment,sf_base.group_plan_dispatch,1,0,0,0
access_sf_maintenance_logs_group_plan_dispatch,sf_maintenance_logs,model_sf_maintenance_logs,sf_base.group_plan_dispatch,1,0,0,0
access_maintenance_standard_image_group_plan_dispatch,maintenance_standard_image,model_maintenance_standard_image,sf_base.group_plan_dispatch,1,0,0,0
diff --git a/sf_maintenance/security/ir_rule_data.xml b/sf_maintenance/security/ir_rule_data.xml
index 3aa4366f..411afb45 100644
--- a/sf_maintenance/security/ir_rule_data.xml
+++ b/sf_maintenance/security/ir_rule_data.xml
@@ -11,5 +11,18 @@
False
False
+
+
+
+ Maintenance Request Plan Dispatch Rule
+
+
+
+ True
+ False
+ False
+ False
+
+
diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml
index 5c7f9cc0..ccf6c19c 100644
--- a/sf_manufacturing/views/mrp_production_addional_change.xml
+++ b/sf_manufacturing/views/mrp_production_addional_change.xml
@@ -76,7 +76,7 @@
confirm="There are no components to consume. Are you still sure you want to continue?" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
-
+
+ ('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
@@ -108,41 +108,41 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
@@ -157,28 +157,28 @@
-
-
-
-
-
diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py
index d2e97272..6cbd1fd7 100644
--- a/sf_sale/models/sale_order.py
+++ b/sf_sale/models/sale_order.py
@@ -7,6 +7,7 @@ from odoo.exceptions import UserError
class ReSaleOrder(models.Model):
_inherit = 'sale.order'
+ logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
deadline_of_delivery = fields.Date('订单交期', tracking=True)
person_of_delivery = fields.Char('交货人')
telephone_of_delivery = fields.Char('交货人电话号码')
From 5c129331e054911f26a00d88e42f2ee0bbb16f80 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Tue, 23 Jan 2024 16:13:53 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=EF=BC=9A=E5=BD=93=E4=B8=BA=E9=9D=9E=E2=80=9C=E8=87=AA=E6=8F=90?=
=?UTF-8?q?=E2=80=9D=E5=8D=95=E6=97=B6=EF=BC=8C=E5=BF=85=E9=A1=BB=E8=BF=9B?=
=?UTF-8?q?=E8=A1=8C=E7=89=A9=E6=B5=81=E4=B8=8B=E5=8D=95=E6=89=8D=E8=83=BD?=
=?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=87=BA=E5=BA=93=E6=93=8D=E4=BD=9C=E3=80=82?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=AD=97=E6=AE=B5=E7=9A=84=E6=98=BE?=
=?UTF-8?q?=E9=9A=90=E6=8E=A7=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_bf_connect/models/jd_eclp.py | 15 +++++++++++++--
sf_bf_connect/views/view.xml | 9 +++++----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py
index 8961e482..49337083 100644
--- a/sf_bf_connect/models/jd_eclp.py
+++ b/sf_bf_connect/models/jd_eclp.py
@@ -46,9 +46,20 @@ class JdEclp(models.Model):
is_bill = fields.Boolean(string='是否下了快递单', default=False)
# 物流状态
logistics_status = fields.Selection([('0', '未下单'), ('1', '已下单'), ('2', '已获取物流面单'), ('3', '已打印物流单')],
- string='物流状态', default='0')
+ string='物流状态', default='0', readonly=True)
- logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
+ logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式', readonly=True)
+
+ def button_validate(self):
+ """
+ 重写出库方法,获取物流面单
+ """
+ res = super(JdEclp, self).button_validate()
+ if self.check_out == 'OUT':
+ if self.logistics_way != '自提':
+ if self.logistics_status != '3':
+ raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!')
+ return res
@api.depends('name')
diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml
index 90d36123..ce1cf437 100644
--- a/sf_bf_connect/views/view.xml
+++ b/sf_bf_connect/views/view.xml
@@ -31,10 +31,11 @@
+
+ attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/>
+ attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>
@@ -46,8 +47,8 @@
-
-
+
+
From 1af08763ea830d7b941755ec52f905e0976ce6ac Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Wed, 24 Jan 2024 14:24:01 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=A7=86=E5=9B=BE?=
=?UTF-8?q?=E6=98=BE=E9=9A=90=E6=8E=A7=E5=88=B6=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_bf_connect/views/view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml
index ce1cf437..6db5cb1d 100644
--- a/sf_bf_connect/views/view.xml
+++ b/sf_bf_connect/views/view.xml
@@ -35,7 +35,7 @@
+ attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>