[14.0][MIG] excel_import_export, excel_import_export_demo

pull/2505/head
Kitti U 2021-02-13 14:13:07 +07:00 committed by Aungkokolin1997
parent 251494b9d4
commit 701537bc76
10 changed files with 102 additions and 79 deletions

View File

@ -3,7 +3,7 @@
{
"name": "Excel Import/Export/Report Demo",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"author": "Ecosoft,Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-tools",
@ -16,8 +16,10 @@
"import_export_purchase_order/templates.xml",
"report_sale_order/report_sale_order.xml",
"report_sale_order/templates.xml",
"report_sale_order/security/ir.model.access.csv",
"report_crm_lead/report_crm_lead.xml",
"report_crm_lead/templates.xml",
"report_crm_lead/security/ir.model.access.csv",
"import_sale_orders/menu_action.xml",
"import_sale_orders/templates.xml",
# Use report action
@ -26,6 +28,7 @@
"report_action/partner_list/report.xml",
"report_action/partner_list/templates.xml",
"report_action/partner_list/report_partner_list.xml",
"report_action/partner_list/security/ir.model.access.csv",
],
"installable": True,
"development_status": "Beta",

View File

@ -3,32 +3,39 @@
Copyright 2019 Ecosoft Co., Ltd.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).-->
<odoo>
<act_window
id="action_purchase_order_export_xlsx"
name="Export Excel"
res_model="export.xlsx.wizard"
binding_model="purchase.order"
view_mode="form"
target="new"
context="{
'template_domain': [('res_model', '=', 'purchase.order'),
('fname', '=', 'purchase_order.xlsx'),
('gname', '=', False)],
}"
/>
<act_window
id="action_purchase_order_import_xlsx"
name="Import Excel"
res_model="import.xlsx.wizard"
binding_model="purchase.order"
view_mode="form"
target="new"
context="{
'template_domain': [('res_model', '=', 'purchase.order'),
('fname', '=', 'purchase_order.xlsx'),
('gname', '=', False)],
'template_context': {},
'template_import_states': [],
}"
/>
<record id="action_purchase_order_export_xlsx" model="ir.actions.act_window">
<field name="name">Export Excel</field>
<field name="res_model">export.xlsx.wizard</field>
<field name="binding_view_types">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">
{
'template_domain': [('res_model', '=', 'purchase.order'),
('fname', '=', 'purchase_order.xlsx'),
('gname', '=', False)],
}
</field>
</record>
<record id="action_purchase_order_import_xlsx" model="ir.actions.act_window">
<field name="name">Import Excel</field>
<field name="res_model">import.xlsx.wizard</field>
<field name="binding_view_types">form</field>
<field name="binding_model_id" ref="purchase.model_purchase_order" />
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">
{
'template_domain': [('res_model', '=', 'purchase.order'),
('fname', '=', 'purchase_order.xlsx'),
('gname', '=', False)],
'template_context': {},
'template_import_states': [],
}
</field>
</record>
</odoo>

View File

@ -3,32 +3,39 @@
Copyright 2019 Ecosoft Co., Ltd.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).-->
<odoo>
<act_window
id="action_sale_oder_export_xlsx"
name="Export Excel"
res_model="export.xlsx.wizard"
binding_model="sale.order"
view_mode="form"
target="new"
context="{
'template_domain': [('res_model', '=', 'sale.order'),
('fname', '=', 'sale_order.xlsx'),
('gname', '=', False)],
}"
/>
<act_window
id="action_sale_oder_import_xlsx"
name="Import Excel"
res_model="import.xlsx.wizard"
binding_model="sale.order"
view_mode="form"
target="new"
context="{
'template_domain': [('res_model', '=', 'sale.order'),
('fname', '=', 'sale_order.xlsx'),
('gname', '=', False)],
'template_context': {},
'template_import_states': [],
}"
/>
<record id="action_sale_oder_export_xlsx" model="ir.actions.act_window">
<field name="name">Export Excel</field>
<field name="res_model">export.xlsx.wizard</field>
<field name="binding_view_types">list,form</field>
<field name="binding_model_id" ref="sale.model_sale_order" />
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">
{
'template_domain': [('res_model', '=', 'sale.order'),
('fname', '=', 'sale_order.xlsx'),
('gname', '=', False)],
}
</field>
</record>
<record id="action_sale_oder_import_xlsx" model="ir.actions.act_window">
<field name="name">Import Excel</field>
<field name="res_model">import.xlsx.wizard</field>
<field name="binding_view_types">form</field>
<field name="binding_model_id" ref="sale.model_sale_order" />
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">
{
'template_domain': [('res_model', '=', 'sale.order'),
('fname', '=', 'sale_order.xlsx'),
('gname', '=', False)],
'template_context': {},
'template_import_states': [],
}
</field>
</record>
</odoo>

View File

@ -1,4 +0,0 @@
13.0.1.0.0 (2020-08-23)
~~~~~~~~~~~~~~~~~~~~~~~
* Migration to Odoo 13

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<report
id='action_report_partner_excel'
string='Partner List (.xlsx)'
model='report.partner.list'
name='partner_list.xlsx'
file='partner_list'
report_type='excel'
/>
<record id="action_report_partner_excel" model="ir.actions.report">
<field name="name">Partner List (.xlsx)</field>
<field name="model">report.partner.list</field>
<field name="report_type">excel</field>
<field name="report_name">partner_list.xlsx</field>
<field name="report_file">partner_list</field>
</record>
</odoo>

View File

@ -0,0 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
access_report_partner_list,access_report_partner_list,model_report_partner_list,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_partner_list access_report_partner_list model_report_partner_list base.group_user 1 1 1 1

View File

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<report
id='action_report_saleorder_excel'
string='Quotation / Order (.xlsx)'
model='sale.order'
name='sale_order_form.xlsx'
file='sale_order'
print_report_name="(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name)"
report_type='excel'
/>
<record id="action_report_saleorder_excel" model="ir.actions.report">
<field name="name">Quotation / Order (.xlsx)</field>
<field name="model">sale.order</field>
<field name="report_type">excel</field>
<field name="report_name">sale_order_form.xlsx</field>
<field name="report_file">sale_order</field>
<field
name="print_report_name"
>(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name)</field>
</record>
</odoo>

View File

@ -0,0 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
access_report_crm_lead,access_report_crm_lead,model_report_crm_lead,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_crm_lead access_report_crm_lead model_report_crm_lead base.group_user 1 1 1 1

View File

@ -0,0 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
access_report_sale_order,access_report_sale_order,model_report_sale_order,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_sale_order access_report_sale_order model_report_sale_order base.group_user 1 1 1 1

View File

@ -17,7 +17,7 @@ class TestXLSXImportExport(TestExcelImportExport):
# ----------- EXPORT ---------------
ctx = {
"active_model": "sale.order",
"active_id": self.sale_order.id,
"active_ids": [self.sale_order.id],
"template_domain": [
("res_model", "=", "sale.order"),
("fname", "=", "sale_order.xlsx"),