提交 3438083d authored 作者: 贺阳's avatar 贺阳

提单的清关文件 上传改为同步,不默认时间

上级 da12e248
......@@ -693,7 +693,7 @@ msgstr "申报类型"
#: model:ir.model.fields,field_description:ccs_base.field_cc_node__desc
#: model:ir.model.fields,field_description:ccs_base.field_cc_node_exception_reason__desc
msgid "Description"
msgstr "节点描述"
msgstr "描述"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_batch_input_ship_package_status_wizard__display_name
......@@ -1079,8 +1079,8 @@ msgstr "是卡车转运"
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_clearance_file_view
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_clearance_file_view
#: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_clearance_file_view
msgid "Is Upload"
msgstr "是否已上传"
msgid "Is Sync"
msgstr "是否已同步"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_package_good__item_id
......@@ -1234,7 +1234,7 @@ msgstr "否"
#: model:ir.model.fields,field_description:ccs_base.field_cc_node__name
#: model:ir.model.fields,field_description:ccs_base.field_cc_node_exception_reason__name
msgid "Name"
msgstr "节点名称"
msgstr "名称"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_package_good__item_name_cn
......@@ -2208,13 +2208,13 @@ msgstr "更新小包状态"
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_clearance_file_view
#: model_terms:ir.ui.view,arch_db:ccs_base.search_cc_clearance_file_view
#: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_clearance_file_view
msgid "Upload Time"
msgstr "上传时间"
msgid "Sync Time"
msgstr "同步时间"
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.form_cc_clearance_file_view
msgid "Uploaded"
msgstr "已上传"
msgid "Unsync"
msgstr "未同步"
#. module: ccs_base
#: model:ir.model.fields,field_description:ccs_base.field_cc_ship_package__user_track_note
......
......@@ -417,6 +417,15 @@ class CcClearanceFile(models.Model):
_rec_name = 'file_name'
_order = 'upload_time desc'
# @api.onchange('file')
# def change_file(self):
# """
# 上传时间为
# """
# for item in self:
# if item.file:
# item.upload_time = fields.Datetime.now()
# 定义模型字段
# 所属提单
bl_id = fields.Many2one('cc.bl', string='Bill of Loading')
......@@ -425,10 +434,10 @@ class CcClearanceFile(models.Model):
# 文件名
file_name = fields.Char(string='File Name')
# 是否上传
is_upload = fields.Boolean(string='Is Upload', default=False)
# 上传时间
upload_time = fields.Datetime(string='Upload Time', default=fields.Datetime.now)
# 是否同步
is_upload = fields.Boolean(string='Is Sync', default=False)
# 同步时间
upload_time = fields.Datetime(string='Sync Time')
def create_clearance_file_func(self, file_name_arr, bl_id=False, **kwargs):
"""
......
......@@ -12,8 +12,8 @@
<field name="bl_id" string="Bill of Loading" invisible="1"/>
<field name="file_name" string="File Name" required="1"/>
<field name="file" string="PDF File" required="1"/>
<field name="is_upload" string="Is Upload" readonly="1"/>
<field name="upload_time" string="Upload Time"/>
<field name="is_upload" readonly="1"/>
<field name="upload_time"/>
<button name="action_sync" string="SyncTo.." type="object" icon="fa-upload"/>
</tree>
</field>
......@@ -27,14 +27,14 @@
<header>
</header>
<sheet>
<widget name="web_ribbon" title="Uploaded" attrs="{'invisible': [('is_upload', '=', False)]}"/>
<widget name="web_ribbon" title="Unsync" attrs="{'invisible': [('is_upload', '=', False)]}"/>
<group>
<group>
<field name="bl_id" string="Bill of Loading"/>
<field name="file" string="File"/>
<field name="file_name" string="File Name"/>
<field name="is_upload" string="Is Upload"/>
<field name="upload_time" string="Upload Time"/>
<field name="is_upload"/>
<field name="upload_time"/>
</group>
<group>
......@@ -55,11 +55,11 @@
<field name="file_name" string="File Name"/>
<field name="bl_id" string="Bill of Loading"/>
<field name="file" string="File"/>
<field name="is_upload" string="Is Upload"/>
<field name="upload_time" string="Upload Time"/>
<field name="is_upload"/>
<field name="upload_time"/>
<separator/>
<filter name="filter_is_upload" string="Is Upload" domain="[('is_upload','=','')]"/>
<filter name="filter_upload_time" string="Upload Time" date="upload_time"/>
<filter name="filter_is_upload" string="Is Sync" domain="[('is_upload','=','')]"/>
<filter name="filter_upload_time" string="Sync Time" date="upload_time"/>
<separator/>
<group expand="0" string="Group By">
<filter domain="[]" name="groupby_bl_id" string="Bill of Loading" context="{'group_by': 'bl_id'}"/>
......
......@@ -2,8 +2,6 @@
import math
import re
import pandas as pd
from odoo import http, fields, exceptions
from odoo.http import request
import logging
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论