Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
f594f246
提交
f594f246
authored
8月 23, 2024
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、增加节点异常原因的菜单
2、更新的节点 根据选择的类型是节点还是面单号进行过滤 3、接收数据生成日志的业务信息优化 4、提单状态变更增加sns 5、提单更新状态的时间把UTC去掉
上级
f593d755
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
91 行增加
和
16 行删除
+91
-16
__manifest__.py
ccs_base/__manifest__.py
+1
-0
ir.model.access.csv
ccs_base/security/ir.model.access.csv
+3
-0
cc_node_exception_reason_view.xml
ccs_base/views/cc_node_exception_reason_view.xml
+50
-0
batch_input_ship_package_statu_wizard.py
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
+14
-3
batch_input_ship_package_statu_wizard.xml
ccs_base/wizard/batch_input_ship_package_statu_wizard.xml
+2
-2
tt_controllers.py
ccs_connect_tiktok/controllers/tt_controllers.py
+19
-11
ir.model.access.csv
ccs_connect_tiktok/security/ir.model.access.csv
+2
-0
没有找到文件。
ccs_base/__manifest__.py
浏览文件 @
f594f246
...
...
@@ -26,6 +26,7 @@
'views/cc_package_good_view.xml'
,
'views/cc_ship_package_view.xml'
,
'views/cc_big_package_view.xml'
,
'views/cc_node_exception_reason_view.xml'
,
'views/cc_bl_view.xml'
,
#'views/cc_customers_declaration_order_view.xml',
'templates/login.xml'
,
...
...
ccs_base/security/ir.model.access.csv
浏览文件 @
f594f246
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
batch_input_ship_package_status_wizard_group_user,batch_input_ship_package_status_wizard_group_user,ccs_base.model_batch_input_ship_package_status_wizard,base.group_user,1,1,1,1
access_cc_node_base.group_user,cc_node base.group_user,ccs_base.model_cc_node,base.group_user,1,0,0,0
access_cc_node_base.group_erp_manager,cc_node base.group_erp_manager,ccs_base.model_cc_node,base.group_erp_manager,1,1,1,1
...
...
ccs_base/views/cc_node_exception_reason_view.xml
0 → 100644
浏览文件 @
f594f246
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record
model=
"ir.ui.view"
id=
"tree_cc_node_exception_reason_view"
>
<field
name=
"name"
>
tree.cc.node.exception.reason
</field>
<field
name=
"model"
>
cc.node.exception.reason
</field>
<field
name=
"arch"
type=
"xml"
>
<tree
string=
"CC Node Exception Reason"
editable=
"bottom"
>
<field
optional=
"show"
name=
"code_id"
string=
"Node"
options=
"{'no_create':True}"
/>
<field
optional=
"show"
name=
"name"
string=
"Node Name"
/>
<field
optional=
"show"
name=
"desc"
string=
"Node Description"
/>
</tree>
</field>
</record>
# 增加一个查询视图, 支持按照节点类型分组和过滤
<record
model=
"ir.ui.view"
id=
"search_cc_node_exception_reason_view"
>
<field
name=
"name"
>
search.cc.node.exception.reason
</field>
<field
name=
"model"
>
cc.node.exception.reason
</field>
<field
name=
"arch"
type=
"xml"
>
<search
string=
"Search Node"
>
<field
name=
"code_id"
/>
<field
name=
"name"
string=
"Node Name"
/>
<field
name=
"desc"
string=
"Node Description"
/>
<group
expand=
"0"
string=
"Group By"
>
<filter
string=
"Node"
name=
"group_code_id"
context=
"{'group_by':'code_id'}"
/>
</group>
<searchpanel>
<field
name=
"code_id"
string=
"Node"
/>
</searchpanel>
</search>
</field>
</record>
<record
model=
"ir.actions.act_window"
id=
"action_cc_node_exception_reason"
>
<field
name=
"name"
>
CC Node Exception Reason
</field>
<field
name=
"res_model"
>
cc.node.exception.reason
</field>
<field
name=
"view_mode"
>
tree
</field>
<field
name=
"domain"
>
[]
</field>
<field
name=
"context"
>
{}
</field>
</record>
<menuitem
parent=
"menu_ccs_base_main"
sequence=
"100"
name=
"CC Node Exception Reason"
id=
"menu_cc_node_exception_reason"
action=
"action_cc_node_exception_reason"
/>
</odoo>
\ No newline at end of file
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
浏览文件 @
f594f246
...
...
@@ -23,6 +23,16 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
_name
=
'batch.input.ship.package.status.wizard'
_description
=
'批量更新小包状态向导'
@api.onchange
(
'select_type'
,
'current_status'
)
def
onchange_select_type
(
self
):
for
item
in
self
:
supplier_domain
=
[(
'node_type'
,
'='
,
'package'
)]
select_type
=
item
.
select_type
if
select_type
and
select_type
==
'node'
and
item
.
current_status
:
supplier_domain
+=
[(
'id'
,
'in'
,
item
.
current_status
.
next_code_ids
.
ids
)]
domain
=
{
'update_status'
:
supplier_domain
}
return
{
'domain'
:
domain
}
bl_id
=
fields
.
Many2one
(
'cc.bl'
,
'Bill of Loading'
,
required
=
True
)
# 增加选择类型字段, 按节点和按面单号(多条)
...
...
@@ -46,7 +56,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
record
.
update_package_count
=
len
(
self
.
get_process_package
())
is_ok
=
fields
.
Boolean
(
'Confirm Date is ok.'
,
default
=
False
)
process_time
=
fields
.
Datetime
(
'Process Time
(UTC)
'
)
process_time
=
fields
.
Datetime
(
'Process Time'
)
# 添加状态说明字段
state_explain
=
fields
.
Text
(
'State Explain'
,
help
=
'State Explain'
)
node_exception_reason_id
=
fields
.
Many2one
(
'cc.node.exception.reason'
,
'Exception Reason'
,
...
...
@@ -69,8 +79,9 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
# 更新状态
parcels
.
write
(
{
'state'
:
self
.
update_status
.
id
,
'node_exception_reason_id'
:
self
.
node_exception_reason_id
.
id
,
'process_time'
:
self
.
process_time
,
'state_explain'
:
self
.
state_explain
})
'process_time'
:
self
.
process_time
,
'state_explain'
:
self
.
state_explain
,
'is_sync'
:
False
})
# 生成sns日志
self
.
bl_id
.
message_post
(
body
=
'
%
s更新为
%
s'
%
(
self
.
current_status
.
name
or
''
,
self
.
update_status
.
name
or
''
))
# 跳转显示本次更新状态的小包
return
{
'name'
:
'更新小包状态'
,
...
...
ccs_base/wizard/batch_input_ship_package_statu_wizard.xml
浏览文件 @
f594f246
...
...
@@ -24,8 +24,8 @@
attrs=
"{'invisible':[('select_type','=','node')],'required':[('select_type','=','tracking_no')]}"
/>
<field
name=
"update_package_count"
/>
<separator/>
<
field
name=
"update_status"
required=
"1"
domain=
"[('id','in',next_code_ids),('node_type','=','package')]
"
/>
<
!-- domain="[('id','in',next_code_ids),('node_type','=','package')]"-->
<field
name=
"update_status"
required=
"1
"
/>
<field
name=
"process_time"
required=
"1"
string=
"Process Time(UTC)"
/>
<field
name=
"node_exception_reason_id"
options=
"{'no_create':True}"
/>
<field
name=
"state_explain"
/>
...
...
ccs_connect_tiktok/controllers/tt_controllers.py
浏览文件 @
f594f246
...
...
@@ -101,7 +101,7 @@ class TTApi(http.Controller):
timestamp
=
int
(
time
.
time
())
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
big_bag
_no
=
''
logistic_order
_no
=
''
data_text
=
''
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
...
...
@@ -222,7 +222,8 @@ class TTApi(http.Controller):
res
[
'code'
]
=
5000
res
[
'msg'
]
=
'system error:
%
s'
%
str
(
e
)
logging
.
error
(
'package_declare error:
%
s'
%
str
(
e
))
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
big_bag_no
,
res
[
'msg'
],
data_text
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
logistic_order_no
,
res
[
'msg'
],
data_text
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
info
(
'package_declare is received:
%
s'
%
res
)
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
...
@@ -242,6 +243,7 @@ class TTApi(http.Controller):
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
data_text
=
''
master_waybill_no
=
''
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
...
...
@@ -250,7 +252,8 @@ class TTApi(http.Controller):
# 分析mawb_info中的内容,生成cc.bl和cc.big.package,并与cc.ship.package进行关联
mawb_info
=
kws
.
get
(
'mwb_info'
)
# 生成cc.bl
bl_vals
=
dict
(
bl_no
=
kws
.
get
(
'master_waybill_no'
),
master_waybill_no
=
kws
.
get
(
'master_waybill_no'
)
bl_vals
=
dict
(
bl_no
=
master_waybill_no
,
customs_bl_no
=
kws
.
get
(
'customs_waybill_id'
),
trade_type
=
kws
.
get
(
'trade_type'
),
big_package_qty
=
kws
.
get
(
'big_bag_quantity'
),
...
...
@@ -320,7 +323,7 @@ class TTApi(http.Controller):
logging
.
error
(
'mawb_declare error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
''
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'mawb_declare is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
...
@@ -339,6 +342,7 @@ class TTApi(http.Controller):
timestamp
=
int
(
time
.
time
())
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
master_waybill_no
=
''
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
...
...
@@ -350,8 +354,8 @@ class TTApi(http.Controller):
# "transport_name": "CZ465",
# "arrive_port_code": "LHR",
# 根据kws中获取的master_waybill_no,在系统中查找提单,并将提单的信息更新
bl
=
request
.
env
[
'cc.bl'
]
.
sudo
()
.
search
([(
'bl_no'
,
'='
,
kws
.
get
(
'master_waybill_no'
)
)],
limit
=
1
)
master_waybill_no
=
kws
.
get
(
'master_waybill_no'
)
bl
=
request
.
env
[
'cc.bl'
]
.
sudo
()
.
search
([(
'bl_no'
,
'='
,
master_waybill_no
)],
limit
=
1
)
if
bl
:
# 根据kws中获取的"img_detail"中的"img_file_code”和img_file_type,生成odoo的附件,并关联到cc.bl的bl_attachment_ids字段
...
...
@@ -383,7 +387,7 @@ class TTApi(http.Controller):
logging
.
error
(
'mawb_copy_upload error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
''
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'mawb_copy_upload is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
...
@@ -402,6 +406,7 @@ class TTApi(http.Controller):
timestamp
=
int
(
time
.
time
())
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
logistic_order_no
=
''
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
...
...
@@ -411,8 +416,9 @@ class TTApi(http.Controller):
# "declaretion_bill_id": "2882303998754172312",
# "remark": ""
# 根据kws中的provider_order_id和declaretion_bill_id,查找cc.ship.package,并将其置为取消状态, 将remark作为取消原因
logistic_order_no
=
kws
.
get
(
'provider_order_id'
)
ship_package
=
request
.
env
[
'cc.ship.package'
]
.
sudo
()
.
search
(
[(
'logistic_order_no'
,
'='
,
kws
.
get
(
'provider_order_id'
)
)],
limit
=
1
)
[(
'logistic_order_no'
,
'='
,
logistic_order_no
)],
limit
=
1
)
if
ship_package
:
# 后续需要补充提单是否允许取消小包的逻辑的调用.
allow_cancel
,
not_msg
=
ship_package
.
check_cancel
()
...
...
@@ -431,7 +437,7 @@ class TTApi(http.Controller):
logging
.
error
(
'package_cancel error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
''
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
logistic_order_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'package_cancel is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
...
@@ -450,6 +456,7 @@ class TTApi(http.Controller):
timestamp
=
int
(
time
.
time
())
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
master_waybill_no
=
''
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
...
...
@@ -459,7 +466,8 @@ class TTApi(http.Controller):
# "customs_waybill_id": "2882303998754172312",
# "remark": ""
# 根据kws中的master_waybill_no和customs_waybill_id,查找cc.bl,并将其置为取消状态, 将remark作为取消原因
bl
=
request
.
env
[
'cc.bl'
]
.
sudo
()
.
search
([(
'bl_no'
,
'='
,
kws
.
get
(
'master_waybill_no'
))],
limit
=
1
)
master_waybill_no
=
kws
.
get
(
'master_waybill_no'
)
bl
=
request
.
env
[
'cc.bl'
]
.
sudo
()
.
search
([(
'bl_no'
,
'='
,
master_waybill_no
)],
limit
=
1
)
if
bl
:
# 后续需要补充提单是否允许取消的逻辑的调用.
can_cancel
,
not_msg
=
bl
.
check_cancel
()
...
...
@@ -480,6 +488,6 @@ class TTApi(http.Controller):
logging
.
error
(
'mawb_cancel error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
''
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'mawb_cancel is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
ccs_connect_tiktok/security/ir.model.access.csv
浏览文件 @
f594f246
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_group_user_ao_tt_api,access_group_user_ao_tt_api,ccs_connect_tiktok.model_ao_tt_api,base.group_user,1,0,0,0
access_ao_tt_api_log,ao_tt_api_log,model_ao_tt_api_log,base.group_system,1,1,1,1
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论