Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
57151be6
提交
57151be6
authored
9月 23, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、新增提货扫码和修改提货信息,尾程快递理货检查是否倒序,托盘理货检查是否倒序的接口开发
2、交货检查是否倒序的接口优化
上级
f16fec9f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
155 行增加
和
90 行删除
+155
-90
zh_CN.po
ccs_base/i18n/zh_CN.po
+41
-32
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+8
-8
cc_node.py
ccs_base/models/cc_node.py
+1
-0
order_controller.py
ccs_connect_tiktok/controllers/order_controller.py
+0
-0
zh_CN.po
ccs_connect_tiktok/i18n/zh_CN.po
+40
-3
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+26
-16
pda_scan_record.py
ccs_connect_tiktok/models/pda_scan_record.py
+19
-22
res_config_setting.py
ccs_connect_tiktok/models/res_config_setting.py
+16
-9
config_settings_views.xml
ccs_connect_tiktok/views/config_settings_views.xml
+4
-0
没有找到文件。
ccs_base/i18n/zh_CN.po
浏览文件 @
57151be6
...
@@ -6,11 +6,11 @@ msgid ""
...
@@ -6,11 +6,11 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-2
2 01:56
+0000\n"
"POT-Creation-Date: 2025-09-2
3 09:28
+0000\n"
"PO-Revision-Date: 2025-09-2
2 09:57
+0800\n"
"PO-Revision-Date: 2025-09-2
3 17:30
+0800\n"
"Last-Translator: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language-Team: \n"
"Language: zh
_CN
\n"
"Language: zh\n"
"MIME-Version: 1.0\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Content-Transfer-Encoding: 8bit\n"
...
@@ -173,6 +173,11 @@ msgstr "<span class=\"o_stat_text\">已交货大包</span>"
...
@@ -173,6 +173,11 @@ msgstr "<span class=\"o_stat_text\">已交货大包</span>"
msgid "<span class=\"o_stat_text\">Goods</span>"
msgid "<span class=\"o_stat_text\">Goods</span>"
msgstr "<span class=\"o_stat_text\">货物</span>"
msgstr "<span class=\"o_stat_text\">货物</span>"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
msgid "<span class=\"o_stat_text\">Picked Up Big Packages</span>"
msgstr "<span class=\"o_stat_text\">已提货大包</span>"
#. module: ccs_base
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_big_package_view
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_big_package_view
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
...
@@ -900,35 +905,6 @@ msgstr "清关重量"
...
@@ -900,35 +905,6 @@ msgstr "清关重量"
msgid "Checked goods"
msgid "Checked goods"
msgstr "已理货"
msgstr "已理货"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__pickup_user_id
#: model:ir.model.fields,field_description:ccs_base.field_cc_history_big_package__pickup_user_id
msgid "Pickup User"
msgstr "提货人"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__pickup_time
#: model:ir.model.fields,field_description:ccs_base.field_cc_history_big_package__pickup_time
msgid "Pickup Time"
msgstr "提货时间"
#. module: ccs_base
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_big_package__tally_state__picked_up
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_history_big_package__tally_state__picked_up
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_big_package_view
msgid "Picked Up"
msgstr "已提货"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_bl__picked_up_big_package_qty
msgid "Picked Up Big Package Qty"
msgstr "已提货大包数量"
#. module: ccs_base
#: model:ir.actions.act_window,name:ccs_base.action_show_big_package_picked_up
msgid "Picked Up Big Package"
msgstr "已提货大包"
#. module: ccs_base
#. module: ccs_base
#. odoo-python
#. odoo-python
#: code:addons/ccs_base/wizard/add_exception_info_wizard.py:0
#: code:addons/ccs_base/wizard/add_exception_info_wizard.py:0
...
@@ -2574,6 +2550,39 @@ msgstr "托盘号"
...
@@ -2574,6 +2550,39 @@ msgstr "托盘号"
msgid "Pallet Usage Date"
msgid "Pallet Usage Date"
msgstr "托盘使用日期"
msgstr "托盘使用日期"
#. module: ccs_base
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_big_package__tally_state__picked_up
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_big_package_view
msgid "Picked Up"
msgstr "已提货"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#, python-format
msgid "Picked Up Big Package"
msgstr "已提货大包"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_bl__picked_up_big_package_qty
msgid "Picked Up Big Package Qty"
msgstr "已提货大包数量"
#. module: ccs_base
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_node__tally_state__picked_up
msgid "Picked up"
msgstr "已提货"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__pickup_time
msgid "Pickup Time"
msgstr "提货时间"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__pickup_user_id
msgid "Pickup User"
msgstr "提货人"
#. module: ccs_base
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_last_mile_provider__placement_area
#: model:ir.model.fields,field_description:ccs_base.field_cc_last_mile_provider__placement_area
msgid "Placement Area"
msgid "Placement Area"
...
...
ccs_base/models/cc_bill_loading.py
浏览文件 @
57151be6
...
@@ -873,24 +873,24 @@ class CcBL(models.Model):
...
@@ -873,24 +873,24 @@ class CcBL(models.Model):
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
)],
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
)],
}
}
def
action_show_big_package_
tally
(
self
):
def
action_show_big_package_
picked_up
(
self
):
# 返回一个action,显示已
理
货的大包
# 返回一个action,显示已
提
货的大包
return
{
return
{
'name'
:
_
(
'
Tally
Big Package'
),
'name'
:
_
(
'
Picked Up
Big Package'
),
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'cc.big.package'
,
'res_model'
:
'cc.big.package'
,
'view_mode'
:
'tree,form'
,
'view_mode'
:
'tree,form'
,
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
),
(
'tally_state'
,
'='
,
'
checked_goods
'
)],
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
),
(
'tally_state'
,
'='
,
'
picked_up
'
)],
}
}
def
action_show_big_package_
picked_up
(
self
):
def
action_show_big_package_
tally
(
self
):
# 返回一个action,显示已
提
货的大包
# 返回一个action,显示已
理
货的大包
return
{
return
{
'name'
:
_
(
'
Picked Up
Big Package'
),
'name'
:
_
(
'
Tally
Big Package'
),
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'cc.big.package'
,
'res_model'
:
'cc.big.package'
,
'view_mode'
:
'tree,form'
,
'view_mode'
:
'tree,form'
,
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
),
(
'tally_state'
,
'='
,
'
picked_up
'
)],
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
),
(
'tally_state'
,
'='
,
'
checked_goods
'
)],
}
}
def
action_show_big_package_delivered
(
self
):
def
action_show_big_package_delivered
(
self
):
...
...
ccs_base/models/cc_node.py
浏览文件 @
57151be6
...
@@ -43,6 +43,7 @@ class CcNode(models.Model):
...
@@ -43,6 +43,7 @@ class CcNode(models.Model):
tally_state
=
fields
.
Selection
([
tally_state
=
fields
.
Selection
([
(
'unprocessed_goods'
,
'Unprocessed goods'
),
(
'unprocessed_goods'
,
'Unprocessed goods'
),
(
'picked_up'
,
'Picked up'
),
(
'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
)
# 对应大包状态 未理货/已理货/尾程交接
...
...
ccs_connect_tiktok/controllers/order_controller.py
浏览文件 @
57151be6
差异被折叠。
点击展开。
ccs_connect_tiktok/i18n/zh_CN.po
浏览文件 @
57151be6
...
@@ -6,8 +6,8 @@ msgid ""
...
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-2
2 01:59
+0000\n"
"POT-Creation-Date: 2025-09-2
3 09:31
+0000\n"
"PO-Revision-Date: 2025-09-2
2 10:00
+0800\n"
"PO-Revision-Date: 2025-09-2
3 17:35
+0800\n"
"Last-Translator: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language-Team: \n"
"Language: zh_CN\n"
"Language: zh_CN\n"
...
@@ -95,6 +95,14 @@ msgstr "提单号"
...
@@ -95,6 +95,14 @@ msgstr "提单号"
msgid "Bill Of Loading Sync Logs"
msgid "Bill Of Loading Sync Logs"
msgstr "关务提单状态同步日志"
msgstr "关务提单状态同步日志"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: model:ir.model.fields.selection,name:ccs_connect_tiktok.selection__pda_scan_record__operation__bill_pickup
#, python-format
msgid "Bill Pickup"
msgstr "按提单提货"
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
#. odoo-python
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
...
@@ -388,6 +396,14 @@ msgstr "托盘"
...
@@ -388,6 +396,14 @@ msgstr "托盘"
msgid "Pallet Handover"
msgid "Pallet Handover"
msgstr "托盘交货"
msgstr "托盘交货"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: model:ir.model.fields.selection,name:ccs_connect_tiktok.selection__pda_scan_record__operation__pallet_pickup
#, python-format
msgid "Pallet Pickup"
msgstr "托盘提货"
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
#. odoo-python
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
...
@@ -396,6 +412,14 @@ msgstr "托盘交货"
...
@@ -396,6 +412,14 @@ msgstr "托盘交货"
msgid "Pallet Tally"
msgid "Pallet Tally"
msgstr "托盘理货"
msgstr "托盘理货"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: model:ir.model.fields.selection,name:ccs_connect_tiktok.selection__pda_scan_record__record_type__pickup
#, python-format
msgid "Pickup"
msgstr "提货"
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_node__interval_minutes
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_node__interval_minutes
msgid "Predecessor Node Interval (Minutes)"
msgid "Predecessor Node Interval (Minutes)"
...
@@ -541,6 +565,14 @@ msgstr "进度编码"
...
@@ -541,6 +565,14 @@ msgstr "进度编码"
msgid "Tail Handover"
msgid "Tail Handover"
msgstr "按尾程交货"
msgstr "按尾程交货"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: model:ir.model.fields.selection,name:ccs_connect_tiktok.selection__pda_scan_record__operation__tail_pickup
#, python-format
msgid "Tail Pickup"
msgstr ""
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
#. odoo-python
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
...
@@ -685,7 +717,7 @@ msgstr ""
...
@@ -685,7 +717,7 @@ msgstr ""
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_res_config_settings__delivery_time
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_res_config_settings__delivery_time
msgid "交货
操作晚于提货操作X分钟
"
msgid "交货
间隔时间
"
msgstr ""
msgstr ""
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
...
@@ -901,6 +933,11 @@ msgstr ""
...
@@ -901,6 +933,11 @@ msgstr ""
msgid "状态"
msgid "状态"
msgstr ""
msgstr ""
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_res_config_settings__tally_interval_time
msgid "理货间隔时间"
msgstr ""
#. module: ccs_connect_tiktok
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_ao_tt_api_log__source
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_ao_tt_api_log__source
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.search_ao_tt_api_log_view
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.search_ao_tt_api_log_view
...
...
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
57151be6
...
@@ -1169,22 +1169,28 @@ class CcBl(models.Model):
...
@@ -1169,22 +1169,28 @@ class CcBl(models.Model):
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_sync'
,
'='
,
False
)],
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_sync'
,
'='
,
False
)],
}
}
def
search_bl_info
(
self
,
pda_lang
=
False
,
type
=
'tally'
):
def
search_bl_info
(
self
,
pda_lang
=
False
,
type
=
'tally'
,
is_all
=
True
):
"""
"""
查询提单信息
查询提单信息
"""
"""
vals
=
{
vals
=
{
'bl_id'
:
self
.
id
,
# 提单id
'bl_no'
:
self
.
bl_no
or
''
,
# 提单号
'bl_no'
:
self
.
bl_no
or
''
,
# 提单号
'scan_big_package_qty'
:
self
.
tally_big_package_qty
+
self
.
delivered_big_package_qty
if
type
==
'tally'
else
self
.
delivered_big_package_qty
,
# 已扫大包数量
'big_package_arr'
:
[
big_package_item
.
search_big_package_info
(
pda_lang
=
pda_lang
,
type
=
type
)
for
big_package_item
in
self
.
big_package_ids
],
# 大包信息
'ship_package_arr'
:
[
ship_package_item
.
search_ship_package_info
(
pda_lang
=
pda_lang
)
for
ship_package_item
in
self
.
ship_package_ids
],
# 小包信息
'pallet_arr'
:
self
.
get_unique_pallet_info
(),
# 托盘信息
}
}
if
is_all
:
vals
.
update
({
'scan_big_package_qty'
:
self
.
tally_big_package_qty
+
self
.
delivered_big_package_qty
if
type
==
'tally'
else
self
.
delivered_big_package_qty
,
# 已扫大包数量
'big_package_arr'
:
[
big_package_item
.
search_big_package_info
(
pda_lang
=
pda_lang
,
type
=
type
)
for
big_package_item
in
self
.
big_package_ids
],
# 大包信息
'ship_package_arr'
:
[
ship_package_item
.
search_ship_package_info
(
pda_lang
=
pda_lang
)
for
ship_package_item
in
self
.
ship_package_ids
],
# 小包信息
'pallet_arr'
:
self
.
get_unique_pallet_info
(),
# 托盘信息
})
return
vals
return
vals
def
get_unique_pallet_info
(
self
):
def
get_unique_pallet_info
(
self
):
...
@@ -1243,7 +1249,8 @@ class CcBl(models.Model):
...
@@ -1243,7 +1249,8 @@ class CcBl(models.Model):
user_obj
=
self
.
env
[
'res.users'
]
.
search
([(
'login'
,
'='
,
pda_db_user
)],
limit
=
1
)
user_obj
=
self
.
env
[
'res.users'
]
.
search
([(
'login'
,
'='
,
pda_db_user
)],
limit
=
1
)
ship_package_ids
=
[
ship_package_dict
for
sublist
in
[
d
[
'id'
]
for
d
in
ship_packages
]
for
ship_package_ids
=
[
ship_package_dict
for
sublist
in
[
d
[
'id'
]
for
d
in
ship_packages
]
for
ship_package_dict
in
sublist
]
ship_package_dict
in
sublist
]
tally_state
=
'checked_goods'
if
action_type
==
'tally'
else
'handover_completed'
tally_state
=
'checked_goods'
if
action_type
==
'tally'
else
(
'picked_up'
if
action_type
==
'pickup'
else
'handover_completed'
)
# 后续节点
# 后续节点
node_obj
=
self
.
env
[
'cc.node'
]
.
sudo
()
.
search
([
node_obj
=
self
.
env
[
'cc.node'
]
.
sudo
()
.
search
([
(
'node_type'
,
'='
,
'package'
),
(
'node_type'
,
'='
,
'package'
),
...
@@ -1444,12 +1451,15 @@ class CcBigPackage(models.Model):
...
@@ -1444,12 +1451,15 @@ class CcBigPackage(models.Model):
vals
=
{
vals
=
{
'tally_state_label'
:
state_arr
[
self
.
tally_state
]
or
''
,
# 理货状态显示名称
'tally_state_label'
:
state_arr
[
self
.
tally_state
]
or
''
,
# 理货状态显示名称
'tally_state'
:
self
.
tally_state
or
''
,
# 理货状态系统KEY
'tally_state'
:
self
.
tally_state
or
''
,
# 理货状态系统KEY
'tally_user_id'
:
(
self
.
tally_user_id
.
id
or
0
)
if
type
==
'tally'
else
((
self
.
delivery_user_id
.
id
or
0
)
if
type
==
'handover'
else
(
self
.
pickup_user_id
.
id
or
0
)),
'tally_user_id'
:
(
self
.
tally_user_id
.
id
or
0
)
if
type
==
'tally'
else
(
(
self
.
delivery_user_id
.
id
or
0
)
if
type
==
'handover'
else
(
self
.
pickup_user_id
.
id
or
0
)),
# 理货人id/交货人id/提货人id
# 理货人id/交货人id/提货人id
'tally_user_name'
:
(
self
.
tally_user_id
.
name
or
''
)
if
type
==
'tally'
else
((
'tally_user_name'
:
(
self
.
tally_user_id
.
name
or
''
)
if
type
==
'tally'
else
((
self
.
delivery_user_id
.
name
or
''
)
if
type
==
'handover'
else
(
self
.
pickup_user_id
.
name
or
''
)),
self
.
delivery_user_id
.
name
or
''
)
if
type
==
'handover'
else
(
self
.
pickup_user_id
.
name
or
''
)),
# 理货人名称/交货人名称/提货人名称
# 理货人名称/交货人名称/提货人名称
'tally_time'
:
(
self
.
tally_time
or
''
)
if
type
==
'tally'
else
((
self
.
delivery_time
or
''
)
if
type
==
'handover'
else
(
self
.
pickup_time
or
''
)),
'tally_time'
:
(
self
.
tally_time
or
''
)
if
type
==
'tally'
else
(
(
self
.
delivery_time
or
''
)
if
type
==
'handover'
else
(
self
.
pickup_time
or
''
)),
# 理货时间/交货时间/提货时间
# 理货时间/交货时间/提货时间
'big_package_no'
:
self
.
big_package_no
or
''
,
# 大包号
'big_package_no'
:
self
.
big_package_no
or
''
,
# 大包号
'next_service_provider_name'
:
self
.
next_provider_name
or
''
,
# 下一个服务商名称
'next_service_provider_name'
:
self
.
next_provider_name
or
''
,
# 下一个服务商名称
...
@@ -1467,13 +1477,13 @@ class CcBigPackage(models.Model):
...
@@ -1467,13 +1477,13 @@ class CcBigPackage(models.Model):
action_type
=
kwargs
.
get
(
'action_type'
)
action_type
=
kwargs
.
get
(
'action_type'
)
for
item
in
self
:
for
item
in
self
:
if
action_type
==
'tally'
and
item
.
tally_state
==
'unprocessed_goods'
:
if
action_type
==
'tally'
and
item
.
tally_state
in
(
'unprocessed_goods'
,
'picked_up'
)
:
# 更新理货信息
# 更新理货信息
self
.
_update_info
(
item
,
kwargs
,
'tally'
)
self
.
_update_info
(
item
,
kwargs
,
'tally'
)
elif
action_type
==
'handover'
and
item
.
tally_state
!=
'handover_completed'
:
elif
action_type
==
'handover'
and
item
.
tally_state
!=
'handover_completed'
:
# 更新交接信息
# 更新交接信息
self
.
_update_info
(
item
,
kwargs
,
'handover'
)
self
.
_update_info
(
item
,
kwargs
,
'handover'
)
elif
action_type
==
'pickup'
and
item
.
tally_state
==
'
picked_up
'
:
elif
action_type
==
'pickup'
and
item
.
tally_state
==
'
unprocessed_goods
'
:
# 更新提货信息
# 更新提货信息
self
.
_update_info
(
item
,
kwargs
,
'pickup'
)
self
.
_update_info
(
item
,
kwargs
,
'pickup'
)
...
...
ccs_connect_tiktok/models/pda_scan_record.py
浏览文件 @
57151be6
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
odoo
import
models
,
fields
,
api
,
_
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
ValidationError
class
PDAScanRecord
(
models
.
Model
):
class
PDAScanRecord
(
models
.
Model
):
...
@@ -19,31 +18,29 @@ class PDAScanRecord(models.Model):
...
@@ -19,31 +18,29 @@ class PDAScanRecord(models.Model):
elif
'pickup'
in
self
.
operation
:
elif
'pickup'
in
self
.
operation
:
self
.
record_type
=
'pickup'
self
.
record_type
=
'pickup'
elif
'handover'
in
self
.
operation
:
elif
'handover'
in
self
.
operation
:
self
.
record_type
=
'handover'
self
.
record_type
=
'handover'
operator_id
=
fields
.
Many2one
(
'res.users'
,
string
=
'操作人'
,
required
=
True
)
operator_id
=
fields
.
Many2one
(
'res.users'
,
string
=
'操作人'
,
required
=
True
)
operation_time
=
fields
.
Datetime
(
string
=
'操作时间'
,
required
=
True
,
default
=
fields
.
Datetime
.
now
)
operation_time
=
fields
.
Datetime
(
string
=
'操作时间'
,
required
=
True
,
default
=
fields
.
Datetime
.
now
)
operation
=
fields
.
Selection
([
operation
=
fields
.
Selection
([
(
'bill_tally'
,
_
(
'Bill Tally'
)),
# 按提单理货
(
'bill_tally'
,
_
(
'Bill Tally'
)),
# 按提单理货
(
'tail_tally'
,
_
(
'Tail Tally'
)),
# 按尾程理货
(
'tail_tally'
,
_
(
'Tail Tally'
)),
# 按尾程理货
(
'pallet_tally'
,
_
(
'Pallet Tally'
)),
# 按托盘理货
(
'pallet_tally'
,
_
(
'Pallet Tally'
)),
# 按托盘理货
(
'bill_pickup'
,
_
(
'Bill Pickup'
)),
# 按提单提货
(
'bill_pickup'
,
_
(
'Bill Pickup'
)),
# 按提单提货
(
'tail_pickup'
,
_
(
'Tail Pickup'
)),
# 按尾程提货
(
'bill_handover'
,
_
(
'Bill Handover'
)),
# 按提单交货
(
'pallet_pickup'
,
_
(
'Pallet Pickup'
)),
# 按托盘提货
(
'tail_handover'
,
_
(
'Tail Handover'
)),
# 按尾程交货
(
'bill_handover'
,
_
(
'Bill Handover'
)),
# 按提单交货
(
'tail_handover'
,
_
(
'Tail Handover'
)),
# 按尾程交货
(
'pallet_handover'
,
_
(
'Pallet Handover'
))
# 按托盘交货
(
'pallet_handover'
,
_
(
'Pallet Handover'
))
# 按托盘交货
],
string
=
_
(
'Operation'
),
required
=
True
)
# 操作
],
string
=
_
(
'Operation'
),
required
=
True
)
# 操作
record_type
=
fields
.
Selection
([
record_type
=
fields
.
Selection
([
(
'tally'
,
_
(
'Tally'
)),
# 理货
(
'tally'
,
_
(
'Tally'
)),
# 理货
(
'pickup'
,
_
(
'Pickup'
)),
# 提货
(
'pickup'
,
_
(
'Pickup'
)),
# 提货
(
'handover'
,
_
(
'Handover'
))
# 交货
(
'handover'
,
_
(
'Handover'
))
# 交货
],
string
=
_
(
'Type'
),
required
=
True
)
# 类型
],
string
=
_
(
'Type'
),
required
=
True
)
# 类型
bill_number
=
fields
.
Char
(
string
=
_
(
'Bill Number'
))
# 提单号
bill_number
=
fields
.
Char
(
string
=
_
(
'Bill Number'
))
# 提单号
transfer_number
=
fields
.
Char
(
string
=
_
(
'Transfer Number'
))
# 转运单号
transfer_number
=
fields
.
Char
(
string
=
_
(
'Transfer Number'
))
# 转运单号
# 增加提单关联字段
# 增加提单关联字段
bl_id
=
fields
.
Many2one
(
'cc.bl'
,
string
=
_
(
'Bill of Lading'
),
ondelete
=
'cascade'
)
# 提单对象
bl_id
=
fields
.
Many2one
(
'cc.bl'
,
string
=
_
(
'Bill of Lading'
),
ondelete
=
'cascade'
)
# 提单对象
#增加状态 成功 失败
#
增加状态 成功 失败
state
=
fields
.
Selection
([
state
=
fields
.
Selection
([
(
'success'
,
_
(
'Success'
)),
(
'success'
,
_
(
'Success'
)),
(
'failed'
,
_
(
'Failed'
))
(
'failed'
,
_
(
'Failed'
))
...
@@ -51,7 +48,8 @@ class PDAScanRecord(models.Model):
...
@@ -51,7 +48,8 @@ class PDAScanRecord(models.Model):
failure_reason
=
fields
.
Char
(
string
=
_
(
'Failure Reason'
))
# 失败原因
failure_reason
=
fields
.
Char
(
string
=
_
(
'Failure Reason'
))
# 失败原因
@api.model
@api.model
def
create_scan_record
(
self
,
operation
,
record_type
,
bill_number
,
transfer_number
,
state
,
operator_id
=
False
,
bl_id
=
False
,
failure_reason
=
False
,
operation_time
=
False
):
def
create_scan_record
(
self
,
operation
,
record_type
,
bill_number
,
transfer_number
,
state
,
operator_id
=
False
,
bl_id
=
False
,
failure_reason
=
False
,
operation_time
=
False
):
"""
"""
创建扫码记录的方法,供接口调用
创建扫码记录的方法,供接口调用
Create scan record method for API calls
Create scan record method for API calls
...
@@ -59,13 +57,13 @@ class PDAScanRecord(models.Model):
...
@@ -59,13 +57,13 @@ class PDAScanRecord(models.Model):
try
:
try
:
if
not
operator_id
:
if
not
operator_id
:
operator_id
=
self
.
env
[
'res.users'
]
.
search
([(
'login'
,
'='
,
'pda'
)],
limit
=
1
)
.
id
operator_id
=
self
.
env
[
'res.users'
]
.
search
([(
'login'
,
'='
,
'pda'
)],
limit
=
1
)
.
id
# 如果没有传入bl_id,根据bill_number查找提单对象
# 如果没有传入bl_id,根据bill_number查找提单对象
if
not
bl_id
and
bill_number
:
if
not
bl_id
and
bill_number
:
bl_obj
=
self
.
env
[
'cc.bl'
]
.
sudo
()
.
deal_bl_no_and_transfer_bl_no
(
bill_number
)
bl_obj
=
self
.
env
[
'cc.bl'
]
.
sudo
()
.
deal_bl_no_and_transfer_bl_no
(
bill_number
)
if
bl_obj
:
if
bl_obj
:
bl_id
=
bl_obj
.
id
bl_id
=
bl_obj
.
id
# 准备创建记录的数据
# 准备创建记录的数据
record_data
=
{
record_data
=
{
'operator_id'
:
operator_id
,
'operator_id'
:
operator_id
,
...
@@ -77,11 +75,11 @@ class PDAScanRecord(models.Model):
...
@@ -77,11 +75,11 @@ class PDAScanRecord(models.Model):
'state'
:
state
,
'state'
:
state
,
'failure_reason'
:
failure_reason
'failure_reason'
:
failure_reason
}
}
# 如果传入了自定义操作时间,使用它
# 如果传入了自定义操作时间,使用它
if
operation_time
:
if
operation_time
:
record_data
[
'operation_time'
]
=
operation_time
record_data
[
'operation_time'
]
=
operation_time
record
=
self
.
create
(
record_data
)
record
=
self
.
create
(
record_data
)
return
{
return
{
'success'
:
True
,
'success'
:
True
,
...
@@ -92,4 +90,4 @@ class PDAScanRecord(models.Model):
...
@@ -92,4 +90,4 @@ class PDAScanRecord(models.Model):
return
{
return
{
'success'
:
False
,
'success'
:
False
,
'message'
:
_
(
'Creation failed:
%
s'
)
%
str
(
e
)
# 创建失败
'message'
:
_
(
'Creation failed:
%
s'
)
%
str
(
e
)
# 创建失败
}
}
\ No newline at end of file
ccs_connect_tiktok/models/res_config_setting.py
浏览文件 @
57151be6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
import
logging
import
logging
from
odoo
import
api
,
fields
,
models
,
_
from
odoo
import
api
,
fields
,
models
_logger
=
logging
.
getLogger
(
__name__
)
_logger
=
logging
.
getLogger
(
__name__
)
...
@@ -15,14 +15,19 @@ class ResConfigSettings(models.TransientModel):
...
@@ -15,14 +15,19 @@ class ResConfigSettings(models.TransientModel):
tt_app_secret
=
fields
.
Char
(
'AppSecret'
,
default
=
''
)
tt_app_secret
=
fields
.
Char
(
'AppSecret'
,
default
=
''
)
tt_version
=
fields
.
Char
(
'接口版本'
,
default
=
'3.0'
)
tt_version
=
fields
.
Char
(
'接口版本'
,
default
=
'3.0'
)
tt_customer_id
=
fields
.
Many2one
(
'res.partner'
,
string
=
'客户'
)
tt_customer_id
=
fields
.
Many2one
(
'res.partner'
,
string
=
'客户'
)
#交货操作晚于提货操作X分钟【默认80分钟】
# 交货操作晚于提货操作X分钟【默认80分钟】
delivery_time
=
fields
.
Integer
(
'交货操作晚于提货操作X分钟'
,
default
=
80
,
config_parameter
=
'delivery_time'
)
delivery_time
=
fields
.
Integer
(
'交货间隔时间'
,
default
=
80
,
config_parameter
=
'delivery_time'
)
# 提货操作晚于理货操作X分钟【默认80分钟】
tally_interval_time
=
fields
.
Integer
(
'理货间隔时间'
,
default
=
80
,
config_parameter
=
'tally_interval_time'
)
# 巡查配置
# 巡查配置
patrol_receiver_emails
=
fields
.
Char
(
'接收邮件地址'
,
help
=
'多个邮箱地址,用逗号分隔'
,
config_parameter
=
'patrol_receiver_emails'
)
patrol_receiver_emails
=
fields
.
Char
(
'接收邮件地址'
,
help
=
'多个邮箱地址,用逗号分隔'
,
config_parameter
=
'patrol_receiver_emails'
)
patrol_sender_email
=
fields
.
Char
(
'发送邮箱地址'
,
config_parameter
=
'patrol_sender_email'
)
patrol_sender_email
=
fields
.
Char
(
'发送邮箱地址'
,
config_parameter
=
'patrol_sender_email'
)
patrol_check_days
=
fields
.
Integer
(
'巡查天数'
,
default
=
5
,
help
=
'检查近几天的提单'
,
config_parameter
=
'patrol_check_days'
)
patrol_check_days
=
fields
.
Integer
(
'巡查天数'
,
default
=
5
,
help
=
'检查近几天的提单'
,
patrol_start_hour
=
fields
.
Integer
(
'巡查开始时间(小时)'
,
default
=
8
,
help
=
'北京时间,24小时制'
,
config_parameter
=
'patrol_start_hour'
)
config_parameter
=
'patrol_check_days'
)
patrol_start_hour
=
fields
.
Integer
(
'巡查开始时间(小时)'
,
default
=
8
,
help
=
'北京时间,24小时制'
,
config_parameter
=
'patrol_start_hour'
)
@api.model
@api.model
def
get_values
(
self
):
def
get_values
(
self
):
...
@@ -38,6 +43,7 @@ class ResConfigSettings(models.TransientModel):
...
@@ -38,6 +43,7 @@ class ResConfigSettings(models.TransientModel):
tt_version
=
config
.
get_param
(
'tt_version'
,
default
=
''
)
tt_version
=
config
.
get_param
(
'tt_version'
,
default
=
''
)
tt_customer_id
=
config
.
get_param
(
'tt_customer_id'
,
default
=
False
)
tt_customer_id
=
config
.
get_param
(
'tt_customer_id'
,
default
=
False
)
delivery_time
=
config
.
get_param
(
'delivery_time'
,
default
=
80
)
delivery_time
=
config
.
get_param
(
'delivery_time'
,
default
=
80
)
tally_interval_time
=
config
.
get_param
(
'tally_interval_time'
,
default
=
80
)
patrol_receiver_emails
=
config
.
get_param
(
'patrol_receiver_emails'
,
default
=
''
)
patrol_receiver_emails
=
config
.
get_param
(
'patrol_receiver_emails'
,
default
=
''
)
patrol_sender_email
=
config
.
get_param
(
'patrol_sender_email'
,
default
=
''
)
patrol_sender_email
=
config
.
get_param
(
'patrol_sender_email'
,
default
=
''
)
patrol_check_days
=
config
.
get_param
(
'patrol_check_days'
,
default
=
5
)
patrol_check_days
=
config
.
get_param
(
'patrol_check_days'
,
default
=
5
)
...
@@ -50,6 +56,7 @@ class ResConfigSettings(models.TransientModel):
...
@@ -50,6 +56,7 @@ class ResConfigSettings(models.TransientModel):
tt_version
=
tt_version
,
tt_version
=
tt_version
,
tt_customer_id
=
customer
,
tt_customer_id
=
customer
,
delivery_time
=
delivery_time
,
delivery_time
=
delivery_time
,
tally_interval_time
=
tally_interval_time
,
patrol_receiver_emails
=
patrol_receiver_emails
,
patrol_receiver_emails
=
patrol_receiver_emails
,
patrol_sender_email
=
patrol_sender_email
,
patrol_sender_email
=
patrol_sender_email
,
patrol_check_days
=
patrol_check_days
,
patrol_check_days
=
patrol_check_days
,
...
@@ -66,7 +73,8 @@ class ResConfigSettings(models.TransientModel):
...
@@ -66,7 +73,8 @@ class ResConfigSettings(models.TransientModel):
ir_config
.
set_param
(
"tt_version"
,
self
.
tt_version
or
""
)
ir_config
.
set_param
(
"tt_version"
,
self
.
tt_version
or
""
)
ir_config
.
set_param
(
"tt_customer_id"
,
self
.
tt_customer_id
.
id
or
False
)
ir_config
.
set_param
(
"tt_customer_id"
,
self
.
tt_customer_id
.
id
or
False
)
ir_config
.
set_param
(
"delivery_time"
,
self
.
delivery_time
or
80
)
ir_config
.
set_param
(
"delivery_time"
,
self
.
delivery_time
or
80
)
ir_config
.
set_param
(
"tally_interval_time"
,
self
.
tally_interval_time
or
80
)
ir_config
.
set_param
(
"patrol_receiver_emails"
,
self
.
patrol_receiver_emails
or
""
)
ir_config
.
set_param
(
"patrol_receiver_emails"
,
self
.
patrol_receiver_emails
or
""
)
ir_config
.
set_param
(
"patrol_sender_email"
,
self
.
patrol_sender_email
or
""
)
ir_config
.
set_param
(
"patrol_sender_email"
,
self
.
patrol_sender_email
or
""
)
ir_config
.
set_param
(
"patrol_check_days"
,
self
.
patrol_check_days
or
5
)
ir_config
.
set_param
(
"patrol_check_days"
,
self
.
patrol_check_days
or
5
)
ir_config
.
set_param
(
"patrol_start_hour"
,
self
.
patrol_start_hour
or
8
)
ir_config
.
set_param
(
"patrol_start_hour"
,
self
.
patrol_start_hour
or
8
)
\ No newline at end of file
ccs_connect_tiktok/views/config_settings_views.xml
浏览文件 @
57151be6
...
@@ -25,6 +25,10 @@
...
@@ -25,6 +25,10 @@
<label
for=
"tt_customer_id"
/>
<label
for=
"tt_customer_id"
/>
<field
name=
"tt_customer_id"
/>
<field
name=
"tt_customer_id"
/>
</div>
</div>
<div
class=
"text-muted"
>
<label
for=
"tally_interval_time"
/>
<field
name=
"tally_interval_time"
/>
</div>
<div
class=
"text-muted"
>
<div
class=
"text-muted"
>
<label
for=
"delivery_time"
/>
<label
for=
"delivery_time"
/>
<field
name=
"delivery_time"
/>
<field
name=
"delivery_time"
/>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论