提交 9c8a2abd authored 作者: 贺阳's avatar 贺阳

更新包裹进度:选择推送时间,与当前时间做对比,当前时间-选择推送时间大于24小时,则在下方出现红色字体提示;

所选操作时间超过24小时,请再次确认操作时间 仅做提示;
上级 d1c160b0
...@@ -40,5 +40,9 @@ ...@@ -40,5 +40,9 @@
<field name="value">mjgUUgbxXK8UHcRi5MTlPrb4BWM8NrOu</field> <field name="value">mjgUUgbxXK8UHcRi5MTlPrb4BWM8NrOu</field>
</record> </record>
<record id="time_warning_hours" model="ir.config_parameter">
<field name="key">time_warning_hours</field>
<field name="value">24</field>
</record>
</data> </data>
</odoo> </odoo>
\ No newline at end of file
...@@ -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-10-11 07:55+0000\n" "POT-Creation-Date: 2025-10-17 04:50+0000\n"
"PO-Revision-Date: 2025-10-11 15:59+0800\n" "PO-Revision-Date: 2025-10-17 12:51+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"
...@@ -3414,13 +3414,6 @@ msgstr "物流订单号必须唯一。" ...@@ -3414,13 +3414,6 @@ msgstr "物流订单号必须唯一。"
msgid "The Transfer B/L No. must be unique." msgid "The Transfer B/L No. must be unique."
msgstr "转单号必填" msgstr "转单号必填"
#. module: ccs_base
#. odoo-python
#: code:addons/ccs_base/models/cc_bill_loading.py:0
#, python-format
msgid "The bill of loading is completed, but the node exception reason is %s!"
msgstr "提单已完成,但是节点异常,原因是:%s!"
#. 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
...@@ -3465,6 +3458,15 @@ msgstr "节点 [%s] 序号小于现有节点序号。" ...@@ -3465,6 +3458,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/wizard/batch_input_ship_package_statu_wizard.py:0
#, python-format
msgid ""
"The selected operation time exceeds %s hours, please confirm the operation "
"time again"
msgstr "所选操作时间超过 %s 小时,请重新确认操作时间"
#. 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
...@@ -3505,6 +3507,11 @@ msgstr "本周提单" ...@@ -3505,6 +3507,11 @@ msgstr "本周提单"
msgid "This week ship package" msgid "This week ship package"
msgstr "本周小包" msgstr "本周小包"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_batch_input_ship_package_status_wizard__time_warning
msgid "Time Warning"
msgstr ""
#. module: ccs_base #. 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_bl_view
msgid "Today Deadline" msgid "Today Deadline"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# 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 datetime import datetime
from odoo import models, api, fields, _ from odoo import models, api, fields, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
...@@ -83,6 +83,23 @@ class BatchInputShipPackageStatusWizard(models.TransientModel): ...@@ -83,6 +83,23 @@ 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)]")
# 添加时间对比提示字段
time_warning = fields.Text('Time Warning', compute='_compute_time_warning', store=False)
@api.depends('process_time')
def _compute_time_warning(self):
"""计算时间警告提示"""
for record in self:
record.time_warning = ""
if record.process_time:
now = datetime.now()
time_diff = now - record.process_time
hours_diff = time_diff.total_seconds() / 3600
time_warning_hours = self.env['ir.config_parameter'].sudo().get_param('time_warning_hours',24)
if hours_diff > int(time_warning_hours):
record.time_warning = _("The selected operation time exceeds %s hours, please confirm the operation time again") % time_warning_hours#提示:所选操作时间超过24小时,请再次确认操作时间
# 批量更新小包状态 # 批量更新小包状态
def submit(self): def submit(self):
......
...@@ -40,10 +40,16 @@ ...@@ -40,10 +40,16 @@
<!-- domain="[('id','in',next_code_ids),('node_type','=','package')]"--> <!-- domain="[('id','in',next_code_ids),('node_type','=','package')]"-->
<field name="update_status" required="1" options="{'no_create':True,'no_open':True,}"/> <field name="update_status" required="1" options="{'no_create':True,'no_open':True,}"/>
<field name="process_time" required="1" string="Process Time"/> <field name="process_time" required="1" string="Process Time"/>
<field name="node_exception_reason_id" options="{'no_create':True}"/> <field name="node_exception_reason_id" options="{'no_create':True}"/>
<field name="state_explain"/> <field name="state_explain"/>
<field name="is_batch" invisible="1"/> <field name="is_batch" invisible="1"/>
</group> </group>
<!-- <group> -->
<div attrs="{'invisible': [('time_warning', '=', False),('time_warning', '=', '')]}" style="color: red; font-weight: bold;">
<field name="time_warning"/>
</div>
<!-- </group> -->
<group> <group>
<field name="is_ok"/> <field name="is_ok"/>
</group> </group>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论