提交 4b5d5ed8 authored 作者: 贺阳's avatar 贺阳

小包节点或提单节点不在已完成节点,提单不能变为已完成!

上级 71df1437
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-18 08:29+0000\n"
"PO-Revision-Date: 2025-09-18 16:30+0800\n"
"POT-Creation-Date: 2025-09-22 01:56+0000\n"
"PO-Revision-Date: 2025-09-22 09:57+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
......@@ -3396,6 +3396,15 @@ msgstr "节点 [%s] 序号小于现有节点序号。"
msgid "The pallet number can only be entered as a number!"
msgstr "托盘号只能输入数字!"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#, python-format
msgid ""
"The small package node or bill of lading node is not in the completed node, "
"and the bill of lading cannot be changed to completed!"
msgstr "小包节点或提单节点不在已完成节点,提单不能变为已完成!"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0
......
......@@ -814,8 +814,19 @@ class CcBL(models.Model):
"""点完成按钮,状态变为已完成"""
for item in self:
if item.state != 'ccing':
raise ValidationError(_('Only the status of the bill of loading is ccing can be completed!'))#只有清关中状态的提单可以完成
item.done_func()
raise ValidationError(
_('Only the status of the bill of loading is ccing can be completed!')) # 只有清关中状态的提单可以完成
item.check_is_done()
def check_is_done(self, is_email=False):
# 如果提单所有小包的清关节点变成"是完成节点",则该提单状态变成已完成.tk模块有继承
if all(line.state.is_done for line in
self.ship_package_ids) and self.customs_clearance_status.is_done and self.is_bl_sync:
self.done_func(is_email)
else:
if not is_email:
raise ValidationError(
_('The small package node or bill of lading node is not in the completed node, and the bill of lading cannot be changed to completed!')) # 小包节点或提单节点不在已完成节点,提单不能变为已完成!
def done_func(self, is_email=False):
"""
......@@ -829,7 +840,7 @@ class CcBL(models.Model):
"""追回操作,将状态从已完成改为清关中"""
for record in self:
if record.state != 'done':
raise ValidationError(_('Only completed bills of loading can be recalled!'))#只有已完成状态的提单可以追回
raise ValidationError(_('Only completed bills of loading can be recalled!')) # 只有已完成状态的提单可以追回
record.state = 'ccing'
# 定义3个方法,分别创建显示该提单大包,包裹,商品的action
......
......@@ -6,11 +6,11 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-15 08:45+0000\n"
"PO-Revision-Date: 2025-09-15 16:46+0800\n"
"POT-Creation-Date: 2025-09-22 01:59+0000\n"
"PO-Revision-Date: 2025-09-22 10:00+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -568,6 +568,15 @@ msgid ""
"less than the latest operation time!"
msgstr "操作时间不能大于当前时间,也不能小于最近的操作时间!"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/cc_bill_loading.py:0
#, python-format
msgid ""
"The small package node or bill of lading node is not in the completed node, "
"and the bill of lading cannot be changed to completed!"
msgstr "小包节点或提单节点不在已完成节点,提单不能变为已完成!"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py:0
......
......@@ -362,9 +362,10 @@ class CcBl(models.Model):
lambda line: not line.state.is_default): # == 'cb_imcustoms_start'
self.ccing_func()
# 如果提单所有小包的清关节点变成"是完成节点",则该提单状态变成已完成
if all(line.state.is_done for line in
self.ship_package_ids) and self.unsync_package_count <= 0 and self.customs_clearance_status.is_done and self.is_bl_sync:
self.done_func(is_email=True)
self.check_is_done(is_email=True)
# if all(line.state.is_done for line in
# self.ship_package_ids) and self.unsync_package_count <= 0 and self.customs_clearance_status.is_done and self.is_bl_sync:
# self.done_func(is_email=True)
def change_customs_state_by_ship_package(self, package_state_obj, user_obj=False):
"""
......@@ -446,6 +447,16 @@ class CcBl(models.Model):
result = self.env.cr.fetchone()
return result and result[0] or False
def check_is_done(self, is_email=False):
# 如果提单所有小包的清关节点变成"是完成节点",则该提单状态变成已完成
if all(line.state.is_done for line in
self.ship_package_ids) and self.unsync_package_count <= 0 and self.customs_clearance_status.is_done and self.is_bl_sync:
self.done_func(is_email)
else:
if not is_email:
raise ValidationError(
_('The small package node or bill of lading node is not in the completed node, and the bill of lading cannot be changed to completed!')) # 小包节点或提单节点不在已完成节点,提单不能变为已完成!
def done_func(self, is_email=False):
"""
变为已完成.先进行提单巡查,再进行提单状态变更
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论