Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
85fd3b41
提交
85fd3b41
authored
4月 10, 2025
作者:
伍姿英
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release/v2.6.1'
上级
05d10437
cf56f000
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
93 行增加
和
44 行删除
+93
-44
export_bl_and_package_xlsx.py
ccs_base/controllers/export_bl_and_package_xlsx.py
+44
-42
res_config_setting.py
ccs_base/models/res_config_setting.py
+5
-0
cc_package_good_view.xml
ccs_base/views/cc_package_good_view.xml
+1
-1
res_config_setting.xml
ccs_base/views/res_config_setting.xml
+14
-0
order_controller.py
ccs_connect_tiktok/controllers/order_controller.py
+1
-0
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+28
-1
没有找到文件。
ccs_base/controllers/export_bl_and_package_xlsx.py
浏览文件 @
85fd3b41
...
...
@@ -31,7 +31,7 @@ class ExportBlAndPackageXlsx(http.Controller):
if
good_ids
:
for
good_item
in
good_ids
:
good_index
+=
1
sheet1
.
write
(
good_index
,
0
,
package_item
.
logistic_order_no
or
''
)
# 物流订单号
ITEM ID
sheet1
.
write
(
good_index
,
0
,
package_item
.
logistic_order_no
or
''
)
# 物流订单号
CUSTOMS PROVIDER ORDER ID
sheet1
.
write
(
good_index
,
1
,
package_item
.
big_package_id
.
big_package_no
or
''
)
# 小包商品对应的大包号 BIG BAG NO
sheet1
.
write
(
good_index
,
2
,
package_item
.
tracking_no
or
''
)
# 小包追踪号 TRACKING NO
sheet1
.
write
(
good_index
,
3
,
package_item
.
customer_ref
or
''
)
# CUSTOMER REF
...
...
@@ -52,26 +52,27 @@ class ExportBlAndPackageXlsx(http.Controller):
sheet1
.
write
(
good_index
,
18
,
package_item
.
receiver_county
or
''
)
# RECEIPIENT COUNTY
sheet1
.
write
(
good_index
,
19
,
package_item
.
receiver_postcode
or
''
)
# RECEIPIENT POSTCODE
sheet1
.
write
(
good_index
,
20
,
package_item
.
receiver_email
or
''
)
# RECEPIENT EMAIL
sheet1
.
write
(
good_index
,
21
,
package_item
.
receiver_phone
or
''
)
# PHONE NUMBER
sheet1
.
write
(
good_index
,
22
,
package_item
.
gross_weight
or
0
)
# GROSS WEIGHT (KG)
sheet1
.
write
(
good_index
,
23
,
package_item
.
weight_unit
or
0
)
# NET WEIGHT (KG)
sheet1
.
write
(
good_index
,
24
,
package_item
.
currency
or
''
)
# Currency
sheet1
.
write
(
good_index
,
25
,
good_item
.
sku_id
or
''
)
# SKU NUMBER
sheet1
.
write
(
good_index
,
26
,
good_item
.
item_name_en
or
''
)
# ITEM DESCRIPTION
sheet1
.
write
(
good_index
,
27
,
good_item
.
export_hs_code
or
''
)
# ITEM HS CODE
sheet1
.
write
(
good_index
,
28
,
good_item
.
quantity
)
# ITEM QUANTITY
sheet1
.
write
(
good_index
,
29
,
good_item
.
quantity_unit
or
''
)
# UNITS
sheet1
.
write
(
good_index
,
30
,
good_item
.
item_total_price
)
# TOTAL VALUE
sheet1
.
write
(
good_index
,
31
,
good_item
.
item_vat
or
''
)
# VAT
sheet1
.
write
(
good_index
,
32
,
''
)
# SKU NUMBER
sheet1
.
write
(
good_index
,
33
,
good_item
.
item_link
or
''
)
# PRODUCT LINK
sheet1
.
write
(
good_index
,
34
,
''
)
# LENGTH
sheet1
.
write
(
good_index
,
35
,
''
)
# WIDTH
sheet1
.
write
(
good_index
,
36
,
''
)
# HEIGHT
sheet1
.
write
(
good_index
,
37
,
package_item
.
receiver_detailed_address
or
''
)
# Detailed Address
sheet1
.
write
(
good_index
,
38
,
package_item
.
next_provider_name
or
''
)
# Last Mile Service Provider 关联的小包的下一个服务商名称
sheet1
.
write
(
good_index
,
39
,
sum
(
package_item
.
good_ids
.
mapped
(
'item_total_price'
)))
# GOODS VALUE 小包上的所有商品的货物总价之和
sheet1
.
write
(
good_index
,
40
,
good_item
.
import_hs_code
or
''
)
# HSCODE IMPORT 取商品上的进口hscode
sheet1
.
write
(
good_index
,
21
,
package_item
.
receiver_detailed_address
or
''
)
# Detailed Address
sheet1
.
write
(
good_index
,
22
,
package_item
.
receiver_phone
or
''
)
# PHONE NUMBER
sheet1
.
write
(
good_index
,
23
,
package_item
.
gross_weight
or
0
)
# GROSS WEIGHT
sheet1
.
write
(
good_index
,
24
,
package_item
.
weight_unit
or
0
)
# Weight Unit
sheet1
.
write
(
good_index
,
25
,
package_item
.
currency
or
''
)
# Currency
sheet1
.
write
(
good_index
,
26
,
good_item
.
item_id
or
''
)
# ITEM ID
sheet1
.
write
(
good_index
,
27
,
good_item
.
sku_id
or
''
)
# SKU NUMBER
sheet1
.
write
(
good_index
,
28
,
good_item
.
item_name_en
or
''
)
# ITEM DESCRIPTION
sheet1
.
write
(
good_index
,
29
,
good_item
.
export_hs_code
or
''
)
# ITEM HS CODE
sheet1
.
write
(
good_index
,
30
,
good_item
.
quantity
)
# ITEM QUANTITY
sheet1
.
write
(
good_index
,
31
,
good_item
.
quantity_unit
or
''
)
# UNITS
sheet1
.
write
(
good_index
,
32
,
good_item
.
item_total_price
)
# TOTAL VALUE
sheet1
.
write
(
good_index
,
33
,
good_item
.
item_vat
or
''
)
# VAT
sheet1
.
write
(
good_index
,
34
,
''
)
# ONLINE SELLING PLACE
sheet1
.
write
(
good_index
,
35
,
good_item
.
item_link
or
''
)
# PRODUCT LINK
sheet1
.
write
(
good_index
,
36
,
''
)
# LENGTH
sheet1
.
write
(
good_index
,
37
,
''
)
# WIDTH
sheet1
.
write
(
good_index
,
38
,
''
)
# HEIGHT
sheet1
.
write
(
good_index
,
39
,
package_item
.
next_provider_name
or
''
)
# Last Mile Service Provider 关联的小包的下一个服务商名称
sheet1
.
write
(
good_index
,
40
,
sum
(
package_item
.
good_ids
.
mapped
(
'item_total_price'
)))
# GOODS VALUE 小包上的所有商品的货物总价之和
sheet1
.
write
(
good_index
,
41
,
good_item
.
import_hs_code
or
''
)
# HSCODE IMPORT 取商品上的进口hscode
if
good_index
==
int
(
parcel_export_num
):
num
+=
1
sheet1
=
self
.
get_package_title
(
worksheet
,
font_style
,
num
)
...
...
@@ -87,7 +88,7 @@ class ExportBlAndPackageXlsx(http.Controller):
for
i
in
range
(
41
):
sheet1
.
col
(
i
)
.
width
=
500
*
11
sheet1
.
col
(
8
)
.
width
=
600
*
11
sheet1
.
write
(
index
,
0
,
u'
ITEM ID'
,
font_style
)
# ITEM ID
sheet1
.
write
(
index
,
0
,
u'
CUSTOMS PROVIDER ORDER ID '
,
font_style
)
# CUSTOMS PROVIDER ORDER ID
sheet1
.
write
(
index
,
1
,
u'BIG BAG NO'
,
font_style
)
# BIG BAG NO
sheet1
.
write
(
index
,
2
,
u'TRACKING NO'
,
font_style
)
# TRACKING NO
sheet1
.
write
(
index
,
3
,
u'CUSTOMER REF'
,
font_style
)
# CUSTOMER REF
...
...
@@ -108,26 +109,27 @@ class ExportBlAndPackageXlsx(http.Controller):
sheet1
.
write
(
index
,
18
,
u'RECEIPIENT COUNTY'
,
font_style
)
# RECEIPIENT COUNTY
sheet1
.
write
(
index
,
19
,
u'RECEIPIENT POSTCODE'
,
font_style
)
# RECEIPIENT POSTCODE
sheet1
.
write
(
index
,
20
,
u'RECEPIENT EMAIL'
,
font_style
)
# RECEPIENT EMAIL
sheet1
.
write
(
index
,
21
,
u'PHONE NUMBER'
,
font_style
)
# PHONE NUMBER
sheet1
.
write
(
index
,
22
,
u'GROSS WEIGHT (KG)'
,
font_style
)
# GROSS WEIGHT (KG)
sheet1
.
write
(
index
,
23
,
u'NET WEIGHT (KG)'
,
font_style
)
# NET WEIGHT (KG)
sheet1
.
write
(
index
,
24
,
u'Currency'
,
font_style
)
# CURRENCY
sheet1
.
write
(
index
,
25
,
u'SKU NUMBER'
,
font_style
)
# SKU NUMBER
sheet1
.
write
(
index
,
26
,
u'ITEM DESCRIPTION'
,
font_style
)
# ITEM DESCRIPTION
sheet1
.
write
(
index
,
27
,
u'ITEM HS CODE'
,
font_style
)
# ITEM HS CODE
sheet1
.
write
(
index
,
28
,
u'ITEM QUANTITY'
,
font_style
)
# ITEM QUANTITY
sheet1
.
write
(
index
,
29
,
u'UNITS'
,
font_style
)
# UNITS
sheet1
.
write
(
index
,
30
,
u'TOTAL VALUE'
,
font_style
)
# TOTAL VALUE
sheet1
.
write
(
index
,
31
,
u'VAT'
,
font_style
)
# VAT
sheet1
.
write
(
index
,
32
,
u'ONLINE SELLING PLACE'
,
font_style
)
# ONLINE SELLING PLACE
sheet1
.
write
(
index
,
33
,
u'PRODUCT LINK'
,
font_style
)
# PRODUCT LINK
sheet1
.
write
(
index
,
34
,
u'LENGTH'
,
font_style
)
# LENGTH
sheet1
.
write
(
index
,
35
,
u'WIDTH'
,
font_style
)
# WIDTH
sheet1
.
write
(
index
,
36
,
u'HEIGHT'
,
font_style
)
# HEIGHT
sheet1
.
write
(
index
,
37
,
u'Detailed Address'
,
font_style
)
# Detailed Address
sheet1
.
write
(
index
,
38
,
u'Last Mile Service Provider'
,
font_style
)
# Last Mile Service Provider
sheet1
.
write
(
index
,
39
,
u'GOODS VALUE'
,
font_style
)
# GOODS VALUE
sheet1
.
write
(
index
,
40
,
u'HSCODE IMPORT'
,
font_style
)
# HSCODE IMPORT
sheet1
.
write
(
index
,
21
,
u'Detailed Address'
,
font_style
)
# Detailed Address
sheet1
.
write
(
index
,
22
,
u'PHONE NUMBER'
,
font_style
)
# PHONE NUMBER
sheet1
.
write
(
index
,
23
,
u'GROSS WEIGHT'
,
font_style
)
# GROSS WEIGHT
sheet1
.
write
(
index
,
24
,
u'Weight Unit'
,
font_style
)
# Weight Unit
sheet1
.
write
(
index
,
25
,
u'Currency'
,
font_style
)
# CURRENCY
sheet1
.
write
(
index
,
26
,
u'ITEM ID'
,
font_style
)
# ITEM ID
sheet1
.
write
(
index
,
27
,
u'SKU NUMBER'
,
font_style
)
# SKU NUMBER
sheet1
.
write
(
index
,
28
,
u'ITEM DESCRIPTION'
,
font_style
)
# ITEM DESCRIPTION
sheet1
.
write
(
index
,
29
,
u'ITEM HS CODE'
,
font_style
)
# ITEM HS CODE
sheet1
.
write
(
index
,
30
,
u'ITEM QUANTITY'
,
font_style
)
# ITEM QUANTITY
sheet1
.
write
(
index
,
31
,
u'UNITS'
,
font_style
)
# UNITS
sheet1
.
write
(
index
,
32
,
u'TOTAL VALUE'
,
font_style
)
# TOTAL VALUE
sheet1
.
write
(
index
,
33
,
u'VAT'
,
font_style
)
# VAT
sheet1
.
write
(
index
,
34
,
u'ONLINE SELLING PLACE'
,
font_style
)
# ONLINE SELLING PLACE
sheet1
.
write
(
index
,
35
,
u'PRODUCT LINK'
,
font_style
)
# PRODUCT LINK
sheet1
.
write
(
index
,
36
,
u'LENGTH'
,
font_style
)
# LENGTH
sheet1
.
write
(
index
,
37
,
u'WIDTH'
,
font_style
)
# WIDTH
sheet1
.
write
(
index
,
38
,
u'HEIGHT'
,
font_style
)
# HEIGHT
sheet1
.
write
(
index
,
39
,
u'Last Mile Service Provider'
,
font_style
)
# Last Mile Service Provider
sheet1
.
write
(
index
,
40
,
u'GOODS VALUE'
,
font_style
)
# GOODS VALUE
sheet1
.
write
(
index
,
41
,
u'HSCODE IMPORT'
,
font_style
)
# HSCODE IMPORT
return
sheet1
# 运单导出包裹清关数据 每个运单导出一个文件 生成压缩包
...
...
ccs_base/models/res_config_setting.py
浏览文件 @
85fd3b41
...
...
@@ -3,6 +3,7 @@
import
logging
from
odoo
import
api
,
fields
,
models
,
_
from
odoo.exceptions
import
ValidationError
_logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -11,6 +12,7 @@ class ResConfigSettings(models.TransientModel):
_inherit
=
'res.config.settings'
before_min
=
fields
.
Integer
(
'清关时间取值(早于清关结束)'
)
package_scan_min
=
fields
.
Integer
(
'一键全扫完成时间(min)'
,
help
=
'输入示范:10,即表示在10分钟内大包时间随机分配,并不能重复'
)
@api.model
def
get_values
(
self
):
...
...
@@ -21,9 +23,11 @@ class ResConfigSettings(models.TransientModel):
values
=
super
(
ResConfigSettings
,
self
)
.
get_values
()
config
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
before_min
=
config
.
get_param
(
'before_min'
,
default
=
10
)
package_scan_min
=
config
.
get_param
(
'package_scan_min'
,
default
=
10
)
values
.
update
(
before_min
=
before_min
,
package_scan_min
=
package_scan_min
,
)
return
values
...
...
@@ -31,3 +35,4 @@ class ResConfigSettings(models.TransientModel):
super
(
ResConfigSettings
,
self
)
.
set_values
()
ir_config
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
ir_config
.
set_param
(
"before_min"
,
self
.
before_min
or
10
)
ir_config
.
set_param
(
"package_scan_min"
,
self
.
package_scan_min
or
10
)
ccs_base/views/cc_package_good_view.xml
浏览文件 @
85fd3b41
...
...
@@ -10,7 +10,7 @@
<field
name=
"arch"
type=
"xml"
>
<tree
string=
"Package Good"
decoration-warning=
"is_cancel==True"
>
<!-- # decoration-muted="opening_debit == 0 and opening_credit == 0" 根据条件显示每行的颜色 muted-->
<field
optional=
"
hide
"
name=
"item_id"
string=
"Item ID"
/>
<field
optional=
"
show
"
name=
"item_id"
string=
"Item ID"
/>
<field
optional=
"show"
name=
"sku_id"
string=
"SKU ID"
/>
<field
optional=
"show"
name=
"item_name_en"
string=
"Name EN"
/>
<field
optional=
"show"
name=
"item_name_cn"
string=
"Name CN"
/>
...
...
ccs_base/views/res_config_setting.xml
浏览文件 @
85fd3b41
...
...
@@ -21,6 +21,20 @@
</div>
</div>
</div>
<div>
<h2>
pda扫码配置
</h2>
<div
class=
"row mt16 o_settings_container"
id=
"pda_scan"
>
<div
class=
"col-12 col-lg-6 o_setting_box"
>
<div
class=
"o_setting_left_pane"
/>
<div
class=
"o_setting_right_pane"
>
<div
class=
"text-muted"
>
<label
for=
"package_scan_min"
/>
<field
name=
"package_scan_min"
/>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
...
...
ccs_connect_tiktok/controllers/order_controller.py
浏览文件 @
85fd3b41
...
...
@@ -89,6 +89,7 @@ class OrderController(http.Controller):
if
bl_obj
:
if
bl_obj
.
state
in
state_arr
:
res
[
'bl_info'
]
=
bl_obj
.
search_bl_info
(
pda_lang
=
pda_lang
,
type
=
action_type
)
res
[
'package_scan_min'
]
=
int
(
request
.
env
[
'res.config.settings'
]
.
sudo
()
.
get_values
()
.
get
(
'package_scan_min'
))
res
[
'state'
]
=
200
else
:
res
[
'message'
]
=
bill_state_msg_dic
[
pda_lang
]
# 没有在系统中找到未完成清关的该提单信息
...
...
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
85fd3b41
...
...
@@ -23,6 +23,33 @@ def get_rfc339_time(utc_time=None):
return
rfc3339_time
# 定义一个方法,将时间的时区转为UTC时间
def
get_utc_rfc339_time
(
local_time
=
None
):
"""获取Odoo本地时区的RFC3339格式时间
Args:
local_time: 本地时间,如果不提供则使用当前时间
Returns:
str: RFC3339格式的时间字符串
"""
if
not
local_time
:
# 获取当前时间的UTC时间
local_time
=
datetime
.
now
()
# 将本地时间转换为UTC时间
utc_time
=
local_time
.
astimezone
(
pytz
.
utc
)
# 格式化为RFC 3339格式
# rfc3339_time = utc_time.isoformat(timespec='seconds')
logging
.
info
(
'utc_time:
%
s'
%
utc_time
)
if
not
local_time
:
# 获取当前时间的UTC时间
local_time
=
datetime
.
now
()
# 将本地时间转换为UTC时间
utc_time
=
local_time
.
astimezone
(
pytz
.
utc
)
# 格式化为RFC 3339格式
rfc3339_time
=
utc_time
.
isoformat
(
timespec
=
'seconds'
)
logging
.
info
(
'rfc3339_time:
%
s'
%
rfc3339_time
)
return
rfc3339_time
# 定义一个方法,将时间的时区转为UTC时间
def
get_utc_time
(
local_time
=
None
):
if
not
local_time
:
...
...
@@ -431,7 +458,7 @@ class CcBl(models.Model):
"customs_waybill_id"
:
self
.
customs_bl_no
or
''
,
# 关务提单号取海关装货单号
"track_detail"
:
{
"operate_time"
:
get_rfc339_time
(
self
.
process_time
),
# "2025-03-19T09:28:00+00:00",
"operate_time"
:
get_
utc_
rfc339_time
(
self
.
process_time
),
# "2025-03-19T09:28:00+00:00",
# "#get_utc_time(self.process_time), # 事件发⽣时间,RFC3339格式(实操时间)
"waybill_status_code"
:
self
.
customs_clearance_status
.
tk_code
,
# 提单关务状态编码
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论