From d07ab53aeb2f6ea54abb13dc8c2dba8227880236 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Wed, 26 Jun 2024 14:10:57 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E5=8F=8A=E8=AF=A6=E6=83=85=E9=A1=B5?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_production.py | 54 ++++++++++++-------
.../views/mrp_production_addional_change.xml | 2 +-
sf_plan_management/i18n/zh_CN.po | 13 ++++-
3 files changed, 49 insertions(+), 20 deletions(-)
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index 15a77160..70db2915 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -30,12 +30,12 @@ class MrpProduction(models.Model):
# ('completed', '已完工')
# ])
state = fields.Selection([
- ('draft', 'Draft'),
- ('confirmed', 'Confirmed'),
- ('progress', '待排程'),
- ('pending_cam', '待装夹'),
- ('pending_processing', '待加工'),
- ('pending_era_cam', '待解除装夹'),
+ ('draft', '待排程'),
+ ('confirmed', '待加工'),
+ ('progress', '加工中'),
+ # ('pending_cam', '待装夹'),
+ # ('pending_processing', '待加工'),
+ # ('pending_era_cam', '待解除装夹'),
('completed', '已完工'),
('to_close', 'To Close'),
('done', 'Done'),
@@ -113,18 +113,36 @@ class MrpProduction(models.Model):
production.state = 'progress'
# 新添加的状态逻辑
- if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹':
- # production.state = 'pending_processing'
- production.state = 'pending_cam'
- if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工':
- # if production.state == 'pending_cam' and production.process_state == '待加工':
- production.state = 'pending_processing'
- elif production.state == 'progress' and production.process_state == '待解除装夹':
- production.state = 'pending_era_cam'
- elif production.state == 'progress' and production.process_state == '已完工':
- production.state = 'completed'
- elif production.state == 'progress' and production.work_order_state == '已完成':
- production.state = 'completed'
+ if production.state == 'to_close' and production.schedule_state == '未排':
+ production.state = 'draft'
+ elif production.state == 'to_close' and production.schedule_state == '已排':
+ production.state = 'confirmed'
+ # if production.schedule_state == '已完成':
+ # production.state = 'completed'
+ elif any(wo_state in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
+ production.state = 'progress'
+ elif production.product_uom_id and not float_is_zero(production.qty_producing,
+ precision_rounding=production.product_uom_id.rounding):
+ production.state = 'progress'
+ elif any(not float_is_zero(move.quantity_done,
+ precision_rounding=move.product_uom.rounding or move.product_id.uom_id.rounding)
+ for move in production.move_raw_ids):
+ production.state = 'progress'
+
+
+
+ # if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹':
+ # # production.state = 'pending_processing'
+ # production.state = 'pending_cam'
+ # if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工':
+ # # if production.state == 'pending_cam' and production.process_state == '待加工':
+ # production.state = 'pending_processing'
+ # elif production.state == 'progress' and production.process_state == '待解除装夹':
+ # production.state = 'pending_era_cam'
+ # elif production.state == 'progress' and production.process_state == '已完工':
+ # production.state = 'completed'
+ # elif production.state == 'progress' and production.work_order_state == '已完成':
+ # production.state = 'completed'
def action_check(self):
"""
diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml
index e1d0d28c..817d5e39 100644
--- a/sf_manufacturing/views/mrp_production_addional_change.xml
+++ b/sf_manufacturing/views/mrp_production_addional_change.xml
@@ -65,7 +65,7 @@
- progress,pending_cam,pending_processing,pending_era_cam,completed,done
+ draft,confirmed,progress,completed,done
diff --git a/sf_plan_management/i18n/zh_CN.po b/sf_plan_management/i18n/zh_CN.po
index ad119fc0..1c34bda6 100644
--- a/sf_plan_management/i18n/zh_CN.po
+++ b/sf_plan_management/i18n/zh_CN.po
@@ -114488,10 +114488,21 @@ msgid "径跳精度(mm)"
msgstr ""
#. module: sf_manufacturing
-#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress
+#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__draft
msgid "待排程"
msgstr "待排程"
+#. module: sf_manufacturing
+#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__process_state__待加工
+#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__confirmed
+msgid "待加工"
+msgstr "待加工"
+
+#. module: sf_manufacturing
+#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress
+msgid "待排程"
+msgstr "加工中"
+
#. module: sf_base
#: model:ir.model.fields,field_description:sf_base.field_sf_cutting_tool_model__jump_accuracy
msgid "径跳精度(um)"
From 7fd3647afbc6bf186405f43bb53ddd3a65e86ae5 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Wed, 26 Jun 2024 16:34:04 +0800
Subject: [PATCH 2/2] =?UTF-8?q?sf=E7=89=A9=E6=B5=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_bf_connect/models/jd_eclp.py | 18 ++++++---
sf_bf_connect/views/view.xml | 70 ++++++++++++++++++---------------
2 files changed, 51 insertions(+), 37 deletions(-)
diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py
index c2b8deb7..bdcfba47 100644
--- a/sf_bf_connect/models/jd_eclp.py
+++ b/sf_bf_connect/models/jd_eclp.py
@@ -5,7 +5,7 @@ import requests
import cpca
# from odoo.exceptions import UserError
# from odoo.exceptions import ValidationError
-from odoo import api, fields, models
+from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
@@ -165,11 +165,17 @@ class JdEclp(models.Model):
self.is_bill = True
self.logistics_status = '1'
- # # 京东物流下单后,销售订单状态改为待收货
- # self.env['sale.order'].search([('name', '=', self.origin)]).write({'scheduled_status': 'to receive'})
-
- # else:
- # raise UserError("选择京东物流才能下单呦")
+ notification = {
+ 'type': 'ir.actions.client',
+ 'tag': 'display_notification',
+ 'params': {
+ 'title': _('成功'),
+ 'type': 'success',
+ 'message': '物流下单成功',
+ 'sticky': False,
+ }
+ }
+ return notification
def get_bill(self):
"""
diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml
index 6db5cb1d..184d0e71 100644
--- a/sf_bf_connect/views/view.xml
+++ b/sf_bf_connect/views/view.xml
@@ -32,7 +32,7 @@
-
@@ -45,42 +45,50 @@
stock.picking
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ tracking only
+ stock.picking
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file