提交 7c1ad553 authored 作者: 贺阳's avatar 贺阳

1、判断操作时间不能大于当前时间,不能小于 小包的最晚操作时间

2、追踪号类型的时候 如果不跳过检查的话,判断更新节点是否是 小包的状态的下一节点 3、提单 状态增加颜色
上级 a48dcb9e
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-19 02:40+0000\n"
"PO-Revision-Date: 2024-09-19 10:43+0800\n"
"POT-Creation-Date: 2024-09-19 08:22+0000\n"
"PO-Revision-Date: 2024-09-19 16:30+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
......@@ -1139,6 +1139,11 @@ msgstr ""
msgid "Last Modified on"
msgstr "最后修改时间"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_batch_input_ship_package_status_wizard__last_process_time
msgid "Last Process Time"
msgstr "最近操作时间"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_batch_input_ship_package_status_wizard__write_uid
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__write_uid
......@@ -1482,7 +1487,7 @@ msgstr "请选择异常原因!"
#: model:ir.model.fields,field_description:ccs_base.field_cc_ship_package__process_time
#: model_terms:ir.ui.view,arch_db:ccs_base.view_batch_input_ship_package_wizard
msgid "Process Time"
msgstr "推送时间"
msgstr "操作时间"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_ship_package_view
......@@ -2108,6 +2113,15 @@ msgstr "节点 [%s] 的进度日期早于现有的进度日期。"
msgid "The node [%s] sequence is less than the existing node sequence."
msgstr "节点 [%s] 序号小于现有节点序号。"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/batch_input_ship_package_statu_wizard.py:0
#, python-format
msgid ""
"The operation time cannot be greater than the current time and cannot be "
"less than the latest operation time!"
msgstr "操作时间不能大于当前时间,也不能小于最近的操作时间!"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_bl_view
msgid "Today Deadline"
......@@ -2323,14 +2337,14 @@ msgstr "【大包】 还没有!点击左上角的“创建”按钮,沙发
msgid ""
"[CC Node] Not yet! Click the Create button in the top left corner and the "
"sofa is yours!"
msgstr "【清关节点】 还没有!点击左上角的“创建”按钮,沙发就是你的了!"
msgstr "[清关节点] 还没有!点击左上角的“创建”按钮,沙发就是你的了!"
#. module: ccs_base
#: model_terms:ir.actions.act_window,help:ccs_base.action_cc_progress
msgid ""
"[CC Progress] Not yet! Click the Create button in the top left corner and "
"the sofa is yours!"
msgstr "【清关进度】 还没有!点击左上角的“创建”按钮,沙发就是你的了!"
msgstr "[清关进度] 还没有!点击左上角的“创建”按钮,沙发就是你的了!"
#. module: ccs_base
#: model_terms:ir.actions.act_window,help:ccs_base.action_cc_is_clearance_company
......@@ -2351,7 +2365,7 @@ msgstr "【清关文件】 还没有!点击左上角的“创建”按钮,
msgid ""
"[Customers] Not yet! Click the Create button in the top left corner and the "
"sofa is yours!"
msgstr "【客户】 还没有!点击左上角的“创建”按钮,沙发就是你的了!"
msgstr "[客户] 还没有!点击左上角的“创建”按钮,沙发就是你的了!"
#. module: ccs_base
#: model_terms:ir.actions.act_window,help:ccs_base.action_cc_package_good
......
......@@ -8,7 +8,7 @@
<field name="model">cc.bl</field>
<field name="arch" type="xml">
<tree string="Bill of Loading" decoration-warning="is_cancel==True">
<field optional="show" name="state" string="Status"/>
<field optional="show" name="state" string="Status" widget="badge" decoration-info="state=='draft'" decoration-primary="state=='ccing'" decoration-success="state=='done'"/>
<field optional="show" name="bl_no" string="Bill of Loading No."/>
<field optional="show" name="bl_date" string="B/L Date"/>
<field optional="show" name="customer_id" string="Customer"/>
......
......@@ -49,10 +49,18 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
@api.depends('bl_id', 'select_type', 'select_tracking_no', 'exclude_tracking_no', 'current_status')
def _compute_update_package_count(self):
for record in self:
record.update_package_count = len(self.get_process_package())
obj = self.get_process_package()
record.update_package_count = len(obj)
last_process_time = False
if len(obj) > 0:
last_process_time = self.env['cc.ship.package'].search([('id', 'in', obj.ids)],
order='process_time desc',
limit=1).process_time
record.last_process_time = last_process_time
is_ok = fields.Boolean('Confirm Date is ok.', default=False)
process_time = fields.Datetime('Process Time')
last_process_time = fields.Datetime('Last Process Time', compute='_compute_update_package_count')
# 添加状态说明字段
state_explain = fields.Text('State Explain', help='State Explain')
node_exception_reason_id = fields.Many2one('cc.node.exception.reason', 'Exception Reason',
......@@ -67,7 +75,12 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
if not parcels:
raise ValidationError(_('No package to update found.')) # 没有找到要更新的小包
# 判断操作时间不能大于当前时间,不能小于 小包的最晚操作时间
current_time = fields.Datetime.now()
if self.process_time and (self.process_time > current_time or (
self.last_process_time and self.process_time < self.last_process_time)):
raise ValidationError(
_('The operation time cannot be greater than the current time and cannot be less than the latest operation time!')) # 操作时间不能大于当前时间且不能小于最晚操作时间
# 判断异常状态是否选择了异常原因
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:
......
......@@ -33,6 +33,7 @@
placeholder="Separate multiple tracking numbers with line breaks"
attrs="{'invisible':[('select_type','=','node')],'required':[('select_type','=','tracking_no')]}"/>
<field name="update_package_count"/>
<field name="last_process_time"/>
<separator/>
<!-- domain="[('id','in',next_code_ids),('node_type','=','package')]"-->
<field name="update_status" required="1"/>
......
......@@ -6,26 +6,26 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-10 09:27+0000\n"
"PO-Revision-Date: 2024-09-10 17:28+0800\n"
"POT-Creation-Date: 2024-09-19 08:24+0000\n"
"PO-Revision-Date: 2024-09-19 16:26+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.3.1\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.5\n"
#. module: ccs_connect_tiktok
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.form_cc_bl_view_inherit
msgid "<span class=\"o_stat_text\">Not Sync Ship Packages</span>"
msgstr "<span class=\"o_stat_text\">小包</span>"
msgstr "<span class=\"o_stat_text\">待同步小包</span>"
#. module: ccs_connect_tiktok
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.form_cc_bl_view_inherit
msgid "<span class=\"o_stat_text\">Ship Packages</span>"
msgstr "Ship Package"
msgstr "<span class=\"o_stat_text\">小包</span>"
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_ship_package_sync_log__api_customer
......@@ -60,25 +60,11 @@ msgstr "批量更新小包状态向导"
msgid "Big Package"
msgstr "大包"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#, python-format
msgid "Big package number [%s] does not exist"
msgstr "大包号 [%s] 不存在"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_cc_bl
msgid "Bill of Loading"
msgstr "提单"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#, python-format
msgid "Bill of lading does not exist"
msgstr "提单不存在"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_cc_node
msgid "CC Node"
......@@ -102,10 +88,15 @@ msgid ""
"the package has already been pushed and will be updated!"
msgstr "检查小包【%s】是否存在还未推送或 小包已经推送过将更变更的状态!"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_cc_clearance_file
msgid "Clearance File"
msgstr "清关文件"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_res_config_settings
msgid "Config Settings"
msgstr "配置"
msgstr "配置设置"
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_ao_tt_api__create_uid
......@@ -171,18 +162,18 @@ msgstr ""
msgid "Last Updated on"
msgstr ""
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#, python-format
msgid "Login name and password cannot be empty"
msgstr "登录名和密码不能为空"
#. module: ccs_connect_tiktok
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.search_cc_ship_package_view_inherit
msgid "Not Sync"
msgstr "未同步"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/cc_bill_loading.py:0
#, python-format
msgid "Not Sync Ship Packages"
msgstr "待同步小包"
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_ship_package_sync_log__operate_remark
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.form_cc_ship_package_sync_log_view
......@@ -205,6 +196,11 @@ msgstr "操作时间"
msgid "Operate User"
msgstr "操作人"
#. module: ccs_connect_tiktok
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.tree_cc_ship_package_view
msgid "Progress"
msgstr "进度"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_cc_ship_package
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_ship_package_sync_log__package_id
......@@ -247,13 +243,6 @@ msgstr "同步包裹状态"
msgid "Sync Time"
msgstr "同步时间"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#, python-format
msgid "System parsing error, the reason for the error is %s"
msgstr "系统解析错误,错误原因是 %s"
#. module: ccs_connect_tiktok
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.res_config_settings_view_form_tt
msgid "TIKTOK接口配置"
......@@ -269,7 +258,9 @@ msgstr ""
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_node__tk_code
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_ship_package__tk_code
#: model:ir.model.fields,help:ccs_connect_tiktok.field_cc_node__tk_code
#: model:ir.model.fields,help:ccs_connect_tiktok.field_cc_ship_package__tk_code
msgid "TK Code"
msgstr "编码"
......@@ -281,20 +272,6 @@ msgstr "编码"
msgid "TK Process Code"
msgstr "进度编码"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#, python-format
msgid "The bill of lading number and package data cannot be empty"
msgstr "提单号和大包数据不能为空"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#, python-format
msgid "The bill of lading number cannot be empty"
msgstr "提单号不能为空"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py:0
......@@ -323,10 +300,10 @@ msgstr "未同步包裹数"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/controllers/order_controller.py:0
#: code:addons/ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py:0
#, python-format
msgid "Wrong login/password"
msgstr "错误的登录/密码"
msgid "[%s] The update node is not the next node in the state of the packet!"
msgstr "[%s]更新节点不是小包状态的下一个节点!"
#. module: ccs_connect_tiktok
#. odoo-python
......@@ -338,8 +315,9 @@ msgstr "[%s]%s更新为[%s]%s"
#. module: ccs_connect_tiktok
#: model_terms:ir.actions.act_window,help:ccs_connect_tiktok.action_cc_ship_package_sync_log
msgid ""
"[CC Ship Package Sync Log] 还没有哦!点左上角的[创建]按钮,沙发归你了!"
msgstr ""
"[CC Ship Package Sync Log] Not yet! Click the Create button in the top left "
"corner and the sofa is yours!"
msgstr "[小包同步日志] 还没有!点击左上角的创建按钮,沙发就是你的了!"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_ao_tt_api
......@@ -401,11 +379,6 @@ msgstr ""
msgid "是否成功"
msgstr ""
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_cc_clearance_file
msgid "清关文件"
msgstr ""
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_ao_tt_api_log__source
msgid "类型"
......
......@@ -37,7 +37,7 @@ def get_utc_time(local_time=None):
# 继承cc.clearance.file对象,并重载action_upload方法
class CcClearanceFile(models.Model):
_inherit = "cc.clearance.file"
_description = "Clearance File"#清关文件
_description = "Clearance File" # 清关文件
def get_clearance_file_feedback_data(self):
"""通关文件上传数据组织"""
......@@ -130,6 +130,17 @@ class CcShipPackage(models.Model):
# 增加同步日志纪录字段
sync_log_ids = fields.One2many('cc.ship.package.sync.log', 'package_id', 'Sync Logs')
def is_next_code(self, next_state_id):
"""
判断更新的节点是否是 小包状态的下级节点
:param next_state_id:
:return:
"""
if self.state:
if next_state_id in self.state.next_code_ids.ids:
return True
return False
@api.model
def create(self, vals_list):
"""
......
......@@ -96,6 +96,18 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
_('The tracking number [%s] needs to be filled in the exclusion tracking number!') % '\n'.join(
[package.tracking_no for package in package_obj]))
else:
# 追踪号类型的时候 如果不跳过检查的话,判断更新节点是否是 小包的状态的下一节点
parcels = self.get_process_package()
if parcels:
error_package_arr = []
for package_item in parcels:
result = package_item.is_next_code(self.update_status.id)
if not result:
error_package_arr.append(package_item.tracking_no)
if len(error_package_arr) > 0:
raise ValidationError(
_('[%s] The update node is not the next node in the state of the packet!') % ','.join(
error_package_arr)) # 更新节点不是小包的状态的下一节点!
if len(self.ship_package_ids) > 0:
# 检查小包%s是否存在还未推送或 小包已经推送过将更变更的状态
raise ValidationError(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论