提交 95ecae18 authored 作者: 伍姿英's avatar 伍姿英

Merge branch 'release/3.2.1'

...@@ -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-07-15 02:39+0000\n" "POT-Creation-Date: 2025-09-22 01:56+0000\n"
"PO-Revision-Date: 2025-07-15 10:45+0800\n" "PO-Revision-Date: 2025-09-22 09:57+0800\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: zh_CN\n" "Language: zh_CN\n"
...@@ -531,6 +531,11 @@ msgstr "批量" ...@@ -531,6 +531,11 @@ msgstr "批量"
msgid "Batch Add Package Exception Information" msgid "Batch Add Package Exception Information"
msgstr "批量添加异常信息" msgstr "批量添加异常信息"
#. module: ccs_base
#: model:ir.actions.server,name:ccs_base.bl_complete_server_action
msgid "Batch Complete"
msgstr "批量完成"
#. module: ccs_base #. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.view_batch_update_transfer_bl_no_wizard #: model_terms:ir.ui.view,arch_db:ccs_base.view_batch_update_transfer_bl_no_wizard
msgid "Batch Link Transfer B/L No" msgid "Batch Link Transfer B/L No"
...@@ -586,15 +591,6 @@ msgstr "大包" ...@@ -586,15 +591,6 @@ msgstr "大包"
msgid "Big Package No" msgid "Big Package No"
msgstr "大包号" msgstr "大包号"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0
#, python-format
msgid ""
"Big Package No :%s ,The same bill of lading, same pallet number, and usage "
"date must be consistent!"
msgstr "大包号:%s ,同一提单、同一托盘号的使用日期必须一致!"
#. module: ccs_base #. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__big_package_no #: model:ir.model.fields,field_description:ccs_base.field_cc_big_package__big_package_no
#: model:ir.model.fields,field_description:ccs_base.field_cc_history_big_package__big_package_no #: model:ir.model.fields,field_description:ccs_base.field_cc_history_big_package__big_package_no
...@@ -959,6 +955,11 @@ msgstr "公司" ...@@ -959,6 +955,11 @@ msgstr "公司"
msgid "Company Code" msgid "Company Code"
msgstr "公司编码" msgstr "公司编码"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
msgid "Complete"
msgstr "完成"
#. module: ccs_base #. module: ccs_base
#: model:ir.model,name:ccs_base.model_res_config_settings #: model:ir.model,name:ccs_base.model_res_config_settings
msgid "Config Settings" msgid "Config Settings"
...@@ -2385,6 +2386,13 @@ msgstr "" ...@@ -2385,6 +2386,13 @@ msgstr ""
msgid "ONLINE SELLING PLACE" msgid "ONLINE SELLING PLACE"
msgstr "网上销售网站" msgstr "网上销售网站"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#, python-format
msgid "Only completed bills of loading can be recalled!"
msgstr "只有已完成状态的提单可以追回!"
#. module: ccs_base #. module: ccs_base
#. odoo-python #. odoo-python
#: code:addons/ccs_base/wizard/batch_update_transfer_bl_no_wizard.py:0 #: code:addons/ccs_base/wizard/batch_update_transfer_bl_no_wizard.py:0
...@@ -2392,6 +2400,13 @@ msgstr "网上销售网站" ...@@ -2392,6 +2400,13 @@ msgstr "网上销售网站"
msgid "Only excel files can be uploaded!" msgid "Only excel files can be uploaded!"
msgstr "只能上传excel文件!" msgstr "只能上传excel文件!"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#, python-format
msgid "Only the status of the bill of loading is ccing can be completed!"
msgstr "只有清关中状态的提单可以完成!"
#. module: ccs_base #. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_history_package_sync_log__operate_remark #: model:ir.model.fields,field_description:ccs_base.field_cc_history_package_sync_log__operate_remark
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_history_package_sync_log_view #: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_history_package_sync_log_view
...@@ -2692,6 +2707,11 @@ msgstr "收件人邮政编码" ...@@ -2692,6 +2707,11 @@ msgstr "收件人邮政编码"
msgid "Real Weight" msgid "Real Weight"
msgstr "实际重量" msgstr "实际重量"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
msgid "Recall"
msgstr "追回"
#. module: ccs_base #. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_bl_view #: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_bl_view
msgid "Receive Big Package" msgid "Receive Big Package"
...@@ -3376,6 +3396,15 @@ msgstr "节点 [%s] 序号小于现有节点序号。" ...@@ -3376,6 +3396,15 @@ msgstr "节点 [%s] 序号小于现有节点序号。"
msgid "The pallet number can only be entered as a number!" msgid "The pallet number can only be entered as a number!"
msgstr "托盘号只能输入数字!" 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 #. module: ccs_base
#. odoo-python #. odoo-python
#: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0 #: code:addons/ccs_base/wizard/associate_pallet_wizard.py:0
...@@ -3390,13 +3419,6 @@ msgstr "使用日期不能大于当前日期!" ...@@ -3390,13 +3419,6 @@ msgstr "使用日期不能大于当前日期!"
msgid "This B/L No does not exist in the system" msgid "This B/L No does not exist in the system"
msgstr "提单号在系统不存在" msgstr "提单号在系统不存在"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/wizard/batch_update_transfer_bl_no_wizard.py:0
#, python-format
msgid "This Transfer B/L No already exists"
msgstr "转单号已存在"
#. module: ccs_base #. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_big_package_view #: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_big_package_view
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_history_big_package_view #: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_history_big_package_view
...@@ -3518,6 +3540,7 @@ msgstr "转单号必填" ...@@ -3518,6 +3540,7 @@ msgstr "转单号必填"
#. module: ccs_base #. module: ccs_base
#. odoo-python #. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0 #: code:addons/ccs_base/models/cc_bill_loading.py:0
#: code:addons/ccs_base/wizard/batch_update_transfer_bl_no_wizard.py:0
#, python-format #, python-format
msgid "Transfer B/L No. cannot be the same as B/L No." msgid "Transfer B/L No. cannot be the same as B/L No."
msgstr "转单号不能与提单号相同。" msgstr "转单号不能与提单号相同。"
...@@ -3525,6 +3548,7 @@ msgstr "转单号不能与提单号相同。" ...@@ -3525,6 +3548,7 @@ msgstr "转单号不能与提单号相同。"
#. module: ccs_base #. module: ccs_base
#. odoo-python #. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0 #: code:addons/ccs_base/models/cc_bill_loading.py:0
#: code:addons/ccs_base/wizard/batch_update_transfer_bl_no_wizard.py:0
#, python-format #, python-format
msgid "Transfer B/L No. cannot be the same as B/L No. or Transfer B/L No." msgid "Transfer B/L No. cannot be the same as B/L No. or Transfer B/L No."
msgstr "转单号不能与提单号或转单号相同。" msgstr "转单号不能与提单号或转单号相同。"
......
...@@ -810,7 +810,25 @@ class CcBL(models.Model): ...@@ -810,7 +810,25 @@ class CcBL(models.Model):
if item.state == 'draft': if item.state == 'draft':
item.state = 'ccing' item.state = 'ccing'
def done_func(self): def complete_func(self):
"""点完成按钮,状态变为已完成"""
for item in self:
if item.state != 'ccing':
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):
""" """
变为已完成 变为已完成
""" """
...@@ -818,6 +836,13 @@ class CcBL(models.Model): ...@@ -818,6 +836,13 @@ class CcBL(models.Model):
if item.state == 'ccing': if item.state == 'ccing':
item.state = 'done' item.state = 'done'
def action_recall(self):
"""追回操作,将状态从已完成改为清关中"""
for record in self:
if record.state != 'done':
raise ValidationError(_('Only completed bills of loading can be recalled!')) # 只有已完成状态的提单可以追回
record.state = 'ccing'
# 定义3个方法,分别创建显示该提单大包,包裹,商品的action # 定义3个方法,分别创建显示该提单大包,包裹,商品的action
# 创建显示大包的action # 创建显示大包的action
def action_show_big_package(self): def action_show_big_package(self):
......
...@@ -59,7 +59,19 @@ ...@@ -59,7 +59,19 @@
string="Update Bill Of Loading Status" string="Update Bill Of Loading Status"
context="{'active_id': id,'default_bl_id': active_id, context="{'active_id': id,'default_bl_id': active_id,
'default_last_process_time':process_time,'default_current_status':customs_clearance_status}"/> 'default_last_process_time':process_time,'default_current_status':customs_clearance_status}"/>
<field name="state" widget="statusbar" options="{'clickable': '1'}"/>
<!-- 完成按钮 - 仅在清关中状态显示,仅清关员和清关经理可操作 -->
<button name="complete_func" type="object" class="oe_highlight"
string="Complete" attrs="{'invisible': [('state', '!=', 'ccing')]}"
groups="ccs_base.group_clearance_of_customs_user,ccs_base.group_clearance_of_customs_manager"/>
<!-- 追回按钮 - 仅在已完成状态显示,仅清关员和清关经理可操作 -->
<button name="action_recall" type="object" string="Recall" attrs="{'invisible': [('state', '!=', 'done')]}"
groups="ccs_base.group_clearance_of_customs_user,ccs_base.group_clearance_of_customs_manager"/>
<field name="state" widget="statusbar"/>
<!-- options="{'clickable': '1'}" -->
</header> </header>
<header> <header>
<field name="customs_clearance_status" widget="statusbar"/> <field name="customs_clearance_status" widget="statusbar"/>
...@@ -432,4 +444,18 @@ ...@@ -432,4 +444,18 @@
</field> </field>
</record> </record>
<record id="bl_complete_server_action" model="ir.actions.server">
<field name="name">Batch Complete</field>
<field name="model_id" ref="model_cc_bl"/>
<field name="binding_model_id" ref="model_cc_bl"/>
<field name="state">code</field>
<field name="binding_view_types">list</field>
<field name="groups_id" eval="[(4, ref('ccs_base.group_clearance_of_customs_user'))]"/>
<field name="code">
if records:
action = records.complete_func()
</field>
</record>
</odoo> </odoo>
\ No newline at end of file
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging import logging
from odoo import models, api, fields, _ from odoo import models, api, fields, _
from odoo.exceptions import Warning, ValidationError from odoo.exceptions import ValidationError
# 定义一个批量更新小包状态的向导, 用于批量更新小包状态 # 定义一个批量更新小包状态的向导, 用于批量更新小包状态
...@@ -82,6 +83,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel): ...@@ -82,6 +83,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
state_explain = fields.Text('State Explain', help='State Explain') state_explain = fields.Text('State Explain', help='State Explain')
node_exception_reason_id = fields.Many2one('cc.node.exception.reason', 'Exception Reason', node_exception_reason_id = fields.Many2one('cc.node.exception.reason', 'Exception Reason',
domain="[('code_id', '=', update_status)]") domain="[('code_id', '=', update_status)]")
# 批量更新小包状态 # 批量更新小包状态
def submit(self): def submit(self):
# 确认数据 # 确认数据
...@@ -89,7 +91,8 @@ class BatchInputShipPackageStatusWizard(models.TransientModel): ...@@ -89,7 +91,8 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
raise ValidationError('Please confirm that the above data is correct.') # 请确认以上数据正确 raise ValidationError('Please confirm that the above data is correct.') # 请确认以上数据正确
parcels = self.get_process_package() parcels = self.get_process_package()
logging.info(
'更新小包状态的小包:%s,当前状态:%s,更新状态:%s' % (parcels, self.current_status, self.update_status))
if not parcels: if not parcels:
raise ValidationError(_('No package to update found.')) # 没有找到要更新的小包 raise ValidationError(_('No package to update found.')) # 没有找到要更新的小包
# 1.若选择的更新节点为是当前节点【清关节点设置,是当前节点字段名称改为初始节点】,当更新节点为初始节点时,无需填写操作时间; # 1.若选择的更新节点为是当前节点【清关节点设置,是当前节点字段名称改为初始节点】,当更新节点为初始节点时,无需填写操作时间;
...@@ -106,7 +109,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel): ...@@ -106,7 +109,7 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
# 更新状态 # 更新状态
parcels.write( parcels.write(
{'state': self.update_status.id, 'node_exception_reason_id': self.node_exception_reason_id.id, {'state': self.update_status.id, 'node_exception_reason_id': self.node_exception_reason_id.id,
'process_time': self.process_time, 'state_explain': self.state_explain, 'is_sync': is_sync}) 'process_time': self.process_time, 'state_explain': self.state_explain, 'is_sync': is_sync})
# if parcels: # if parcels:
# where_sql = " where id={0}".format(parcels[0].id) if len( # where_sql = " where id={0}".format(parcels[0].id) if len(
# parcels) == 1 else " where id in {0}".format(tuple(parcels.ids)) # parcels) == 1 else " where id in {0}".format(tuple(parcels.ids))
...@@ -116,9 +119,9 @@ class BatchInputShipPackageStatusWizard(models.TransientModel): ...@@ -116,9 +119,9 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
# where_sql) # where_sql)
# update_sql = update_sql.replace("'False'", "null").replace("False", "null") # update_sql = update_sql.replace("'False'", "null").replace("False", "null")
# self._cr.execute(update_sql) # self._cr.execute(update_sql)
# parcels.write({'state': self.update_status.id}) # parcels.write({'state': self.update_status.id})
# for parcel in parcels: # for parcel in parcels:
# parcel.message_post(body='%s改为%s' % (self.current_status.name, self.update_status.name)) # parcel.message_post(body='%s改为%s' % (self.current_status.name, self.update_status.name))
# 生成sns日志 # 生成sns日志
# self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or '')) # self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or ''))
# 跳转显示本次更新状态的小包 更新小包状态 # 跳转显示本次更新状态的小包 更新小包状态
......
...@@ -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-15 08:45+0000\n" "POT-Creation-Date: 2025-09-22 01:59+0000\n"
"PO-Revision-Date: 2025-09-15 16:46+0800\n" "PO-Revision-Date: 2025-09-22 10:00+0800\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: zh\n" "Language: zh_CN\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"
...@@ -568,6 +568,15 @@ msgid "" ...@@ -568,6 +568,15 @@ msgid ""
"less than the latest operation time!" "less than the latest operation time!"
msgstr "操作时间不能大于当前时间,也不能小于最近的操作时间!" 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 #. module: ccs_connect_tiktok
#. odoo-python #. odoo-python
#: code:addons/ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py:0 #: code:addons/ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py:0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论