diff --git a/excel_import_export_demo/README.rst b/excel_import_export_demo/README.rst deleted file mode 100644 index b45d13a12..000000000 --- a/excel_import_export_demo/README.rst +++ /dev/null @@ -1,135 +0,0 @@ -=============================== -Excel Import/Export/Report Demo -=============================== - -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! This file is generated by oca-gen-addon-readme !! - !! changes will be overwritten. !! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png - :target: https://odoo-community.org/page/development-status - :alt: Alpha -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github - :target: https://github.com/OCA/server-tools/tree/12.0/excel_import_export_demo - :alt: OCA/server-tools -.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-excel_import_export_demo - :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/149/12.0 - :alt: Try me on Runbot - -|badge1| |badge2| |badge3| |badge4| |badge5| - -This module provide some example use case for excel_import_export - -1. Import/Export Sales Order (import_export_sale_order) -2. Import New Sales Orders (import_sale_orders) -3. Sales Orders Report (report_sale_order) -4. Print Quoation / Order (.xlsx) (report_action/sale_order) -5. Run Partner List Report (report_action/partner_list) - -.. IMPORTANT:: - This is an alpha version, the data model and design can change at any time without warning. - Only for development or testing purpose, do not use in production. - `More details on development status `_ - -**Table of contents** - -.. contents:: - :local: - -Installation -============ - -To install this module, you need to install **excel_import_export** - -Then, simply install **excel_import_export_demo**. - -Usage -===== - -**Example 1:** Export/Import Excel on existing document - -To test this use case, go to any Sales Order and use Export Excel or Import Excel in action menu. - -**Example 2:** Import Excel Files - -To test this use case, go to Settings > Excel Import/Export > Sample Import Sales Order - -**Example 3:** Create Excel Report - -To test this use case, go to Settings > Excel Import/Export > Sample Sales Report - -**Example 4:** Printout Excel on existing document, using report action - -To test this use case, go to any Sales Order and click print "Quotation / Order (.xlsx)". - -**Example 5:** Run Partner List Report, using report action - -To test this use case, go to menu Sales > Reporting > Partner List Report - -Changelog -========= - -12.0.1.0.0 (2019-08-09) -~~~~~~~~~~~~~~~~~~~~~~~ - -* Add 2 new examples using report action, 1) sale_order 2) partner_list - -12.0.1.0.0 (2019-02-24) -~~~~~~~~~~~~~~~~~~~~~~~ - -* Start of the history - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. - -Do not contact contributors directly about support or help with technical issues. - -Credits -======= - -Authors -~~~~~~~ - -* Ecosoft - -Contributors -~~~~~~~~~~~~ - -* Kitti Upariphutthiphong. (http://ecosoft.co.th) - -Maintainers -~~~~~~~~~~~ - -This module is maintained by the OCA. - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px - :target: https://github.com/kittiu - :alt: kittiu - -Current `maintainer `__: - -|maintainer-kittiu| - -This module is part of the `OCA/server-tools `_ project on GitHub. - -You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/excel_import_export_demo/__init__.py b/excel_import_export_demo/__init__.py index c839a7771..d82c0f79c 100644 --- a/excel_import_export_demo/__init__.py +++ b/excel_import_export_demo/__init__.py @@ -3,4 +3,5 @@ from . import import_export_sale_order from . import report_sale_order +from . import report_crm_lead from . import report_action diff --git a/excel_import_export_demo/__manifest__.py b/excel_import_export_demo/__manifest__.py index 03b5f8412..1aceba923 100644 --- a/excel_import_export_demo/__manifest__.py +++ b/excel_import_export_demo/__manifest__.py @@ -3,17 +3,21 @@ { "name": "Excel Import/Export/Report Demo", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "author": "Ecosoft,Odoo Community Association (OCA)", "license": "AGPL-3", - "website": "https://github.com/OCA/server-tools/", + "website": "https://github.com/OCA/server-tools", "category": "Tools", - "depends": ["excel_import_export", "sale_management"], + "depends": ["excel_import_export", "sale_management", "purchase", "crm"], "data": [ "import_export_sale_order/actions.xml", "import_export_sale_order/templates.xml", + "import_export_purchase_order/actions.xml", + "import_export_purchase_order/templates.xml", "report_sale_order/report_sale_order.xml", "report_sale_order/templates.xml", + "report_crm_lead/report_crm_lead.xml", + "report_crm_lead/templates.xml", "import_sale_orders/menu_action.xml", "import_sale_orders/templates.xml", # Use report action @@ -24,6 +28,6 @@ "report_action/partner_list/report_partner_list.xml", ], "installable": True, - "development_status": "alpha", + "development_status": "Beta", "maintainers": ["kittiu"], } diff --git a/excel_import_export_demo/i18n/excel_import_export_demo.pot b/excel_import_export_demo/i18n/excel_import_export_demo.pot index 7736cd76c..6ab0b7f7f 100644 --- a/excel_import_export_demo/i18n/excel_import_export_demo.pot +++ b/excel_import_export_demo/i18n/excel_import_export_demo.pot @@ -24,12 +24,6 @@ msgstr "" msgid "Allow Choose Template" msgstr "" -#. module: excel_import_export_demo -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__attachment_ids -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_sale_order__attachment_ids -msgid "Attachments" -msgstr "" - #. module: excel_import_export_demo #: model_terms:ir.ui.view,arch_db:excel_import_export_demo.partner_list_wizard msgid "Cancel" @@ -52,11 +46,6 @@ msgstr "" msgid "Created on" msgstr "" -#. module: excel_import_export_demo -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__customer -msgid "Customer" -msgstr "" - #. module: excel_import_export_demo #: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__display_name #: model:ir.model.fields,field_description:excel_import_export_demo.field_report_sale_order__display_name @@ -162,11 +151,6 @@ msgstr "" msgid "State" msgstr "" -#. module: excel_import_export_demo -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__supplier -msgid "Supplier" -msgstr "" - #. module: excel_import_export_demo #: model:ir.model.fields,field_description:excel_import_export_demo.field_report_sale_order__template_id msgid "Template" @@ -191,4 +175,3 @@ msgstr "" #: model:ir.model,name:excel_import_export_demo.model_report_sale_order msgid "Wizard for report.sale.order" msgstr "" - diff --git a/excel_import_export_demo/i18n/zh_CN.po b/excel_import_export_demo/i18n/zh_CN.po index 33aa01da1..77121fcd7 100644 --- a/excel_import_export_demo/i18n/zh_CN.po +++ b/excel_import_export_demo/i18n/zh_CN.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * excel_import_export_demo +# * excel_import_export_demo # msgid "" msgstr "" @@ -18,8 +18,7 @@ msgstr "" #. module: excel_import_export_demo #: model:ir.model.fields,help:excel_import_export_demo.field_report_sale_order__state -msgid "" -"* Choose: wizard show in user selection mode\n" +msgid "* Choose: wizard show in user selection mode\n" "* Get: wizard show results from user action" msgstr "" "* 选择:用户选择模式下的向导显示\n" @@ -30,12 +29,6 @@ msgstr "" msgid "Allow Choose Template" msgstr "添加表单部分" -#. module: excel_import_export_demo -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__attachment_ids -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_sale_order__attachment_ids -msgid "Attachments" -msgstr "" - #. module: excel_import_export_demo #: model_terms:ir.ui.view,arch_db:excel_import_export_demo.partner_list_wizard msgid "Cancel" @@ -58,11 +51,6 @@ msgstr "创建者" msgid "Created on" msgstr "创建时间" -#. module: excel_import_export_demo -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__customer -msgid "Customer" -msgstr "客户" - #. module: excel_import_export_demo #: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__display_name #: model:ir.model.fields,field_description:excel_import_export_demo.field_report_sale_order__display_name @@ -168,11 +156,6 @@ msgstr "销售报告样本" msgid "State" msgstr "状态" -#. module: excel_import_export_demo -#: model:ir.model.fields,field_description:excel_import_export_demo.field_report_partner_list__supplier -msgid "Supplier" -msgstr "供应商" - #. module: excel_import_export_demo #: model:ir.model.fields,field_description:excel_import_export_demo.field_report_sale_order__template_id msgid "Template" diff --git a/excel_import_export_demo/import_export_purchase_order/actions.xml b/excel_import_export_demo/import_export_purchase_order/actions.xml new file mode 100644 index 000000000..88f71ec0c --- /dev/null +++ b/excel_import_export_demo/import_export_purchase_order/actions.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/excel_import_export_demo/import_export_purchase_order/purchase_order.xlsx b/excel_import_export_demo/import_export_purchase_order/purchase_order.xlsx new file mode 100644 index 000000000..be8e2a785 Binary files /dev/null and b/excel_import_export_demo/import_export_purchase_order/purchase_order.xlsx differ diff --git a/excel_import_export_demo/import_export_purchase_order/templates.xml b/excel_import_export_demo/import_export_purchase_order/templates.xml new file mode 100644 index 000000000..0fc94136b --- /dev/null +++ b/excel_import_export_demo/import_export_purchase_order/templates.xml @@ -0,0 +1,70 @@ + + + + + purchase.order + purchase_order.xlsx + Purchase Order Template (import/export) + Sample Purchase Order Template for testing + + + + { + '__EXPORT__': { + 'purchase': { + '_HEAD_': { + 'B1': 'partner_id.contact_address', + 'F4': 'display_name', + 'H4': 'date_order', + 'B8': 'user_id.display_name', + 'B10': 'company_id.name', + 'B12': '${"%s, %s, %s" % (object.company_id.street, object.company_id.city, object.company_id.state_id.name)}', + 'B15': 'company_id.phone', + 'B17': 'company_id.email', + 'E8': 'partner_id.name', + 'E10': 'partner_id.parent_id.name', + 'E15': 'partner_id.phone', + 'E17': 'partner_id.email', + 'H20': 'date_planned${value or ""}#{style=date}', + 'I37': 'amount_untaxed#{style=number}', + 'O38': 'amount_tax#{style=number}', + 'I39': 'amount_total#{style=number}', + }, + 'order_line': { + 'B22': 'product_id.default_code', + 'C22': 'name', + 'E22': 'product_qty${value or 0}#{style=number}', + 'F22': 'product_uom.name', + 'G22': 'price_unit${value or 0}#{style=number}', + 'H22': 'taxes_id.name', + } + } + }, + '__IMPORT__': { + 'purchase': { + 'order_line': { + 'B22': 'product_id', + 'C22': 'name', + 'E22': 'product_qty', + 'F22': 'product_uom', + 'G22': 'price_unit', + 'H22': 'taxes_id', + 'I22': 'date_planned${time.strftime("%Y-%m-%d %H:%M:%S")}', + } + } + }, + } + + + + + + diff --git a/excel_import_export_demo/import_export_sale_order/actions.xml b/excel_import_export_demo/import_export_sale_order/actions.xml index 8c67e720d..5f695ed4b 100644 --- a/excel_import_export_demo/import_export_sale_order/actions.xml +++ b/excel_import_export_demo/import_export_sale_order/actions.xml @@ -7,7 +7,7 @@ id="action_sale_oder_export_xlsx" name="Export Excel" res_model="export.xlsx.wizard" - src_model="sale.order" + binding_model="sale.order" view_mode="form" target="new" context="{ @@ -20,7 +20,7 @@ id="action_sale_oder_import_xlsx" name="Import Excel" res_model="import.xlsx.wizard" - src_model="sale.order" + binding_model="sale.order" view_mode="form" target="new" context="{ diff --git a/excel_import_export_demo/import_export_sale_order/templates.xml b/excel_import_export_demo/import_export_sale_order/templates.xml index eec0666d8..50f506c7f 100644 --- a/excel_import_export_demo/import_export_sale_order/templates.xml +++ b/excel_import_export_demo/import_export_sale_order/templates.xml @@ -6,8 +6,10 @@ sale.order sale_order.xlsx - Sale Order Template - Sample Sales Order Tempalte for testing + Sale Order Template (import/export) + Sample Sales Order Template for testing + + { '__EXPORT__': { diff --git a/excel_import_export_demo/import_sale_orders/menu_action.xml b/excel_import_export_demo/import_sale_orders/menu_action.xml index 4c0c0e994..e6f0d6fd9 100644 --- a/excel_import_export_demo/import_sale_orders/menu_action.xml +++ b/excel_import_export_demo/import_sale_orders/menu_action.xml @@ -6,7 +6,7 @@ Sample Import Sale Order import.xlsx.wizard - form + form form new { diff --git a/excel_import_export_demo/readme/HISTORY.rst b/excel_import_export_demo/readme/HISTORY.rst index 3b4b1bf79..1c7d49f63 100644 --- a/excel_import_export_demo/readme/HISTORY.rst +++ b/excel_import_export_demo/readme/HISTORY.rst @@ -1,9 +1,4 @@ -12.0.1.0.0 (2019-08-09) +13.0.1.0.0 (2020-08-23) ~~~~~~~~~~~~~~~~~~~~~~~ -* Add 2 new examples using report action, 1) sale_order 2) partner_list - -12.0.1.0.0 (2019-02-24) -~~~~~~~~~~~~~~~~~~~~~~~ - -* Start of the history +* Migration to Odoo 13 diff --git a/excel_import_export_demo/report_action/partner_list/report_partner_list.py b/excel_import_export_demo/report_action/partner_list/report_partner_list.py index c15e49942..871db7230 100644 --- a/excel_import_export_demo/report_action/partner_list/report_partner_list.py +++ b/excel_import_export_demo/report_action/partner_list/report_partner_list.py @@ -1,16 +1,14 @@ # Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) -from odoo import api, fields, models +from odoo import fields, models class ReportPartnerList(models.TransientModel): _name = "report.partner.list" _description = "Wizard for report.partner.list" - partner_ids = fields.Many2many(comodel_name="res.partner",) - supplier = fields.Boolean(default=True,) - customer = fields.Boolean(default=True,) + partner_ids = fields.Many2many(comodel_name="res.partner") results = fields.Many2many( "res.partner", string="Results", @@ -18,17 +16,12 @@ class ReportPartnerList(models.TransientModel): help="Use compute fields, so there is nothing store in database", ) - @api.multi def _compute_results(self): - """ On the wizard, result will be computed and added to results line + """On the wizard, result will be computed and added to results line before export to excel by report_excel action """ self.ensure_one() - domain = [ - "|", - ("supplier", "=", self.supplier), - ("customer", "=", self.customer), - ] + domain = [] if self.partner_ids: domain.append(("id", "in", self.partner_ids.ids)) self.results = self.env["res.partner"].search(domain, order="id") diff --git a/excel_import_export_demo/report_action/partner_list/report_partner_list.xml b/excel_import_export_demo/report_action/partner_list/report_partner_list.xml index 15871159e..0c9861d53 100644 --- a/excel_import_export_demo/report_action/partner_list/report_partner_list.xml +++ b/excel_import_export_demo/report_action/partner_list/report_partner_list.xml @@ -10,8 +10,6 @@ - -