Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
bbe76352
提交
bbe76352
authored
2月 10, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
上传接口的测试与优化
上级
931c3503
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
47 行增加
和
37 行删除
+47
-37
zh_CN.po
ccs_base/i18n/zh_CN.po
+12
-2
order_controller.py
ccs_connect_tiktok/controllers/order_controller.py
+32
-32
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+3
-3
没有找到文件。
ccs_base/i18n/zh_CN.po
浏览文件 @
bbe76352
...
...
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-02-
08 01:29
+0000\n"
"PO-Revision-Date: 2025-02-
08 09:30
+0800\n"
"POT-Creation-Date: 2025-02-
10 02:14
+0000\n"
"PO-Revision-Date: 2025-02-
10 10:24
+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
...
...
@@ -944,6 +944,16 @@ msgstr "申报价格"
msgid "Declare Type"
msgstr "申报类型"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__delivery_time
msgid "Delivery Time"
msgstr "尾程交货时间"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__delivery_user_id
msgid "Delivery User"
msgstr "尾程交付人"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_node__desc
#: model:ir.model.fields,field_description:ccs_base.field_cc_node_exception_reason__desc
...
...
ccs_connect_tiktok/controllers/order_controller.py
浏览文件 @
bbe76352
...
...
@@ -4,7 +4,7 @@ import logging
import
math
import
random
import
re
from
datetime
import
timedelta
from
datetime
import
datetime
,
timedelta
from
odoo
import
http
,
fields
,
exceptions
,
_
from
odoo.http
import
request
...
...
@@ -154,11 +154,11 @@ class OrderController(http.Controller):
if
package_type
==
'ship'
:
if
excep_item
not
in
ship_package_exception_arr
:
ship_package_exception_arr
[
excep_item
]
=
[]
ship_package_exception_arr
[
excep_item
]
.
append
(
package_obj
.
id
)
ship_package_exception_arr
[
excep_item
]
+=
package_obj
.
ids
else
:
if
excep_item
not
in
big_package_exception_arr
:
big_package_exception_arr
[
excep_item
]
=
[]
big_package_exception_arr
[
excep_item
]
.
append
(
package_obj
.
id
)
big_package_exception_arr
[
excep_item
]
+=
package_obj
.
ids
# package_obj.update_exception_info(exception_cause_ids) # 修改异常信息
tally_time
=
package_item
.
get
(
'tally_time'
)
if
package_type
==
'ship'
:
...
...
@@ -179,7 +179,6 @@ class OrderController(http.Controller):
error_no_set
.
add
(
package_no
)
return
error_no_set
error_msg_arr
=
[]
# 处理小包、大包和托盘
if
kwargs
.
get
(
'ship_package_arr'
):
error_no_arr
=
process_packages
(
kwargs
[
'ship_package_arr'
],
'ship'
,
ship_packages
)
...
...
@@ -210,8 +209,6 @@ class OrderController(http.Controller):
return
res
# 修改异常原因,发送异常邮件
logging
.
info
(
'big:
%
s'
%
big_package_exception_arr
)
logging
.
info
(
'ship:
%
s'
%
ship_package_exception_arr
)
lang
=
'zh_CN'
if
pda_lang
==
'zh'
else
'en_US'
# 语言
for
exception_id
,
big_package
in
big_package_exception_arr
.
items
():
if
big_package
:
...
...
@@ -232,32 +229,35 @@ class OrderController(http.Controller):
ship_wizard_obj
.
confirm
()
# 发送邮件
# 更新小包状态
tally_state
=
'checked_goods'
if
action_type
==
'tally'
else
'handover_completed'
node_obj
=
request
.
env
[
'cc.node'
]
.
sudo
()
.
search
([
(
'node_type'
,
'='
,
'package'
),
(
'tally_state'
,
'='
,
tally_state
)
# Check for both states
],
order
=
'seq asc'
)
# Order by sequence and creation date ascending
if
node_obj
:
for
index
,
node
in
enumerate
(
node_obj
):
for
ship_package_dict
in
ship_packages
:
ship_package
=
ship_package_dict
[
'id'
]
tally_time
=
ship_package_dict
[
'tally_time'
]
operation_time
=
(
fields
.
Datetime
.
from_string
(
tally_time
)
+
timedelta
(
minutes
=
20
*
index
))
if
tally_time
else
fields
.
Datetime
.
now
()
+
timedelta
(
minutes
=
20
*
index
)
# Increment time by 20 minutes for each node
state_node_obj
=
request
.
env
[
'cc.node'
]
.
sudo
()
.
search
(
[(
'node_type'
,
'='
,
'package'
),
(
'name'
,
'='
,
ship_package
.
state
)],
limit
=
1
)
if
state_node_obj
.
seq
<
node
.
seq
:
# Ensure the current state is valid
ship_package
.
write
({
'state'
:
node
.
id
,
'process_time'
:
operation_time
,
'state_explain'
:
node
.
desc
,
'is_sync'
:
True
if
node
.
is_default
else
False
})
is_ok
=
bl_obj
.
package_callback_func
(
ship_package
)
if
bl_obj
.
state
==
'draft'
and
bl_obj
.
ship_package_ids
.
filtered
(
lambda
line
:
line
.
state
.
tk_code
==
'cb_imcustoms_start'
):
bl_obj
.
ccing_func
()
if
ship_packages
:
tally_state
=
'checked_goods'
if
action_type
==
'tally'
else
'handover_completed'
node_obj
=
request
.
env
[
'cc.node'
]
.
sudo
()
.
search
([
(
'node_type'
,
'='
,
'package'
),
(
'tally_state'
,
'='
,
tally_state
)
# Check for both states
],
order
=
'seq asc'
)
# Order by sequence and creation date ascending
if
node_obj
:
for
index
,
node
in
enumerate
(
node_obj
):
for
ship_package_dict
in
ship_packages
:
ship_package
=
ship_package_dict
[
'id'
]
tally_time
=
ship_package_dict
[
'tally_time'
]
operation_time
=
(
datetime
.
strptime
(
tally_time
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
+
timedelta
(
minutes
=
20
*
(
index
+
1
)))
if
tally_time
else
fields
.
Datetime
.
now
()
+
timedelta
(
minutes
=
20
*
(
index
+
1
))
# Increment time by 20 minutes for each node
state_node_obj
=
request
.
env
[
'cc.node'
]
.
sudo
()
.
search
(
[(
'node_type'
,
'='
,
'package'
),
(
'name'
,
'='
,
ship_package
.
state
.
name
)],
limit
=
1
)
if
state_node_obj
.
seq
<
node
.
seq
:
# Ensure the current state is valid
ship_package
.
write
({
'state'
:
node
.
id
,
'process_time'
:
operation_time
,
'state_explain'
:
node
.
desc
,
'is_sync'
:
True
if
node
.
is_default
else
False
})
is_ok
=
bl_obj
.
package_callback_func
(
ship_package
)
if
bl_obj
.
state
==
'draft'
and
bl_obj
.
ship_package_ids
.
filtered
(
lambda
line
:
line
.
state
.
tk_code
==
'cb_imcustoms_start'
):
bl_obj
.
ccing_func
()
res
[
'state'
]
=
200
else
:
res
[
'message'
]
=
bill_noexist_msg_dic
[
pda_lang
]
# 提单不存在
else
:
...
...
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
bbe76352
...
...
@@ -429,7 +429,7 @@ class CcBigPackage(models.Model):
"""
理货 tally/尾程交接 handover
"""
action_type
=
kwargs
.
get
(
'action_type'
)
for
item
in
self
:
if
action_type
==
'tally'
and
item
.
tally_state
==
'unprocessed_goods'
:
...
...
@@ -449,11 +449,11 @@ class CcBigPackage(models.Model):
if
kwargs
.
get
(
'tally_user_id'
):
item
.
tally_user_id
=
kwargs
[
'tally_user_id'
]
if
kwargs
.
get
(
'tally_time'
):
item
.
tally_time
=
kwargs
[
'tally_time'
]
item
.
tally_time
=
datetime
.
strptime
(
kwargs
[
'tally_time'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
elif
action_type
==
'handover'
:
if
kwargs
.
get
(
'tally_state'
):
item
.
tally_state
=
kwargs
[
'tally_state'
]
if
kwargs
.
get
(
'tally_user_id'
):
item
.
delivery_user_id
=
kwargs
[
'tally_user_id'
]
if
kwargs
.
get
(
'tally_time'
):
item
.
delivery_time
=
kwargs
[
'tally_time'
]
item
.
delivery_time
=
datetime
.
strptime
(
kwargs
[
'tally_time'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论