Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
f3de60bd
提交
f3de60bd
authored
2月 06, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、小包和推送日志增加快速筛选以及默认近30日日志
2、发送邮件的异常原因根据语言,未发送成功的邮件生成的日志改为发送失败 3、关联托盘时,修改了托盘使用日期需要重新生成托盘号
上级
f819cef1
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
212 行增加
和
47 行删除
+212
-47
zh_CN.po
ccs_base/i18n/zh_CN.po
+89
-20
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+1
-1
cc_last_mile_provider.py
ccs_base/models/cc_last_mile_provider.py
+1
-1
cc_node.py
ccs_base/models/cc_node.py
+1
-1
cc_last_mile_provider_views.xml
ccs_base/views/cc_last_mile_provider_views.xml
+3
-3
cc_ship_package_view.xml
ccs_base/views/cc_ship_package_view.xml
+24
-3
add_exception_info_wizard.py
ccs_base/wizard/add_exception_info_wizard.py
+19
-9
associate_pallet_wizard.py
ccs_base/wizard/associate_pallet_wizard.py
+24
-6
ao_tt_api_log_view.xml
ccs_connect_tiktok/views/ao_tt_api_log_view.xml
+50
-3
没有找到文件。
ccs_base/i18n/zh_CN.po
浏览文件 @
f3de60bd
...
...
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-0
1-24 07:48
+0000\n"
"PO-Revision-Date: 2025-0
1-24 15:50
+0800\n"
"POT-Creation-Date: 2025-0
2-06 06:23
+0000\n"
"PO-Revision-Date: 2025-0
2-06 14:27
+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
...
...
@@ -17,6 +17,20 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.5\n"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0
#, python-format
msgid "%s The package does not exist, please check the input information!"
msgstr "%s 不存在该大包,请检查输入信息!"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0
#, python-format
msgid "%s at %s associated tray %s, with a tray usage date of %s"
msgstr "%s %s关联了托盘%s,托盘使用日期为%s"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0
...
...
@@ -35,6 +49,15 @@ msgid ""
"is: %s, %s %s email"
msgstr "%s %s 操作了异常信息,异常原因:%s,%s%s邮件"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/add_exception_info_wizard.py:0
#, python-format
msgid ""
"%s at %s manipulated abnormal information, the reason for the abnormality "
"is: %s, not sent %s email"
msgstr "%s %s 操作了异常信息,异常原因:%s,未发送%s邮件"
#. module: ccs_base
#: model:mail.template,body_html:ccs_base.email_template_exception_notification_en
msgid ""
...
...
@@ -651,12 +674,6 @@ msgstr "区县"
msgid "COUNTY(EN)"
msgstr "区县(EN)"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.view_add_exception_info_wizard
#: model_terms:ir.ui.view,arch_db:ccs_base.view_associate_pallet_wizard
msgid "Cancel"
msgstr ""
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_bl__cancel_reason
#: model:ir.model.fields,field_description:ccs_base.field_cc_ship_package__cancel_reason
...
...
@@ -719,6 +736,8 @@ msgid "Clearance Files"
msgstr "清关文件"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.view_add_exception_info_wizard
#: model_terms:ir.ui.view,arch_db:ccs_base.view_associate_pallet_wizard
#: model_terms:ir.ui.view,arch_db:ccs_base.view_batch_input_ship_package_wizard
#: model_terms:ir.ui.view,arch_db:ccs_base.view_export_bl_big_package_xlsx_wizard
msgid "Close"
...
...
@@ -766,6 +785,11 @@ msgstr "联系人"
msgid "Container No"
msgstr "集装箱编号"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_node__tally_state
msgid "Corresponding to the status of the big package"
msgstr "对应大包状态"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_last_mile_provider__name
msgid "Courier Name"
...
...
@@ -1200,7 +1224,7 @@ msgstr "高度"
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_big_package__tally_state__handover_completed
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_node__tally_state__handover_completed
msgid "Handover Completed"
msgstr ""
msgstr "
尾程交接
"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_progress__handover_type
...
...
@@ -1421,6 +1445,16 @@ msgstr "长度"
msgid "LSPTaxed"
msgstr ""
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "Last 30 days Ship Package"
msgstr "近30日小包"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "Last 7 days ship package"
msgstr "近7日小包"
#. module: ccs_base
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_progress__handover_type__last_mile_pick_up
msgid "Last Mile PickUp"
...
...
@@ -1511,6 +1545,16 @@ msgstr "最后更新人"
msgid "Last Updated on"
msgstr "最后更新时间"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "Last month ship package"
msgstr "上月小包"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "Last week ship package"
msgstr "上周小包"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_package_good__item_link
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_package_good_view
...
...
@@ -1524,7 +1568,6 @@ msgstr "链接"
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#: code:addons/ccs_base/static/src/views/list.xml:0
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_big_package_view
#, python-format
msgid "Link Pallet"
msgstr "关联托盘"
...
...
@@ -1563,7 +1606,7 @@ msgstr "主数据"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_last_mile_provider__matching_value
msgid "Matching Value"
msgstr "尾程
快递
匹配值"
msgstr "尾程
服务商
匹配值"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__message_has_error
...
...
@@ -1725,13 +1768,6 @@ msgstr "节点类型"
msgid "Normal"
msgstr "正常"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/add_exception_info_wizard.py:0
#, python-format
msgid "Not Sent"
msgstr "未发送"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_bl_view
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
...
...
@@ -2309,6 +2345,13 @@ msgstr "发货人税号"
msgid "Sent"
msgstr "已发送"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/add_exception_info_wizard.py:0
#, python-format
msgid "Sent Fail"
msgstr "发送失败"
#. module: ccs_base
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_package_good__item_tax_status__sentinel
#: model:ir.model.fields.selection,name:ccs_base.selection__cc_ship_package__tax_mark__sentinel
...
...
@@ -2463,7 +2506,6 @@ msgstr "已理货大包数量"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__tally_state
#: model:ir.model.fields,field_description:ccs_base.field_cc_node__tally_state
msgid "Tally Status"
msgstr "理货状态"
...
...
@@ -2557,11 +2599,26 @@ msgstr "托盘号只能输入数字!"
msgid "The usage date cannot be later than the current date!"
msgstr "使用日期不能大于当前日期!"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "This month ship package"
msgstr "本月小包"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "This week ship package"
msgstr "本周小包"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_bl_view
msgid "Today Deadline"
msgstr "今天截止"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "Today's ship package"
msgstr "今日小包"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_bl__bl_total_amount
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
...
...
@@ -2709,7 +2766,7 @@ msgstr "更新小包状态"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_associate_pallet_wizard__usage_date
msgid "Usage Date"
msgstr ""
msgstr "
使用日期
"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_ship_package__user_track_note
...
...
@@ -2769,6 +2826,18 @@ msgstr "是否分大包导出"
msgid "YES"
msgstr "是"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_ship_package_view
msgid "Yesterday's ship package"
msgstr "昨日小包"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#, python-format
msgid "You have no expense to report"
msgstr ""
#. module: ccs_base
#: model_terms:ir.actions.act_window,help:ccs_base.action_cc_big_package
msgid ""
...
...
ccs_base/models/cc_bill_loading.py
浏览文件 @
f3de60bd
...
...
@@ -392,7 +392,7 @@ class CcShipPackage(models.Model):
default
=
lambda
self
:
self
.
env
[
'cc.node'
]
.
search
(
[(
'node_type'
,
'='
,
'package'
),
(
'is_default'
,
'='
,
True
)],
limit
=
1
))
node_exception_reason_id
=
fields
.
Many2one
(
'cc.node.exception.reason'
,
'Exception Reason'
)
process_time
=
fields
.
Datetime
(
'Process Time'
)
process_time
=
fields
.
Datetime
(
'Process Time'
,
index
=
True
)
exception_info_ids
=
fields
.
Many2many
(
'cc.exception.info'
,
'shippackage_exception_info_rel'
,
string
=
'Exception Information'
)
...
...
ccs_base/models/cc_last_mile_provider.py
浏览文件 @
f3de60bd
...
...
@@ -9,4 +9,4 @@ class CCLastMileProvider(models.Model):
abbreviation
=
fields
.
Char
(
string
=
'Abbreviation'
,
required
=
True
)
# 简称
tape_color_value
=
fields
.
Char
(
string
=
'Tape Color Value'
)
# 胶带色值
active
=
fields
.
Boolean
(
'Active'
,
default
=
True
)
# 有效☑️
matching_value
=
fields
.
Float
(
string
=
'Matching Value'
)
# 尾程
快递
匹配值
matching_value
=
fields
.
Float
(
string
=
'Matching Value'
)
# 尾程
服务商
匹配值
ccs_base/models/cc_node.py
浏览文件 @
f3de60bd
...
...
@@ -47,4 +47,4 @@ class CcNode(models.Model):
(
'unprocessed_goods'
,
'Unprocessed goods'
),
(
'checked_goods'
,
'Checked goods'
),
(
'handover_completed'
,
'Handover Completed'
)
],
default
=
'
unprocessed_goods'
,
string
=
'Tally Status'
,
index
=
True
)
# 理货
状态 未理货/已理货/尾程交接
],
default
=
'
'
,
string
=
'Corresponding to the status of the big package'
,
index
=
True
)
# 对应大包
状态 未理货/已理货/尾程交接
ccs_base/views/cc_last_mile_provider_views.xml
浏览文件 @
f3de60bd
...
...
@@ -9,8 +9,8 @@
<group>
<field
name=
"name"
/>
<!-- 快递名称 -->
<field
name=
"abbreviation"
/>
<!-- 简称 -->
<field
name=
"tape_color_value"
/>
<!-- 胶带色值 -->
<field
name=
"matching_value"
/>
<!-- 尾程
快递
匹配值 -->
<field
name=
"tape_color_value"
required=
"1"
/>
<!-- 胶带色值 -->
<field
name=
"matching_value"
/>
<!-- 尾程
服务商
匹配值 -->
</group>
<group>
<field
name=
"active"
/>
<!-- 有效☑️ -->
...
...
@@ -29,7 +29,7 @@
<field
name=
"name"
/>
<!-- 快递名称 -->
<field
name=
"abbreviation"
/>
<!-- 简称 -->
<field
name=
"tape_color_value"
/>
<!-- 胶带色值 -->
<field
name=
"matching_value"
/>
<!-- 尾程
快递
匹配值 -->
<field
name=
"matching_value"
/>
<!-- 尾程
服务商
匹配值 -->
<field
name=
"active"
/>
<!-- 有效☑️ -->
</tree>
</field>
...
...
ccs_base/views/cc_ship_package_view.xml
浏览文件 @
f3de60bd
...
...
@@ -206,7 +206,28 @@
<field
name=
"tracking_no"
string=
"Search"
filter_domain=
"['|', ('tracking_no', 'ilike', self), ('trade_no', 'ilike', self)]"
/>
<separator/>
<filter
string=
"Today's ship package"
domain=
"[('create_date', '>=',time.strftime('%%Y-%%m-%%d 00:00:00')),('create_date', '<=',time.strftime('%%Y-%%m-%%d 24:00:00'))]"
name=
"today_ship"
/>
<filter
string=
"Yesterday's ship package"
domain=
"[('create_date','>=', (context_today() - datetime.timedelta(days=1)).strftime('%Y-%m-%d 00:00:00')),('create_date','<=', (context_today() - datetime.timedelta(days=1)).strftime('%Y-%m-%d 24:00:00'))]"
name=
"last_24h"
/>
<filter
string=
"Last 7 days ship package"
domain=
"[('create_date','<=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d 24:00:00'))]"
name=
"last_7d"
/>
<filter
string=
"This week ship package"
name=
"this_week_ship"
domain=
"[('create_date', '>=', ((datetime.date.today() - datetime.timedelta(days=datetime.date.today().weekday()))).strftime('%Y-%m-%d')),
('create_date', '<=', ((datetime.date.today() + datetime.timedelta(days=6-datetime.date.today().weekday()))).strftime('%Y-%m-%d'))]"
/>
<filter
string=
"Last week ship package"
name=
"last_week_ship"
domain=
"[('create_date', '>=', ((datetime.date.today() - datetime.timedelta(days=7+datetime.date.today().weekday()))).strftime('%Y-%m-%d')),
('create_date', '<=', ((datetime.date.today() - datetime.timedelta(days=datetime.date.today().weekday()+1))).strftime('%Y-%m-%d'))]"
/>
<filter
string=
"This month ship package"
name=
"this_month_ship"
domain=
"[('create_date','>=', time.strftime('%Y-%m-1 00:00:00')),('create_date','<',(context_today() + relativedelta(months=1)).strftime('%Y-%m-1 00:00:00'))]"
/>
<filter
string=
"Last month ship package"
name=
"last_month_ship"
domain=
"[('create_date','<', time.strftime('%Y-%m-1 00:00:00')),('create_date','>=',(context_today() - relativedelta(months=1)).strftime('%Y-%m-1 00:00:00'))]"
/>
<filter
string=
"Last 30 days Ship Package"
name=
"last_30d"
domain=
"[('create_date','>=', (context_today() - datetime.timedelta(days=30)).strftime('%Y-%m-%d 00:00:00'))]"
/>
<separator/>
<field
name=
"tracking_no"
string=
"Tracking No."
/>
<field
name=
"trade_no"
string=
"Trade No"
/>
<field
name=
"user_track_note"
string=
"User Tracking Note"
/>
...
...
@@ -295,9 +316,9 @@
<record
model=
"ir.actions.act_window"
id=
"action_cc_ship_package"
>
<field
name=
"name"
>
Ship Package
</field>
<field
name=
"res_model"
>
cc.ship.package
</field>
<field
name=
"view_mode"
>
tree,form,pivot,graph
</field>
<field
name=
"view_mode"
>
tree,form,
search,
pivot,graph
</field>
<field
name=
"domain"
>
[]
</field>
<field
name=
"context"
>
{}
</field>
<field
name=
"context"
>
{
'search_default_last_30d':1
}
</field>
<field
name=
"help"
type=
"html"
>
<p
class=
"o_view_nocontent_smiling_face"
>
[Ship Package] Not yet! Click the Create button in the top left corner and the sofa is yours!
...
...
ccs_base/wizard/add_exception_info_wizard.py
浏览文件 @
f3de60bd
...
...
@@ -44,18 +44,16 @@ class AddExceptionInfoWizard(models.TransientModel):
package_objs
=
self
.
get_order
()
for
package
in
package_objs
:
package
.
exception_info_ids
=
[(
6
,
0
,
exception_objs
.
ids
)]
# 回写小包的异常信息
# 回写sns %s %s 操作了异常信息,异常原因:%s,%s发送%s邮件
# 发送邮件通知
if
record
.
send_email
:
self
.
send_email_notification
(
record
,
package_objs
,
exception_objs
)
else
:
body
=
_
(
'
%
s at
%
s manipulated abnormal information, the reason for the abnormality is:
%
s,
%
s
%
s email'
)
%
(
'
%
s at
%
s manipulated abnormal information, the reason for the abnormality is:
%
s,
not sent
%
s email'
)
%
(
self
.
env
.
user
.
name
,
fields
.
Datetime
.
now
(),
'/'
.
join
([
exception
.
reason
for
exception
in
exception_objs
]),
_
(
'Sent'
)
if
record
.
send_email
else
_
(
'Not Sent'
),
(
_
(
'Chinese'
)
if
record
.
email_language
==
'zh_CN'
else
_
(
'English'
))
if
record
.
send_email
else
''
)
_
(
'Chinese'
)
if
record
.
email_language
==
'zh_CN'
else
_
(
'English'
))
package
.
message_post
(
body
=
body
)
# 发送邮件通知
if
record
.
send_email
:
self
.
send_email_notification
(
record
,
package_objs
,
exception_objs
)
def
send_email_notification
(
self
,
wizard_obj
,
package_objs
,
exception_objs
):
"""
...
...
@@ -74,10 +72,22 @@ class AddExceptionInfoWizard(models.TransientModel):
email_to
=
','
.
join
(
set
(
email_arr
))
# 取 异常信息里的邮箱
logging
.
info
(
'email_to:
%
s'
%
email_to
)
default_email_from
=
self
.
env
[
"ir.config_parameter"
]
.
sudo
()
.
get_param
(
"default_email_from"
)
template_id
.
send_mail
(
wizard_obj
.
id
,
force_send
=
True
,
local_context
=
{
'lang'
:
self
.
email_language
}
mail_id
=
template_id
.
with_context
(
local_context
)
.
send_mail
(
wizard_obj
.
id
,
force_send
=
True
,
email_values
=
{
'email_from'
:
default_email_from
,
'email_to'
:
email_to
})
mail
=
self
.
env
[
'mail.mail'
]
.
sudo
()
.
browse
(
mail_id
)
for
package
in
package_objs
:
# 回写sns %s %s 操作了异常信息,异常原因:%s,%s发送%s邮件
body
=
_
(
'
%
s at
%
s manipulated abnormal information, the reason for the abnormality is:
%
s,
%
s
%
s email'
)
%
(
self
.
env
.
user
.
name
,
fields
.
Datetime
.
now
(),
'/'
.
join
([
exception
.
reason
for
exception
in
exception_objs
]),
_
(
'Sent Fail'
)
if
mail
.
exists
()
and
mail
.
state
==
'exception'
else
_
(
'Sent'
),
(
_
(
'Chinese'
)
if
wizard_obj
.
email_language
==
'zh_CN'
else
_
(
'English'
))
if
wizard_obj
.
send_email
else
''
)
package
.
message_post
(
body
=
body
)
else
:
raise
UserError
(
_
(
"Email template not found."
))
ccs_base/wizard/associate_pallet_wizard.py
浏览文件 @
f3de60bd
...
...
@@ -10,16 +10,20 @@ class AssociatePalletWizard(models.TransientModel):
_name
=
'associate.pallet.wizard'
_description
=
'Associate Pallet Wizard'
def
get_pallet_number
(
self
):
@api.onchange
(
'usage_date'
)
def
change_usage_date
(
self
):
for
item
in
self
:
if
item
.
usage_date
:
item
.
pallet_number
=
item
.
get_pallet_number
(
item
.
usage_date
)
def
get_pallet_number
(
self
,
usage_date
):
"""
生成托盘号 从001开始,如果
:return: 新的托盘号
"""
try
:
# 获取当前日期
current_date
=
fields
.
Date
.
today
()
# 查找大包中最新的托盘号
latest_pallet
=
self
.
env
[
'cc.big.package'
]
.
search
([(
'pallet_usage_date'
,
'='
,
str
(
current
_date
))],
latest_pallet
=
self
.
env
[
'cc.big.package'
]
.
search
([(
'pallet_usage_date'
,
'='
,
str
(
usage
_date
))],
order
=
'pallet_number desc'
,
limit
=
1
)
# 生成新的托盘号
if
latest_pallet
:
...
...
@@ -31,7 +35,7 @@ class AssociatePalletWizard(models.TransientModel):
raise
ValidationError
(
str
(
e
))
usage_date
=
fields
.
Date
(
string
=
'Usage Date'
,
default
=
fields
.
Date
.
today
)
# 使用日期
pallet_number
=
fields
.
Char
(
string
=
'Pallet Number'
,
required
=
True
,
default
=
get_pallet_number
)
# 托盘号
pallet_number
=
fields
.
Char
(
string
=
'Pallet Number'
,
required
=
True
)
# 托盘号
big_package_numbers
=
fields
.
Text
(
string
=
'Big Package Numbers'
)
# 大包号(可输入多个)
def
confirm
(
self
):
...
...
@@ -42,18 +46,32 @@ class AssociatePalletWizard(models.TransientModel):
raise
ValidationError
(
_
(
'The usage date cannot be later than the current date!'
))
# 使用日期不能大于当前日期!
# 处理大包号
big_package_ids
=
record
.
big_package_numbers
.
splitlines
()
success_package
=
[]
fail_package
=
[]
for
package_number
in
big_package_ids
:
package
=
self
.
env
[
'cc.big.package'
]
.
search
([(
'big_package_no'
,
'='
,
package_number
)],
limit
=
1
)
if
package
:
success_package
.
append
(
package
)
else
:
fail_package
.
append
(
package_number
)
if
fail_package
:
raise
ValidationError
(
_
(
'
%
s The package does not exist, please check the input information!'
)
%
(
'
\n
'
.
join
(
fail_package
)))
# 不存在该大包,请检查输入信息
if
success_package
:
for
package
in
success_package
:
# 回写大包的托盘号和使用日期
old_pallet_number
=
package
.
pallet_number
old_usage_date
=
package
.
pallet_usage_date
package
.
update_pallet_info
(
record
.
pallet_number
,
record
.
usage_date
)
# %s %s更改了托盘号,由%s变更为%s,托盘使用日期%s变更为%s
if
old_pallet_number
:
# %s %s更改了托盘号,由%s变更为%s,托盘使用日期%s变更为%s
body
=
_
(
'
%
s at
%
s changed the pallet number from
%
s to
%
s, and the pallet usage date from
%
s to
%
s'
)
%
(
self
.
env
.
user
.
name
,
fields
.
Datetime
.
now
(),
old_pallet_number
,
record
.
pallet_number
,
old_usage_date
,
record
.
usage_date
)
else
:
# 某人某时关联了托盘xxx,托盘使用日期xxxx
body
=
_
(
'
%
s at
%
s associated tray
%
s, with a tray usage date of
%
s'
)
%
(
self
.
env
.
user
.
name
,
fields
.
Datetime
.
now
(),
record
.
pallet_number
,
record
.
usage_date
)
package
.
message_post
(
body
=
body
)
ccs_connect_tiktok/views/ao_tt_api_log_view.xml
浏览文件 @
f3de60bd
...
...
@@ -41,15 +41,62 @@
</field>
</record>
<record
model=
"ir.ui.view"
id=
"search_ao_tt_api_log_view"
>
<field
name=
"name"
>
search.ao.tt.api.log
</field>
<field
name=
"model"
>
ao.tt.api.log
</field>
<field
name=
"arch"
type=
"xml"
>
<search
string=
"TIKTOK推送日志"
>
<filter
string=
"今日日志"
domain=
"[('create_date', '>=',time.strftime('%%Y-%%m-%%d 00:00:00')),('create_date', '<=',time.strftime('%%Y-%%m-%%d 24:00:00'))]"
name=
"create_date"
/>
<filter
string=
"昨日日志"
domain=
"[('create_date','>=', (context_today() - datetime.timedelta(days=1)).strftime('%Y-%m-%d 00:00:00')),('create_date','<=', (context_today() - datetime.timedelta(days=1)).strftime('%Y-%m-%d 24:00:00'))]"
name=
"last_24h"
/>
<filter
string=
"近7日日志"
domain=
"[('create_date','<=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d 24:00:00'))]"
name=
"last_7d"
/>
<filter
string=
"本周日志"
name=
"this_week_log"
domain=
"[('create_date', '>=', ((datetime.date.today() - datetime.timedelta(days=datetime.date.today().weekday()))).strftime('%Y-%m-%d')),
('create_date', '<=', ((datetime.date.today() + datetime.timedelta(days=6-datetime.date.today().weekday()))).strftime('%Y-%m-%d'))]"
/>
<filter
string=
"上周日志"
name=
"last_week_log"
domain=
"[('create_date', '>=', ((datetime.date.today() - datetime.timedelta(days=7+datetime.date.today().weekday()))).strftime('%Y-%m-%d')),
('create_date', '<=', ((datetime.date.today() - datetime.timedelta(days=datetime.date.today().weekday()+1))).strftime('%Y-%m-%d'))]"
/>
<filter
string=
"本月日志"
name=
"this_month_log"
domain=
"[('create_date','>=', time.strftime('%Y-%m-1 00:00:00')),('create_date','<',(context_today() + relativedelta(months=1)).strftime('%Y-%m-1 00:00:00'))]"
/>
<filter
string=
"上月日志"
name=
"last_month_log"
domain=
"[('create_date','<', time.strftime('%Y-%m-1 00:00:00')),('create_date','>=',(context_today() - relativedelta(months=1)).strftime('%Y-%m-1 00:00:00'))]"
/>
<filter
string=
"近30日日志"
name=
"last_30d"
domain=
"[('create_date','>=', (context_today() - datetime.timedelta(days=30)).strftime('%Y-%m-%d 00:00:00'))]"
/>
<separator/>
<field
name=
"big_bag_no"
/>
<field
name=
"data_text"
/>
<separator/>
<filter
name=
"filter_success_bl"
string=
"成功"
domain=
"[('success_bl','=',True)]"
/>
<filter
name=
"filter_not_success_bl"
string=
"失败"
domain=
"[('success_bl','=',False)]"
/>
<separator/>
<group
expand=
"0"
string=
"分组"
>
<filter
domain=
"[]"
name=
"groupby_success_bl"
string=
"是否成功"
context=
"{'group_by': 'success_bl'}"
/>
<filter
domain=
"[]"
name=
"groupby_big_bag_no"
string=
"业务信息"
context=
"{'group_by': 'big_bag_no'}"
/>
<filter
domain=
"[]"
name=
"groupby_source"
string=
"类型"
context=
"{'group_by': 'source'}"
/>
</group>
<searchpanel>
<field
icon=
"fa-users"
select=
"multi"
name=
"source"
/>
</searchpanel>
</search>
</field>
</record>
<record
model=
"ir.actions.act_window"
id=
"action_ao_tt_api_log"
>
<field
name=
"name"
>
TIKTOK推送日志
</field>
<field
name=
"res_model"
>
ao.tt.api.log
</field>
<field
name=
"view_mode"
>
tree,form
</field>
<field
name=
"view_mode"
>
tree,form
,search
</field>
<field
name=
"domain"
>
[]
</field>
<field
name=
"context"
>
{}
</field>
<field
name=
"context"
>
{
'search_default_last_30d':1
}
</field>
</record>
<menuitem
id=
"menu_ao_flight_tt_api_log"
name=
"TIKTOK推送日志"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论