Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
2656a7c1
提交
2656a7c1
authored
3月 18, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提单状态
上级
44d2fe95
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
227 行增加
和
96 行删除
+227
-96
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+6
-0
cc_node.py
ccs_base/models/cc_node.py
+5
-0
cc_bl_view.xml
ccs_base/views/cc_bl_view.xml
+5
-1
batch_input_ship_package_statu_wizard.py
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
+45
-43
__manifest__.py
ccs_connect_tiktok/__manifest__.py
+1
-0
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+0
-0
cc_bill_loading_new.py
ccs_connect_tiktok/models/cc_bill_loading_new.py
+0
-0
cc_bill_loading_old.py
ccs_connect_tiktok/models/cc_bill_loading_old.py
+0
-0
tt_api.py
ccs_connect_tiktok/models/tt_api.py
+21
-7
ir.model.access.csv
ccs_connect_tiktok/security/ir.model.access.csv
+7
-0
cc_bl_sync_log_view.xml
ccs_connect_tiktok/views/cc_bl_sync_log_view.xml
+95
-0
cc_bl_view.xml
ccs_connect_tiktok/views/cc_bl_view.xml
+6
-43
cc_ship_package_view.xml
ccs_connect_tiktok/views/cc_ship_package_view.xml
+36
-2
没有找到文件。
ccs_base/models/cc_bill_loading.py
浏览文件 @
2656a7c1
...
@@ -670,6 +670,12 @@ class CcBL(models.Model):
...
@@ -670,6 +670,12 @@ class CcBL(models.Model):
# 通关文件, 关联附件对象(类型限定为image和PDF)
# 通关文件, 关联附件对象(类型限定为image和PDF)
cc_attachment_ids
=
fields
.
One2many
(
'cc.clearance.file'
,
'bl_id'
,
string
=
'Clearance Files'
)
cc_attachment_ids
=
fields
.
One2many
(
'cc.clearance.file'
,
'bl_id'
,
string
=
'Clearance Files'
)
# 提单上新增字段:关务提单状态,用英文:关联节点的配置(cc.node),节点类型过滤提单的节点名称。
customs_clearance_status
=
fields
.
Many2one
(
'cc.node'
,
string
=
'Customs Clearance Status'
,
domain
=
[(
'node_type'
,
'='
,
'bl'
)])
# 增加提单状态操作时间
process_time
=
fields
.
Datetime
(
string
=
'Process Time'
)
# 增加一个can_cancel的方法,用于检查提单当前是否可以取消,返回True表示可以取消, False表示不可以取消,同时返回取消的原因
# 增加一个can_cancel的方法,用于检查提单当前是否可以取消,返回True表示可以取消, False表示不可以取消,同时返回取消的原因
def
check_cancel
(
self
):
def
check_cancel
(
self
):
if
self
.
is_cancel
:
if
self
.
is_cancel
:
...
...
ccs_base/models/cc_node.py
浏览文件 @
2656a7c1
...
@@ -48,3 +48,8 @@ class CcNode(models.Model):
...
@@ -48,3 +48,8 @@ class CcNode(models.Model):
(
'checked_goods'
,
'Checked goods'
),
(
'checked_goods'
,
'Checked goods'
),
(
'handover_completed'
,
'Handover Completed'
)
(
'handover_completed'
,
'Handover Completed'
)
],
default
=
''
,
string
=
'Corresponding to the status of the big package'
,
index
=
True
)
# 对应大包状态 未理货/已理货/尾程交接
],
default
=
''
,
string
=
'Corresponding to the status of the big package'
,
index
=
True
)
# 对应大包状态 未理货/已理货/尾程交接
# 新增字段:对应小包状态。只有类型为提单上才可填写。可选已配置节点类型为小包的节点。单选;
package_state
=
fields
.
Many2one
(
'cc.node'
,
string
=
'Corresponding to the status of the package'
,
domain
=
"[('node_type','=','package')]"
,
index
=
True
)
# 对应小包状态
ccs_base/views/cc_bl_view.xml
浏览文件 @
2656a7c1
...
@@ -50,8 +50,12 @@
...
@@ -50,8 +50,12 @@
<!-- # 为action_batch_input_ship_package_wizard添加一个按钮, 上下文中添加bl_id-->
<!-- # 为action_batch_input_ship_package_wizard添加一个按钮, 上下文中添加bl_id-->
<button
name=
"%(action_batch_input_ship_package_wizard)d"
type=
"action"
class=
"oe_highlight"
<button
name=
"%(action_batch_input_ship_package_wizard)d"
type=
"action"
class=
"oe_highlight"
string=
"Update Ship Package Status"
string=
"Update Ship Package Status"
context=
"{'default_bl_id': active_id, 'active_id': id}"
/>
context=
"{'default_bl_id': active_id, 'active_id': id
,'default_action_type':'小包'
}"
/>
<button
name=
"%(action_batch_input_ship_package_wizard)d"
type=
"action"
class=
"oe_highlight"
string=
"Update BL Status"
context=
"{'active_id': id,'default_action_type':'提单'}"
/>
<field
name=
"state"
widget=
"statusbar"
options=
"{'clickable': '1'}"
/>
<field
name=
"state"
widget=
"statusbar"
options=
"{'clickable': '1'}"
/>
</header>
</header>
<sheet>
<sheet>
...
...
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
浏览文件 @
2656a7c1
...
@@ -82,55 +82,57 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
...
@@ -82,55 +82,57 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
state_explain
=
fields
.
Text
(
'State Explain'
,
help
=
'State Explain'
)
state_explain
=
fields
.
Text
(
'State Explain'
,
help
=
'State Explain'
)
node_exception_reason_id
=
fields
.
Many2one
(
'cc.node.exception.reason'
,
'Exception Reason'
,
node_exception_reason_id
=
fields
.
Many2one
(
'cc.node.exception.reason'
,
'Exception Reason'
,
domain
=
"[('code_id', '=', update_status)]"
)
domain
=
"[('code_id', '=', update_status)]"
)
action_type
=
fields
.
Char
(
string
=
'Action Type'
,
default
=
'小包'
)
# 批量更新小包状态
# 批量更新小包状态
def
submit
(
self
):
def
submit
(
self
):
# 确认数据
# 确认数据
if
not
self
.
is_ok
:
if
not
self
.
is_ok
:
raise
ValidationError
(
'Please confirm that the above data is correct.'
)
# 请确认以上数据正确
raise
ValidationError
(
'Please confirm that the above data is correct.'
)
# 请确认以上数据正确
parcels
=
self
.
get_process_package
()
if
self
.
action_type
==
'小包'
:
parcels
=
self
.
get_process_package
()
if
not
parcels
:
raise
ValidationError
(
_
(
'No package to update found.'
))
# 没有找到要更新的小包
if
not
parcels
:
# 1.若选择的更新节点为是当前节点【清关节点设置,是当前节点字段名称改为初始节点】,当更新节点为初始节点时,无需填写操作时间;
raise
ValidationError
(
_
(
'No package to update found.'
))
# 没有找到要更新的小包
# if self.update_status and not self.update_status.is_default:
# 1.若选择的更新节点为是当前节点【清关节点设置,是当前节点字段名称改为初始节点】,当更新节点为初始节点时,无需填写操作时间;
# 2.若选择的更新节点为“选择节点”的后续节点(根据节点设置排序),则按照操作时间不能大于当前时间,且不能早于最近的操作时间。
# if self.update_status and not self.update_status.is_default:
# 3.若选择的“更新节点”为“选择节点”的前序节点(根据节点设置排序),则查找“选择节点”是否已有同步日志,若有,则操作时间不允许早于前序节点同步日志里的操作时间,且不能大于当前时间。若有多条,以同步时间最晚的一条为准。
# 2.若选择的更新节点为“选择节点”的后续节点(根据节点设置排序),则按照操作时间不能大于当前时间,且不能早于最近的操作时间。
# 4.若选择的“更新节点”和“选择节点”一致时,需检查该节点的前序节点是否有同步日志,若有,则操作时间不允许早于前序节点同步日志里的操作时间,且不能大于当前时间。同一节点若有多条同步日志,以同步时间最晚的一条为准。
# 3.若选择的“更新节点”为“选择节点”的前序节点(根据节点设置排序),则查找“选择节点”是否已有同步日志,若有,则操作时间不允许早于前序节点同步日志里的操作时间,且不能大于当前时间。若有多条,以同步时间最晚的一条为准。
# 判断异常状态是否选择了异常原因
# 4.若选择的“更新节点”和“选择节点”一致时,需检查该节点的前序节点是否有同步日志,若有,则操作时间不允许早于前序节点同步日志里的操作时间,且不能大于当前时间。同一节点若有多条同步日志,以同步时间最晚的一条为准。
reason_obj
=
self
.
env
[
'cc.node.exception.reason'
]
.
search
([(
'code_id'
,
'='
,
self
.
update_status
.
id
)])
# 判断异常状态是否选择了异常原因
if
reason_obj
and
not
self
.
node_exception_reason_id
:
reason_obj
=
self
.
env
[
'cc.node.exception.reason'
]
.
search
([(
'code_id'
,
'='
,
self
.
update_status
.
id
)])
raise
ValidationError
(
_
(
'Please select the reason for the exception!'
))
# 请选择异常原因
if
reason_obj
and
not
self
.
node_exception_reason_id
:
# 如果更新节点是 默认节点 同步的标志变为True
raise
ValidationError
(
_
(
'Please select the reason for the exception!'
))
# 请选择异常原因
is_sync
=
False
# 如果更新节点是 默认节点 同步的标志变为True
if
self
.
update_status
.
is_default
:
is_sync
=
False
is_sync
=
True
if
self
.
update_status
.
is_default
:
# 更新状态
is_sync
=
True
parcels
.
write
(
# 更新状态
{
'state'
:
self
.
update_status
.
id
,
'node_exception_reason_id'
:
self
.
node_exception_reason_id
.
id
,
parcels
.
write
(
'process_time'
:
self
.
process_time
,
'state_explain'
:
self
.
state_explain
,
'is_sync'
:
is_sync
})
{
'state'
:
self
.
update_status
.
id
,
'node_exception_reason_id'
:
self
.
node_exception_reason_id
.
id
,
# if parcels:
'process_time'
:
self
.
process_time
,
'state_explain'
:
self
.
state_explain
,
'is_sync'
:
is_sync
})
# where_sql = " where id={0}".format(parcels[0].id) if len(
# if parcels:
# parcels) == 1 else " where id in {0}".format(tuple(parcels.ids))
# where_sql = " where id={0}".format(parcels[0].id) if len(
# update_sql = """update cc_ship_package set node_exception_reason_id={0},process_time='{1}',state_explain='{2}',is_sync={3} {4}""".format(
# parcels) == 1 else " where id in {0}".format(tuple(parcels.ids))
# self.node_exception_reason_id.id if self.node_exception_reason_id else False,
# update_sql = """update cc_ship_package set node_exception_reason_id={0},process_time='{1}',state_explain='{2}',is_sync={3} {4}""".format(
# self.process_time, self.state_explain or '', is_sync,
# self.node_exception_reason_id.id if self.node_exception_reason_id else False,
# where_sql)
# self.process_time, self.state_explain or '', is_sync,
# update_sql = update_sql.replace("'False'", "null").replace("False", "null")
# where_sql)
# self._cr.execute(update_sql)
# update_sql = update_sql.replace("'False'", "null").replace("False", "null")
# parcels.write({'state': self.update_status.id})
# self._cr.execute(update_sql)
# for parcel in parcels:
# parcels.write({'state': self.update_status.id})
# parcel.message_post(body='%s改为%s' % (self.current_status.name, self.update_status.name))
# for parcel in parcels:
# 生成sns日志
# parcel.message_post(body='%s改为%s' % (self.current_status.name, self.update_status.name))
# self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or ''))
# 生成sns日志
# 跳转显示本次更新状态的小包 更新小包状态
# self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or ''))
return
{
# 跳转显示本次更新状态的小包 更新小包状态
'name'
:
_
(
'Update the status of the small package'
),
return
{
'type'
:
'ir.actions.act_window'
,
'name'
:
_
(
'Update the status of the small package'
),
'res_model'
:
'cc.ship.package'
,
'type'
:
'ir.actions.act_window'
,
'view_mode'
:
'tree,form'
,
'res_model'
:
'cc.ship.package'
,
'domain'
:
[(
'id'
,
'in'
,
parcels
.
ids
)],
'view_mode'
:
'tree,form'
,
}
'domain'
:
[(
'id'
,
'in'
,
parcels
.
ids
)],
}
def
get_process_package
(
self
):
def
get_process_package
(
self
):
"""获取要更新的小包"""
"""获取要更新的小包"""
...
...
ccs_connect_tiktok/__manifest__.py
浏览文件 @
2656a7c1
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
'views/config_settings_views.xml'
,
'views/config_settings_views.xml'
,
# 'views/flight_order_view.xml',
# 'views/flight_order_view.xml',
'views/cc_ship_package_sync_log_view.xml'
,
'views/cc_ship_package_sync_log_view.xml'
,
'views/cc_bl_sync_log_view.xml'
,
'views/ao_tt_api_log_view.xml'
,
'views/ao_tt_api_log_view.xml'
,
'views/cc_node_view.xml'
,
'views/cc_node_view.xml'
,
'views/cc_ship_package_view.xml'
,
'views/cc_ship_package_view.xml'
,
...
...
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
2656a7c1
差异被折叠。
点击展开。
ccs_connect_tiktok/models/cc_bill_loading_new.py
0 → 100644
浏览文件 @
2656a7c1
差异被折叠。
点击展开。
ccs_connect_tiktok/models/cc_bill_loading_old.py
0 → 100644
浏览文件 @
2656a7c1
差异被折叠。
点击展开。
ccs_connect_tiktok/models/tt_api.py
浏览文件 @
2656a7c1
...
@@ -44,8 +44,8 @@ class TT(models.Model):
...
@@ -44,8 +44,8 @@ class TT(models.Model):
def
callback_track
(
self
,
push_data
):
def
callback_track
(
self
,
push_data
):
"""包裹轨迹回传"""
"""包裹轨迹
/提单状态
回传"""
url
=
'/logistics/provider/cross_border/callback_track?country=GB'
url
=
'/logistics/provider/cross_border/callback_track?country=GB'
# cb_excustoms_finished 出口清关完毕
# cb_excustoms_finished 出口清关完毕
# cb_transport_assigned 干线揽收
# cb_transport_assigned 干线揽收
timestamp
=
int
(
time
.
time
())
timestamp
=
int
(
time
.
time
())
...
@@ -66,7 +66,7 @@ class TT(models.Model):
...
@@ -66,7 +66,7 @@ class TT(models.Model):
def
mwb_status_update
(
self
,
push_data
):
def
mwb_status_update
(
self
,
push_data
):
"""清关提单状态回传"""
"""清关提单状态回传"""
url
=
'logistics/provider/customs/mwb_status_update'
url
=
'logistics/provider/customs/mwb_status_update
?country=GB
'
timestamp
=
int
(
time
.
time
())
timestamp
=
int
(
time
.
time
())
sign
=
self
.
generate_sign
(
timestamp
,
push_data
)
sign
=
self
.
generate_sign
(
timestamp
,
push_data
)
response
=
self
.
get_response
(
url
,
sign
,
timestamp
,
push_data
)
response
=
self
.
get_response
(
url
,
sign
,
timestamp
,
push_data
)
...
@@ -126,20 +126,20 @@ class TT(models.Model):
...
@@ -126,20 +126,20 @@ class TT(models.Model):
'app_key'
:
app_key
'app_key'
:
app_key
}
}
request_url
=
tt_url
+
url
request_url
=
tt_url
+
url
logging
.
info
(
'request_url:
%
s'
%
request_url
)
#
logging.info('request_url: %s' % request_url)
logging
.
info
(
'request_data:
%
s'
%
parameter
)
#
logging.info('request_data: %s' % parameter)
for
i
in
range
(
3
):
# 尝试最多3次
for
i
in
range
(
3
):
# 尝试最多3次
try
:
try
:
async
with
session
.
post
(
request_url
,
headers
=
headers
,
data
=
parameter
)
as
response
:
async
with
session
.
post
(
request_url
,
headers
=
headers
,
data
=
parameter
)
as
response
:
response_data
=
await
response
.
json
()
response_data
=
await
response
.
json
()
logging
.
info
(
'response:
%
s'
,
response_data
)
#
logging.info('response: %s', response_data)
# print(response.json())
# print(response.json())
return
response_data
return
response_data
except
Exception
as
e
:
except
Exception
as
e
:
if
i
<
2
:
# 如果不是最后一次尝试,等待后重试
if
i
<
2
:
# 如果不是最后一次尝试,等待后重试
await
asyncio
.
sleep
(
2
**
i
)
# 指数退避策略
await
asyncio
.
sleep
(
2
**
i
)
# 指数退避策略
else
:
else
:
logging
.
warning
(
'request error:
%
s'
%
str
(
e
))
#
logging.warning('request error:%s' % str(e))
return
{
'code'
:
500
,
'requestID'
:
'request error timeout'
,
'msg'
:
'超时,请重试'
}
# 如果重试次数用尽,抛出异常
return
{
'code'
:
500
,
'requestID'
:
'request error timeout'
,
'msg'
:
'超时,请重试'
}
# 如果重试次数用尽,抛出异常
async
def
async_callback_track_callback
(
self
,
session
,
push_data
,
package_id
):
async
def
async_callback_track_callback
(
self
,
session
,
push_data
,
package_id
):
...
@@ -157,3 +157,17 @@ class TT(models.Model):
...
@@ -157,3 +157,17 @@ class TT(models.Model):
"""异步调用推送接口"""
"""异步调用推送接口"""
# async with semaphore:
# async with semaphore:
return
await
self
.
async_callback_track_callback
(
session
,
data
,
package_id
)
return
await
self
.
async_callback_track_callback
(
session
,
data
,
package_id
)
async
def
async_bl_callback_track_callback
(
self
,
session
,
push_data
,
package_id
):
"""提单状态回传"""
url
=
'/logistics/provider/customs/mwb_status_update?country=GB'
timestamp
=
int
(
time
.
time
())
sign
=
self
.
generate_sign
(
timestamp
,
push_data
)
response
=
await
self
.
async_get_response
(
session
,
url
,
sign
,
timestamp
,
push_data
)
logging
.
info
(
'bl_callback_track response:
%
s'
%
response
)
return
response
,
push_data
,
package_id
async
def
async_bl_callback_track
(
self
,
session
,
data
,
bl_id
):
"""异步调用提单推送接口"""
# async with semaphore:
return
await
self
.
async_bl_callback_track_callback
(
session
,
data
,
bl_id
)
ccs_connect_tiktok/security/ir.model.access.csv
浏览文件 @
2656a7c1
...
@@ -7,3 +7,10 @@ access_cc_ship_package_sync_log_base.group_erp_manager,cc_ship_package_sync_log
...
@@ -7,3 +7,10 @@ access_cc_ship_package_sync_log_base.group_erp_manager,cc_ship_package_sync_log
access_cc_ship_package_sync_log_ccs_base.group_clearance_of_customs_manager,cc_ship_package_sync_log ccs_base.group_clearance_of_customs_manager,ccs_connect_tiktok.model_cc_ship_package_sync_log,ccs_base.group_clearance_of_customs_manager,1,0,0,0
access_cc_ship_package_sync_log_ccs_base.group_clearance_of_customs_manager,cc_ship_package_sync_log ccs_base.group_clearance_of_customs_manager,ccs_connect_tiktok.model_cc_ship_package_sync_log,ccs_base.group_clearance_of_customs_manager,1,0,0,0
access_cc_ship_package_sync_log_ccs_base.group_clearance_of_customs_user,cc_ship_package_sync_log ccs_base.group_clearance_of_customs_user,ccs_connect_tiktok.model_cc_ship_package_sync_log,ccs_base.group_clearance_of_customs_user,1,0,0,0
access_cc_ship_package_sync_log_ccs_base.group_clearance_of_customs_user,cc_ship_package_sync_log ccs_base.group_clearance_of_customs_user,ccs_connect_tiktok.model_cc_ship_package_sync_log,ccs_base.group_clearance_of_customs_user,1,0,0,0
access_cc_bl_sync_log_base.group_user,cc_bl_sync_log base.group_user,ccs_connect_tiktok.model_cc_bl_sync_log,base.group_user,1,0,0,0
access_cc_bl_sync_log_base.group_erp_manager,cc_bl_sync_log base.group_erp_manager,ccs_connect_tiktok.model_cc_bl_sync_log,base.group_erp_manager,1,1,1,1
access_cc_bl_sync_log_ccs_base.group_clearance_of_customs_manager,cc_bl_sync_log ccs_base.group_clearance_of_customs_manager,ccs_connect_tiktok.model_cc_bl_sync_log,ccs_base.group_clearance_of_customs_manager,1,0,0,0
access_cc_bl_sync_log_ccs_base.group_clearance_of_customs_user,cc_bl_sync_log ccs_base.group_clearance_of_customs_user,ccs_connect_tiktok.model_cc_bl_sync_log,ccs_base.group_clearance_of_customs_user,1,0,0,0
ccs_connect_tiktok/views/cc_bl_sync_log_view.xml
0 → 100644
浏览文件 @
2656a7c1
<?xml version="1.0" encoding="utf-8"?>
<odoo>
# ---------- CC Bl Sync Log ------------
<record
model=
"ir.ui.view"
id=
"tree_cc_bl_sync_log_view"
>
<field
name=
"name"
>
tree.cc.bl.sync.log
</field>
<field
name=
"model"
>
cc.bl.sync.log
</field>
<field
name=
"arch"
type=
"xml"
>
<tree
string=
"CC Bl Sync Log"
>
<field
optional=
"show"
name=
"bl_id"
string=
"Bill of Loading"
/>
<field
optional=
"show"
name=
"api_customer"
string=
"Api Customer"
/>
<field
optional=
"show"
name=
"process_code"
string=
"TK Process Code"
/>
<field
optional=
"show"
name=
"progress_name"
string=
"Progress Name"
/>
<field
optional=
"show"
name=
"operate_time"
string=
"Operate Time"
/>
<field
optional=
"show"
name=
"operate_user"
string=
"Operate User"
/>
<field
optional=
"show"
name=
"sync_time"
string=
"Sync Time"
/>
</tree>
</field>
</record>
<record
model=
"ir.ui.view"
id=
"form_cc_bl_sync_log_view"
>
<field
name=
"name"
>
form.cc.bl.sync.log
</field>
<field
name=
"model"
>
cc.bl.sync.log
</field>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"CC Bl Sync Log"
>
<sheet>
<group>
<group>
<field
name=
"bl_id"
string=
"Bill of Loading"
/>
<field
name=
"api_customer"
string=
"Api Customer"
/>
<field
name=
"process_code"
string=
"TK Process Code"
/>
<field
name=
"progress_name"
string=
"Progress Name"
/>
<field
name=
"operate_time"
string=
"Operate Time"
/>
<field
name=
"operate_user"
string=
"Operate User"
/>
<field
name=
"sync_time"
string=
"Sync Time"
/>
</group>
<group>
</group>
</group>
<notebook>
<page
string=
"Operate Remark"
>
<field
name=
"operate_remark"
string=
"Operate Remark"
/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record
model=
"ir.ui.view"
id=
"search_cc_bl_sync_log_view"
>
<field
name=
"name"
>
search.cc.bl.sync.log
</field>
<field
name=
"model"
>
cc.bl.sync.log
</field>
<field
name=
"arch"
type=
"xml"
>
<search
string=
"CC Bl Sync Log"
>
<field
name=
"bl_id"
string=
"Bill of Loading"
/>
<field
name=
"api_customer"
string=
"Api Customer"
/>
<field
name=
"process_code"
string=
"TK Process Code"
/>
<field
name=
"operate_time"
string=
"Operate Time"
/>
<field
name=
"operate_user"
string=
"Operate User"
/>
<field
name=
"sync_time"
string=
"Sync Time"
/>
<separator/>
<filter
name=
"filter_operate_time"
string=
"Operate Time"
date=
"operate_time"
/>
<filter
name=
"filter_sync_time"
string=
"Sync Time"
date=
"sync_time"
/>
<separator/>
<group
expand=
"0"
string=
"Group By"
>
<filter
domain=
"[]"
name=
"groupby_bl_id"
string=
"Bill of Loading"
context=
"{'group_by': 'bl_id'}"
/>
<filter
domain=
"[]"
name=
"groupby_operate_user"
string=
"Operate User"
context=
"{'group_by': 'operate_user'}"
/>
</group>
</search>
</field>
</record>
<record
model=
"ir.actions.act_window"
id=
"action_cc_bl_sync_log"
>
<field
name=
"name"
>
CC Bl Sync Log
</field>
<field
name=
"res_model"
>
cc.bl.sync.log
</field>
<field
name=
"view_mode"
>
tree
</field>
<field
name=
"domain"
>
[]
</field>
<field
name=
"context"
>
{}
</field>
<field
name=
"help"
type=
"html"
>
<p
class=
"o_view_nocontent_smiling_face"
>
[CC Bl Sync Log] Not yet! Click the Create button in the top left corner and the sofa is yours!
</p>
<p>
</p>
</field>
</record>
</odoo>
\ No newline at end of file
ccs_connect_tiktok/views/cc_bl_view.xml
浏览文件 @
2656a7c1
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
<header
position=
"inside"
>
<header
position=
"inside"
>
<button
name=
"callback_track"
string=
"Sync Package Status"
type=
"object"
/>
<button
name=
"callback_track"
string=
"Sync Package Status"
type=
"object"
/>
<button
name=
"batch_action_sync"
string=
"Sync CC Attachment"
type=
"object"
/>
<button
name=
"batch_action_sync"
string=
"Sync CC Attachment"
type=
"object"
/>
<!--增加同步提单状态的按钮-->
<button
name=
"action_sync_bl_status"
string=
"Sync Bl Status"
type=
"object"
/>
</header>
</header>
<button
name=
"action_show_ship_package"
position=
"replace"
>
<button
name=
"action_show_ship_package"
position=
"replace"
>
...
@@ -45,48 +47,9 @@
...
@@ -45,48 +47,9 @@
</div>
</div>
</button>
</button>
</button>
</button>
</field>
</record>
<!-- # 继承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>
<field
name=
"inherit_id"
ref=
"ccs_base.tree_cc_ship_package_view"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"state"
position=
"after"
>
<field
name=
"is_sync"
/>
</field>
<tree
position=
"attributes"
>
<attribute
name=
"decoration-danger"
>
is_sync == False
</attribute>
</tree>
</field>
</record>
<!-- # 继承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>
<field
name=
"inherit_id"
ref=
"ccs_base.search_cc_ship_package_view"
/>
<field
name=
"arch"
type=
"xml"
>
<search
position=
"inside"
>
<filter
string=
"Not Sync"
name=
"filter_is_sync"
domain=
"[('is_sync','=',False)]"
/>
</search>
</field>
</record>
# 继承ccs_base模块的form_cc_ship_package_view视图,增加同步日志列表在notebook中
<record
model=
"ir.ui.view"
id=
"form_cc_ship_package_view_inherit"
>
<field
name=
"name"
>
form_cc_ship_package_view_inherit
</field>
<field
name=
"model"
>
cc.ship.package
</field>
<field
name=
"inherit_id"
ref=
"ccs_base.form_cc_ship_package_view"
/>
<field
name=
"arch"
type=
"xml"
>
<notebook
position=
"inside"
>
<notebook
position=
"inside"
>
<page
string=
"Sync Log"
>
<page
string=
"Sync Log"
>
<field
name=
"sync_log_ids"
widget=
"one2many_list"
/>
<field
name=
"
bl_
sync_log_ids"
widget=
"one2many_list"
/>
</page>
</page>
</notebook>
</notebook>
</field>
</field>
...
@@ -100,7 +63,7 @@
...
@@ -100,7 +63,7 @@
<field
name=
"state"
>
code
</field>
<field
name=
"state"
>
code
</field>
<field
name=
"code"
>
<field
name=
"code"
>
if records:
if records:
records.callback_track()
records.callback_track()
</field>
</field>
</record>
</record>
...
@@ -110,11 +73,11 @@
...
@@ -110,11 +73,11 @@
<field
name=
"model_id"
ref=
"model_cc_bl"
/>
<field
name=
"model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_view_types"
>
list
</field>
<field
name=
"binding_view_types"
>
list
</field>
<field
name=
"groups_id"
eval=
"[(4, ref('base.group_system'))]"
/>
<field
name=
"groups_id"
eval=
"[(4, ref('base.group_system'))]"
/>
<field
name=
"state"
>
code
</field>
<field
name=
"state"
>
code
</field>
<field
name=
"code"
>
<field
name=
"code"
>
if records:
if records:
records.deal_ship_package_state()
records.deal_ship_package_state()
</field>
</field>
</record>
</record>
</data>
</data>
...
...
ccs_connect_tiktok/views/cc_ship_package_view.xml
浏览文件 @
2656a7c1
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<odoo>
<record
model=
"ir.ui.view"
id=
"tree_cc_ship_package_view"
>
<field
name=
"name"
>
tree.cc.ship.package
</field>
<!-- # 继承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>
<field
name=
"model"
>
cc.ship.package
</field>
<field
name=
"inherit_id"
ref=
"ccs_base.tree_cc_ship_package_view"
/>
<field
name=
"inherit_id"
ref=
"ccs_base.tree_cc_ship_package_view"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"state"
position=
"after"
>
<field
name=
"is_sync"
/>
</field>
<field
name=
"state"
position=
"replace"
>
<field
name=
"state"
position=
"replace"
>
<field
name=
"tk_code"
invisible=
"1"
/>
<field
name=
"tk_code"
invisible=
"1"
/>
<field
optional=
"show"
name=
"state"
string=
"Progress"
widget=
"badge"
<field
optional=
"show"
name=
"state"
string=
"Progress"
widget=
"badge"
...
@@ -13,7 +19,35 @@
...
@@ -13,7 +19,35 @@
decoration-warning=
"tk_code in ('cb_imcustoms_inspection','cb_imcustoms_exception')"
decoration-warning=
"tk_code in ('cb_imcustoms_inspection','cb_imcustoms_exception')"
decoration-muted=
"tk_code=='cb_import_customs_failure'"
/>
decoration-muted=
"tk_code=='cb_import_customs_failure'"
/>
</field>
</field>
<tree
position=
"attributes"
>
<attribute
name=
"decoration-danger"
>
is_sync == False
</attribute>
</tree>
</field>
</record>
<!-- # 继承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>
<field
name=
"inherit_id"
ref=
"ccs_base.search_cc_ship_package_view"
/>
<field
name=
"arch"
type=
"xml"
>
<search
position=
"inside"
>
<filter
string=
"Not Sync"
name=
"filter_is_sync"
domain=
"[('is_sync','=',False)]"
/>
</search>
</field>
</record>
# 继承ccs_base模块的form_cc_ship_package_view视图,增加同步日志列表在notebook中
<record
model=
"ir.ui.view"
id=
"form_cc_ship_package_view_inherit"
>
<field
name=
"name"
>
form_cc_ship_package_view_inherit
</field>
<field
name=
"model"
>
cc.ship.package
</field>
<field
name=
"inherit_id"
ref=
"ccs_base.form_cc_ship_package_view"
/>
<field
name=
"arch"
type=
"xml"
>
<notebook
position=
"inside"
>
<page
string=
"Sync Log"
>
<field
name=
"sync_log_ids"
widget=
"one2many_list"
/>
</page>
</notebook>
</field>
</field>
</record>
</record>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论