Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
1239e8f6
提交
1239e8f6
authored
8月 26, 2024
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加批量推送通过文件
上级
1bd2ab63
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
43 行增加
和
18 行删除
+43
-18
batch_input_ship_package_statu_wizard.py
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
+5
-3
batch_input_ship_package_statu_wizard.xml
ccs_base/wizard/batch_input_ship_package_statu_wizard.xml
+12
-2
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+16
-4
cc_bl_view.xml
ccs_connect_tiktok/views/cc_bl_view.xml
+7
-6
batch_input_ship_package_statu_wizard.py
...ct_tiktok/wizard/batch_input_ship_package_statu_wizard.py
+3
-3
没有找到文件。
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
浏览文件 @
1239e8f6
...
...
@@ -45,8 +45,10 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
next_code_ids
=
fields
.
Many2many
(
'cc.node'
,
'node_next_node_wizard_rel'
,
'node_id'
,
'next_node_id'
,
'Next Node'
,
related
=
'current_status.next_code_ids'
)
update_status
=
fields
.
Many2one
(
'cc.node'
,
'Update Node'
)
select_tracking_no
=
fields
.
Text
(
'Select TrackingNo'
,
help
=
'A TrackingNo no is one line'
)
exclude_tracking_no
=
fields
.
Text
(
'Exclude TrackingNo'
,
help
=
'A TrackingNo no is one line'
)
select_tracking_no
=
fields
.
Text
(
'Select TrackingNo'
,
help
=
'A TrackingNo no is one line,separate multiple tracking numbers with line breaks'
)
exclude_tracking_no
=
fields
.
Text
(
'Exclude TrackingNo'
,
help
=
'A TrackingNo no is one line,separate multiple tracking numbers with line breaks'
)
update_package_count
=
fields
.
Integer
(
'Select Package Count'
,
compute
=
'_compute_update_package_count'
)
...
...
@@ -97,7 +99,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
if
self
.
select_type
==
'tracking_no'
:
if
self
.
select_tracking_no
:
tracking_no_list
=
self
.
select_tracking_no
.
split
(
'
,
'
)
tracking_no_list
=
self
.
select_tracking_no
.
split
(
'
\n
'
)
tracking_no_list
=
[
i
.
strip
()
for
i
in
tracking_no_list
if
i
.
strip
()]
parcels
=
self
.
env
[
'cc.ship.package'
]
.
search
(
[(
'bl_id'
,
'='
,
self
.
bl_id
.
id
),
(
'tracking_no'
,
'in'
,
tracking_no_list
)])
...
...
ccs_base/wizard/batch_input_ship_package_statu_wizard.xml
浏览文件 @
1239e8f6
...
...
@@ -11,6 +11,13 @@
<field
name=
"arch"
type=
"xml"
>
<form
string=
"更新包裹进度"
>
<sheet>
<!-- <group>-->
<!-- <div>-->
<!-- <span style="color:red">-->
<!-- </span>-->
<!-- </div>-->
<!-- </group>-->
<group>
<field
name=
"bl_id"
required=
"1"
/>
<field
name=
"select_type"
required=
"1"
/>
...
...
@@ -18,9 +25,12 @@
attrs=
"{'invisible':[('select_type','=','tracking_no')],'required':[('select_type','=','node')]}"
domain=
"[('node_type','=','package')]"
/>
<field
name=
"next_code_ids"
invisible=
"1"
/>
<field
name=
"exclude_tracking_no"
placeholder=
"多个单号 换行隔开"
<!-- 多个单号 用换行进行分隔-->
<field
name=
"exclude_tracking_no"
placeholder=
"Separate multiple tracking numbers with line breaks"
attrs=
"{'invisible':[('select_type','=','tracking_no')]}"
/>
<field
name=
"select_tracking_no"
placeholder=
"多个单号用‘,’符隔开"
<field
name=
"select_tracking_no"
placeholder=
"Separate multiple tracking numbers with line breaks"
attrs=
"{'invisible':[('select_type','=','node')],'required':[('select_type','=','tracking_no')]}"
/>
<field
name=
"update_package_count"
/>
<separator/>
...
...
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
1239e8f6
...
...
@@ -75,7 +75,8 @@ class CcClearanceFile(models.Model):
self
.
is_upload
=
True
self
.
upload_time
=
datetime
.
now
()
request_id
=
response_data
[
'requestID'
]
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
file_name
or
''
,
''
,
''
,
0
,
request_id
,
source
=
'推出'
)
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
file_name
or
''
,
''
,
''
,
0
,
request_id
,
source
=
'推出'
)
return
''
# 重载action_upload方法
...
...
@@ -142,7 +143,8 @@ class CcShipPackage(models.Model):
record
.
is_sync
=
True
self
.
env
[
'cc.ship.package.sync.log'
]
.
sudo
()
.
create_sync_log
(
record
.
id
,
'Tiktok'
,
record
.
state
.
tk_code
,
record
.
state_explain
,
record
.
process_time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
record
.
process_time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
def
get_callback_track_data
(
self
):
"""小包上传数据."""
...
...
@@ -185,9 +187,11 @@ class CcShipPackage(models.Model):
self
.
is_sync
=
True
self
.
env
[
'cc.ship.package.sync.log'
]
.
sudo
()
.
create_sync_log
(
self
.
id
,
'Tiktok'
,
self
.
state
.
tk_code
,
self
.
state_explain
,
self
.
process_time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
self
.
process_time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
request_id
=
response_data
[
'requestID'
]
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
tracking_no
or
''
,
''
,
''
,
0
,
request_id
,
source
=
'推出'
)
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
tracking_no
or
''
,
''
,
''
,
0
,
request_id
,
source
=
'推出'
)
return
''
...
...
@@ -214,3 +218,11 @@ class CcBl(models.Model):
for
package
in
ship_packages
:
package
.
callback_track
()
return
True
def
batch_action_sync
(
self
):
"""
批量回传通过文件
"""
for
item
in
self
:
for
line
in
item
.
cc_attachment_ids
:
line
.
action_sync
()
ccs_connect_tiktok/views/cc_bl_view.xml
浏览文件 @
1239e8f6
...
...
@@ -23,13 +23,17 @@
<!-- # header之间增加一个按钮,调用自定义的方法-->
<header
position=
"inside"
>
<button
name=
"callback_track"
string=
"Sync Package Status"
type=
"object"
/>
<button
name=
"batch_action_sync"
string=
"Sync Package Attachment"
type=
"object"
/>
</header>
<button
name=
"action_show_ship_package"
position=
"replace"
>
<button
name=
"action_show_ship_package"
type=
"object"
class=
"oe_stat_button"
icon=
"fa-box"
>
<div
class=
"o_stat_info"
>
Not Sync:
<field
name=
"unsync_package_count"
widget=
"badge"
decoration-danger=
"1 == 1"
/>
/ All:
<field
name=
"bl_ship_package_qty"
/>
Not Sync:
<field
name=
"unsync_package_count"
widget=
"badge"
decoration-danger=
"1 == 1"
/>
/ All:
<field
name=
"bl_ship_package_qty"
/>
<span
class=
"o_stat_text"
>
Ship Packages
</span>
</div>
</button>
...
...
@@ -39,7 +43,7 @@
</record>
<!-- # 继承ccs_base模块的cc_ship_package_view.xml视图,增加is_sync字段在列表中-->
<!-- # 继承ccs_base模块的cc_ship_package_view.xml视图,增加is_sync字段在列表中-->
<record
model=
"ir.ui.view"
id=
"tree_cc_ship_package_view_inherit"
>
<field
name=
"name"
>
tree_cc_ship_package_view_inherit
</field>
<field
name=
"model"
>
cc.ship.package
</field>
...
...
@@ -56,7 +60,7 @@
</field>
</record>
<!-- # 继承ccs_base模块的search_cc_ship_package_view视图,装置加未同步的筛选条件-->
<!-- # 继承ccs_base模块的search_cc_ship_package_view视图,装置加未同步的筛选条件-->
<record
model=
"ir.ui.view"
id=
"search_cc_ship_package_view_inherit"
>
<field
name=
"name"
>
search_cc_ship_package_view_inherit
</field>
<field
name=
"model"
>
cc.ship.package
</field>
...
...
@@ -83,7 +87,5 @@
</record>
</data>
</odoo>
\ No newline at end of file
ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py
浏览文件 @
1239e8f6
...
...
@@ -33,7 +33,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
for
item
in
self
:
exclude_tracking_no
=
''
if
item
.
ship_package_ids
:
exclude_tracking_no
=
'
,
'
.
join
([
line
.
tracking_no
for
line
in
item
.
ship_package_ids
])
exclude_tracking_no
=
'
\n
'
.
join
([
line
.
tracking_no
for
line
in
item
.
ship_package_ids
])
item
.
exclude_tracking_no
=
exclude_tracking_no
ship_package_ids
=
fields
.
Many2many
(
'cc.ship.package'
,
'_update_state_package_wizard_rel'
,
'wizard_id'
,
...
...
@@ -52,7 +52,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
package_model
=
self
.
env
[
'cc.ship.package'
]
if
item
.
select_type
==
'tracking_no'
:
if
item
.
select_tracking_no
:
tracking_no_list
=
item
.
select_tracking_no
.
split
(
'
,
'
)
tracking_no_list
=
item
.
select_tracking_no
.
split
(
'
\n
'
)
tracking_no_list
=
[
i
.
strip
()
for
i
in
tracking_no_list
if
i
.
strip
()]
package_obj
=
package_model
.
search
(
[(
'bl_id'
,
'='
,
item
.
bl_id
.
id
),
(
'tracking_no'
,
'in'
,
tracking_no_list
)])
...
...
@@ -95,7 +95,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
else
:
if
len
(
self
.
ship_package_ids
)
>
0
:
raise
ValidationError
(
'单号[
%
s]不能更新'
%
'
,
'
.
join
([
package
.
tracking_no
for
package
in
self
.
ship_package_ids
]))
'单号[
%
s]不能更新'
%
'
\n
'
.
join
([
package
.
tracking_no
for
package
in
self
.
ship_package_ids
]))
obj
=
super
(
BatchInputShipPackageStatusWizard
,
self
)
.
submit
()
# 生成sns日志
self
.
bl_id
.
message_post
(
body
=
'[
%
s]
%
s更新为[
%
s]
%
s'
%
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论