Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
847e9d52
提交
847e9d52
authored
8月 27, 2024
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加导出的向导
上级
37bf0f2d
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
105 行增加
和
22 行删除
+105
-22
__init__.py
ccs_base/controllers/__init__.py
+2
-0
export_bl_and_package_xlsx.py
ccs_base/controllers/export_bl_and_package_xlsx.py
+0
-0
ir.model.access.csv
ccs_base/security/ir.model.access.csv
+1
-0
cc_bl_view.xml
ccs_base/views/cc_bl_view.xml
+36
-21
__init__.py
ccs_base/wizard/__init__.py
+1
-1
export_bl_big_package_xlsx_wizard.py
ccs_base/wizard/export_bl_big_package_xlsx_wizard.py
+65
-0
没有找到文件。
ccs_base/controllers/__init__.py
0 → 100644
浏览文件 @
847e9d52
from
.
import
export_bl_and_package_xlsx
ccs_base/controllers/export_bl_and_package_xlsx.py
0 → 100644
浏览文件 @
847e9d52
差异被折叠。
点击展开。
ccs_base/security/ir.model.access.csv
浏览文件 @
847e9d52
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
batch_input_ship_package_status_wizard_group_user,batch_input_ship_package_status_wizard_group_user,ccs_base.model_batch_input_ship_package_status_wizard,base.group_user,1,1,1,1
export_bl_big_package_xlsx_wizard_group_user,export_bl_big_package_xlsx_wizard_group_user,ccs_base.model_export_bl_big_package_xlsx_wizard,base.group_user,1,1,1,1
...
...
ccs_base/views/cc_bl_view.xml
浏览文件 @
847e9d52
...
...
@@ -24,8 +24,8 @@
<field
optional=
"show"
name=
"cc_company_id"
string=
"CC Company"
/>
<field
optional=
"show"
name=
"cc_country_id"
string=
"CC Country"
/>
<field
optional=
"show"
name=
"cc_deadline"
string=
"CC Deadline"
/>
<!-- <field optional="show" name="cc_progress_date" string="Current CC Progress Date"/>-->
<!-- <field optional="show" name="cc_progress" string="Current CC Progress"/>-->
<!-- <field optional="show" name="cc_progress_date" string="Current CC Progress Date"/>-->
<!-- <field optional="show" name="cc_progress" string="Current CC Progress"/>-->
<field
optional=
"show"
name=
"trade_type"
string=
"Trade Type"
/>
<field
optional=
"hide"
name=
"transport_tool_code"
string=
"Transport Tool Code"
/>
<field
optional=
"hide"
name=
"transport_tool_name"
string=
"Transport Tool Name"
/>
...
...
@@ -45,8 +45,9 @@
<field
name=
"arch"
type=
"xml"
>
<form
string=
"Bill of Loading"
>
<header>
<!-- # 为action_batch_input_ship_package_wizard添加一个按钮, 上下文中添加bl_id-->
<button
name=
"%(action_batch_input_ship_package_wizard)d"
type=
"action"
class=
"oe_highlight"
string=
"Update Ship Package Status"
context=
"{'default_bl_id': active_id}"
/>
<!-- # 为action_batch_input_ship_package_wizard添加一个按钮, 上下文中添加bl_id-->
<button
name=
"%(action_batch_input_ship_package_wizard)d"
type=
"action"
class=
"oe_highlight"
string=
"Update Ship Package Status"
context=
"{'default_bl_id': active_id}"
/>
<field
name=
"state"
widget=
"statusbar"
options=
"{'clickable': '1'}"
/>
</header>
...
...
@@ -75,7 +76,8 @@
</div>
</button>
</div>
<widget
name=
"web_ribbon"
bg_color=
"bg-warning"
title=
"Cancelled"
attrs=
"{'invisible': [('is_cancel', '=', False)]}"
/>
<widget
name=
"web_ribbon"
bg_color=
"bg-warning"
title=
"Cancelled"
attrs=
"{'invisible': [('is_cancel', '=', False)]}"
/>
<label
for=
"bl_no"
/>
<h1>
...
...
@@ -106,26 +108,28 @@
<field
name=
"bl_total_qty"
string=
"Receive Goods Qty"
/>
<field
name=
"bl_total_amount"
string=
"Total Amount"
/>
<separator/>
<field
name=
"cc_company_id"
string=
"CC Company"
requied=
"1"
domain=
"[('is_clearance_company', '=', True)]"
/>
<field
name=
"cc_company_id"
string=
"CC Company"
requied=
"1"
domain=
"[('is_clearance_company', '=', True)]"
/>
<field
name=
"cc_country_id"
string=
"CC Country"
requied=
"1"
/>
<field
name=
"cc_deadline"
string=
"CC Deadline"
/>
<!-- <field name="cc_progress_date" string="Current CC Progress Date"/>-->
<!-- <field name="cc_progress" string="Current CC Progress"/>-->
<!-- <field name="cc_progress_date" string="Current CC Progress Date"/>-->
<!-- <field name="cc_progress" string="Current CC Progress"/>-->
</group>
</group>
<notebook>
<!-- <page string="CC Progress">-->
<!-- <field name="cc_progress_ids" string="CC Progress"/>-->
<!-- </page>-->
<!-- <page string="Ship Packages">-->
<!-- <field name="ship_package_ids" string="Ship Packages"/>-->
<!-- </page>-->
<!-- <page string="Big Packages">-->
<!-- <field name="big_package_ids" string="Big Packages"/>-->
<!-- </page>-->
<!-- <page string="CC Progress">-->
<!-- <field name="cc_progress_ids" string="CC Progress"/>-->
<!-- </page>-->
<!-- <page string="Ship Packages">-->
<!-- <field name="ship_package_ids" string="Ship Packages"/>-->
<!-- </page>-->
<!-- <page string="Big Packages">-->
<!-- <field name="big_package_ids" string="Big Packages"/>-->
<!-- </page>-->
<page
string=
"Attachments"
>
<group>
<field
name=
"bl_attachment_ids"
string=
"B/L Attachments"
widget=
"many2many_binary"
readonly=
"1"
/>
<field
name=
"bl_attachment_ids"
string=
"B/L Attachments"
widget=
"many2many_binary"
readonly=
"1"
/>
<field
name=
"cc_attachment_ids"
string=
"CC Attachments"
/>
</group>
</page>
...
...
@@ -147,12 +151,13 @@
</field>
</record>
<!-- # 定义日历视图 calendar, 日期采用cc_deadline, 显示提单号、客户、CC公司、CC国家、CC进度、状态-->
<!-- # 定义日历视图 calendar, 日期采用cc_deadline, 显示提单号、客户、CC公司、CC国家、CC进度、状态-->
<record
model=
"ir.ui.view"
id=
"calendar_cc_bl_view"
>
<field
name=
"name"
>
calendar.cc.bl
</field>
<field
name=
"model"
>
cc.bl
</field>
<field
name=
"arch"
type=
"xml"
>
<calendar
string=
"Bill of Loading"
date_start=
"cc_deadline"
date_stop=
"cc_deadline"
color=
"state"
mode=
"month"
>
<calendar
string=
"Bill of Loading"
date_start=
"cc_deadline"
date_stop=
"cc_deadline"
color=
"state"
mode=
"month"
>
<field
name=
"bl_no"
/>
<field
name=
"customer_id"
/>
<field
name=
"cc_company_id"
/>
...
...
@@ -315,6 +320,15 @@
<!-- </record>-->
<!-- <menuitem sequence="10" name="Bill of Loading" id="menu_cc_bl" action="action_cc_bl" web_icon="ccs_base,static/description/icon3.png"/>-->
<record
id=
"export_order_big_package_xls_server"
model=
"ir.actions.server"
>
<field
name=
"name"
>
导出报关数据
</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=
"code"
>
if records:
action = records.export_order_big_package_xls_action()
</field>
</record>
</odoo>
\ No newline at end of file
ccs_base/wizard/__init__.py
浏览文件 @
847e9d52
# -*- coding: utf-8 -*-
from
.
import
batch_input_ship_package_statu_wizard
# from . import push_result
from
.
import
export_bl_big_package_xlsx_wizard
# from . import again_push_wizard
# from . import parcel_exception_wizard
# from . import big_bag_pickup_wizard
...
...
ccs_base/wizard/export_bl_big_package_xlsx_wizard.py
0 → 100644
浏览文件 @
847e9d52
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from
odoo
import
models
,
api
,
fields
from
odoo.exceptions
import
Warning
,
ValidationError
class
ExportBlBigPackageXlsxWizard
(
models
.
TransientModel
):
_name
=
'export.bl.big.package.xlsx.wizard'
_description
=
'导出报关文件'
# 增加选择类型字段, 按节点和按面单号(多条)
select_type
=
fields
.
Selection
([
(
'yes'
,
'YES'
),
(
'no'
,
'NO'
)
],
string
=
'Whether to export in Big packages'
)
# 批量更新小包状态
def
submit
(
self
):
# 确认数据
if
not
self
.
is_ok
:
raise
ValidationError
(
'请确认以上数据正确.'
)
parcels
=
self
.
get_process_package
()
if
not
parcels
:
raise
ValidationError
(
'没有找到要更新的小包.'
)
# 判断异常状态是否选择了异常原因
reason_obj
=
self
.
env
[
'cc.node.exception.reason'
]
.
search
([(
'code_id'
,
'='
,
self
.
update_status
.
id
)])
if
reason_obj
and
not
self
.
node_exception_reason_id
:
raise
ValidationError
(
'请选择异常原因!'
)
# 更新状态
parcels
.
write
(
{
'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'
:
False
})
# 生成sns日志
# self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or ''))
# 跳转显示本次更新状态的小包
return
{
'name'
:
'更新小包状态'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'cc.ship.package'
,
'view_mode'
:
'tree,form'
,
'domain'
:
[(
'id'
,
'in'
,
parcels
.
ids
)],
}
def
export_order_big_package_xls_action
(
self
):
error_order
=
[]
for
item
in
self
:
item
.
ship_package_ids
parcel_ids
=
item
.
big_package_ids
.
mapped
(
'ship_package_ids'
)
if
not
parcel_ids
:
error_order
.
append
(
item
.
master_business_no
)
continue
good_parcels
=
parcel_ids
.
filtered
(
lambda
x
:
x
.
item_text
)
if
len
(
good_parcels
)
==
0
:
error_order
.
append
(
item
.
master_business_no
)
if
error_order
:
raise
ValidationError
(
f
"{','.join(error_order)},没有任何商品信息可导出报关数据"
)
arr
=
[
item
.
id
for
item
in
self
]
return
{
'type'
:
'ir.actions.act_url'
,
'url'
:
'/export/flight_package/xls/
%
s/
%
s'
%
(
arr
,
self
.
select_type
),
'target'
:
'new'
,
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论