提交 18e31d9e authored 作者: 贺阳's avatar 贺阳

提单增加推送备注的显示

上级 412ebd58
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-30 06:19+0000\n"
"PO-Revision-Date: 2025-10-30 14:20+0800\n"
"POT-Creation-Date: 2025-10-31 02:13+0000\n"
"PO-Revision-Date: 2025-10-31 10:14+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
......@@ -3342,6 +3342,11 @@ msgstr "显示错误消息"
msgid "Show error message"
msgstr "显示错误消息"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_batch_get_pod_info_wizard__skip_ocr_direct_ai
msgid "Skip OCR Direct AI"
msgstr "跳过 OCR 直接 AI"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_bl_view
msgid "Start Port"
......@@ -3959,6 +3964,11 @@ msgstr "是否分大包导出"
msgid "Whether to remove specified text from PDF files"
msgstr "是否涂抹PDF中的指定文字"
#. module: ccs_base
#: model:ir.model.fields,help:ccs_base.field_batch_get_pod_info_wizard__skip_ocr_direct_ai
msgid "Whether to skip OCR processing and directly use AI processing (for testing AI)"
msgstr ""
#. module: ccs_base
#: model:ir.model.fields,help:ccs_base.field_batch_get_pod_info_wizard__sync_match_node
msgid "Whether to sync and push matched node information"
......
......@@ -94,7 +94,7 @@ class BatchGetPodInfoWizard(models.TransientModel):
# 如果启用了涂抹文字,进行处理
if self.remove_specified_text and processed_files:
# processed_files = self._remove_specified_text(processed_files, debug_mode=False)
processed_files = self._remove_specified_text(processed_files, debug_mode=False)
# 合并PDF并保存到pdf_file字段
self._merge_pdf_files(processed_files)
......
......@@ -31,14 +31,15 @@
<strong>Description:</strong> <!-- 说明: -->
<ul>
<li attrs="{'invisible': [('pdf_file', '!=', False)]}">
<strong>Remove Specified Text:</strong>
Remove specified text (AGN, UCLINK LOGISITICS LTD) from PDF files
</li> <!-- 涂抹指定文字:对PDF文件中的指定文字进行涂抹处理 -->
<li attrs="{'invisible': ['|',('pdf_file', '=', False),('show_error_message', '!=', False)]}">
<strong>Sync Last Mile POD:</strong>
Synchronize POD (Proof of Delivery) attachment information with TK system, including
big package quantities and container numbers
</li> <!-- 同步尾程POD:向TK同步尾程交接POD(待大包数量和箱号)的附件信息 -->
<li attrs="{'invisible': ['|',('pdf_file', '=', False),('show_error_message', '!=', False)]}">
<strong>Remove Specified Text:</strong>
Remove specified text (AGN, UCLINK LOGISITICS LTD) from PDF files
</li> <!-- 涂抹指定文字:对PDF文件中的指定文字进行涂抹处理 -->
<li attrs="{'invisible': ['|',('pdf_file', '=', False),('show_error_message', '!=', False)]}">
<strong>Sync Push Match Node:</strong>
Synchronize and push matched node information based on POD file, extract time from
......
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-23 09:31+0000\n"
"PO-Revision-Date: 2025-09-23 17:35+0800\n"
"POT-Creation-Date: 2025-10-31 02:15+0000\n"
"PO-Revision-Date: 2025-10-31 10:16+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
......@@ -54,6 +54,11 @@ msgstr ""
msgid "Attachment"
msgstr "附件"
#. module: ccs_connect_tiktok
#: model:ir.model,name:ccs_connect_tiktok.model_batch_get_pod_info_wizard
msgid "Batch Get POD Info Wizard"
msgstr "批量获取尾程POD向导"
#. module: ccs_connect_tiktok
#: model:ir.actions.server,name:ccs_connect_tiktok.action_batch_sync_bl_status
msgid "Batch Sync Bill Of Loading Status"
......@@ -396,14 +401,6 @@ msgstr "托盘"
msgid "Pallet Handover"
msgstr "托盘交货"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: model:ir.model.fields.selection,name:ccs_connect_tiktok.selection__pda_scan_record__operation__pallet_pickup
#, python-format
msgid "Pallet Pickup"
msgstr "托盘提货"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
......@@ -442,6 +439,11 @@ msgstr "进度"
msgid "Progress Name"
msgstr "进度名称"
#. module: ccs_connect_tiktok
#: model_terms:ir.ui.view,arch_db:ccs_connect_tiktok.search_cc_bl_view
msgid "Push Failed"
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
......@@ -451,6 +453,11 @@ msgstr "进度名称"
msgid "Ship Package"
msgstr "小包"
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_cc_bl__push_remark
msgid "Ship Package Push Remark"
msgstr "小包推送备注"
#. module: ccs_connect_tiktok
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_batch_input_ship_package_status_wizard__is_skip_check
#: model:ir.model.fields,field_description:ccs_connect_tiktok.field_update_bl_status_wizard__is_skip_check
......@@ -565,14 +572,6 @@ msgstr "进度编码"
msgid "Tail Handover"
msgstr "按尾程交货"
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
#: model:ir.model.fields.selection,name:ccs_connect_tiktok.selection__pda_scan_record__operation__tail_pickup
#, python-format
msgid "Tail Pickup"
msgstr ""
#. module: ccs_connect_tiktok
#. odoo-python
#: code:addons/ccs_connect_tiktok/models/pda_scan_record.py:0
......
......@@ -351,7 +351,7 @@ class CcBl(models.Model):
bl_sync_log_ids = fields.One2many('cc.bl.sync.log', 'bl_id', string='Bill Of Loading Sync Logs')
# 增加提单状态操作时间:取最新一条提单节点同步信息的操作时间
process_time = fields.Datetime(string='Process Time', compute='_compute_process_time', store=True)
push_remark = fields.Text('Push Remark')
push_remark = fields.Text('Ship Package Push Remark', default='')
def change_state_by_ship_package(self):
"""
......@@ -1272,18 +1272,17 @@ class CcBl(models.Model):
if package.get('tally_time'):
for single_id in package['id']:
ship_packages_dict[single_id] = package['tally_time']
if action_type == 'push_match_node' and pod_node_id:
#尾程匹配的节点包括前序节点
# 尾程匹配的节点包括前序节点
node_obj = self.env['cc.node'].sudo().search([('id', '=', pod_node_id)])
else:
tally_state = 'checked_goods' if action_type == 'tally' else (
'picked_up' if action_type == 'pickup' else 'handover_completed')
'picked_up' if action_type == 'pickup' else 'handover_completed')
# 检查理货或尾程交接的节点,根据排序进行升序
node_obj = self.env['cc.node'].sudo().search([
('node_type', '=', 'package'),
('tally_state', '=', tally_state)
('tally_state', '=', tally_state)
], order='seq asc')
if not node_obj:
return True
......@@ -1303,9 +1302,11 @@ class CcBl(models.Model):
package_id, set()):
tally_time = ship_packages_dict.get(package_id)
if tally_time:
tally_time=datetime.strptime(tally_time, '%Y-%m-%d %H:%M:%S')
operation_time =tally_time if pod_node_id and pod_node_id==before_node.id else ((
tally_time - timedelta(minutes=before_minutes)) if tally_time else fields.Datetime.now() - timedelta(minutes=before_minutes))
tally_time = datetime.strptime(tally_time, '%Y-%m-%d %H:%M:%S')
operation_time = tally_time if pod_node_id and pod_node_id == before_node.id else ((
tally_time - timedelta(
minutes=before_minutes)) if tally_time else fields.Datetime.now() - timedelta(
minutes=before_minutes))
update_data.append((
package_id,
before_node.id,
......@@ -1336,7 +1337,7 @@ class CcBl(models.Model):
item.try_callback_track(max_retries=2, ship_package_ids=ship_package_ids,
user_obj=user_obj)
# 理货或尾程交接的节点
#pda需要生成后续节点
# pda需要生成后续节点
if action_type != 'push_match_node':
# 预先获取所有状态节点
all_state_nodes = self.env['cc.node'].sudo().search([
......@@ -1352,7 +1353,9 @@ class CcBl(models.Model):
if current_state_node.seq < node.seq:
tally_time = ship_packages_dict.get(package.id)
if tally_time:
operation_time =(datetime.strptime(tally_time, '%Y-%m-%d %H:%M:%S') + timedelta(minutes=next_minutes * index)) if tally_time else fields.Datetime.now() + timedelta(
operation_time = (
datetime.strptime(tally_time, '%Y-%m-%d %H:%M:%S') + timedelta(
minutes=next_minutes * index)) if tally_time else fields.Datetime.now() + timedelta(
minutes=next_minutes * index)
update_data.append((
package.id,
......
......@@ -60,11 +60,28 @@
<field name="is_bl_sync" string="Is Sync" readonly="1"/>
<field name="state_explain" string="State Explain"/>
</group>
<group attrs="{'invisible': [('push_remark', '=', '')]}" >
<field name="push_remark" readonly="1"/>
</group>
</page>
</notebook>
</field>
</record>
<record model="ir.ui.view" id="search_cc_bl_view">
<field name="name">search.cc.bl</field>
<field name="model">cc.bl</field>
<field name="inherit_id" ref="ccs_base.search_cc_bl_view"/>
<field name="arch" type="xml">
<filter name="filter_state_not_finished" position="after">
<separator/>
<filter string="Push Failed" name="filter_push_failed" domain="[('push_remark', '!=', '')]"/>
</filter>
</field>
</record>
<record id="action_batch_sync_package_status" model="ir.actions.server">
<field name="name">Batch Sync Package Status</field>
<field name="model_id" ref="model_cc_bl"/>
......
......@@ -186,11 +186,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
# 构建备注信息
remark = f"获取尾程POD,自动推送节点失败,有风险产生倒挂。失败小包数量: {failed_count},请手动操作{extract_time.strftime('%Y-%m-%d %H:%M:%S')}(获取时间)"
# 更新提单的推送备注字段
if hasattr(bl, 'push_remark'):
# 如果已有备注,追加新备注
existing_remark = bl.push_remark or ""
new_remark = f"{existing_remark}\n{remark}" if existing_remark else remark
bl.write({'push_remark': new_remark})
# if hasattr(bl, 'push_remark'):
# # 如果已有备注,追加新备注
# existing_remark = bl.push_remark or ""
# new_remark = f"{existing_remark}\n{remark}" if existing_remark else remark
bl.write({'push_remark': remark})
except Exception as e:
_logger.error(f"为提单 {bl.bl_no} 添加推送备注失败: {str(e)}")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论