server-tools/excel_import_export
Kitti U e7ee17505a Excel Import/Export/Report (#1522)
* [ADD] v12 excel_import_export

* Change from eval() to safe_evel()

* Change variable to format to style, as fomat is a common python function

:100644 100644 00ee3d9f... e9e48d87... M	excel_import_export/models/common.py
:100644 100644 a215d29b... 5b4d1fb1... M	excel_import_export/models/styles.py
:100644 100644 ace11a32... 01e5b9f5... M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f... cadfb0f2... M	excel_import_export/models/xlsx_import.py
:100644 100644 58689ee5... 80490ce8... M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6... a363ad19... M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 475b5187... 392fe6e5... M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 4af9c519... 45ee33c6... M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3... 17d3964d... M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f... 51c2572a... M	excel_import_export/models/common.py
:100644 100644 a215d29b... 5b4d1fb1... M	excel_import_export/models/styles.py
:100644 100644 ace11a32... 185a3330... M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f... cadfb0f2... M	excel_import_export/models/xlsx_import.py
:100644 100644 58689ee5... 80490ce8... M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6... a363ad19... M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 475b5187... 392fe6e5... M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 4af9c519... 45ee33c6... M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3... 933ce0dc... M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f... 51c2572a... M	excel_import_export/models/common.py
:100644 100644 a215d29b... 5b4d1fb1... M	excel_import_export/models/styles.py
:100644 100644 ace11a32... 185a3330... M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f... cadfb0f2... M	excel_import_export/models/xlsx_import.py
:100644 100644 58689ee5... 80490ce8... M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6... a363ad19... M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 475b5187... 392fe6e5... M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 4af9c519... 45ee33c6... M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 3b1217e8 M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 5b4d1fb1 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 185a3330 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f cadfb0f2 M	excel_import_export/models/xlsx_import.py
:100644 100644 58689ee5 80490ce8 M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 475b5187 392fe6e5 M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 5b4d1fb1 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 185a3330 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f cadfb0f2 M	excel_import_export/models/xlsx_import.py
:100644 100644 58689ee5 80490ce8 M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 475b5187 392fe6e5 M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 9738a3c8 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 a7d6adc5 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f 12f9ca99 M	excel_import_export/models/xlsx_import.py
:100644 100644 70c37799 f123d2a6 M	excel_import_export/models/xlsx_report.py
:100644 100644 58689ee5 578a1fd8 M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 800ea573 1807ea7e M	excel_import_export/wizard/export_xlsx_wizard.py
:100644 100644 febed8d0 750dc17e M	excel_import_export/wizard/import_xlsx_wizard.py
:100644 100644 475b5187 392fe6e5 M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 8e40a2d0 21574896 M	excel_import_export_demo/report_sale_order/report_sale_order.py
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 9738a3c8 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 c7db3f92 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f 12f9ca99 M	excel_import_export/models/xlsx_import.py
:100644 100644 70c37799 f123d2a6 M	excel_import_export/models/xlsx_report.py
:100644 100644 58689ee5 578a1fd8 M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 800ea573 1807ea7e M	excel_import_export/wizard/export_xlsx_wizard.py
:100644 100644 febed8d0 750dc17e M	excel_import_export/wizard/import_xlsx_wizard.py
:100644 100644 475b5187 392fe6e5 M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 8e40a2d0 21574896 M	excel_import_export_demo/report_sale_order/report_sale_order.py
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 9738a3c8 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 c7db3f92 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f 12f9ca99 M	excel_import_export/models/xlsx_import.py
:100644 100644 70c37799 f123d2a6 M	excel_import_export/models/xlsx_report.py
:100644 100644 58689ee5 e3826e08 M	excel_import_export/models/xlsx_template.py
:000000 100644 00000000 34aa53bf A	excel_import_export/tests/__init__.py
:000000 100644 00000000 18618688 A	excel_import_export/tests/sale_order.xlsx
:000000 100644 00000000 c8481487 A	excel_import_export/tests/test_xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 800ea573 1807ea7e M	excel_import_export/wizard/export_xlsx_wizard.py
:100644 100644 febed8d0 750dc17e M	excel_import_export/wizard/import_xlsx_wizard.py
:100644 100644 475b5187 392fe6e5 M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 8e40a2d0 21574896 M	excel_import_export_demo/report_sale_order/report_sale_order.py
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 9738a3c8 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 c7db3f92 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f 12f9ca99 M	excel_import_export/models/xlsx_import.py
:100644 100644 70c37799 f123d2a6 M	excel_import_export/models/xlsx_report.py
:100644 100644 58689ee5 ed8c9fc7 M	excel_import_export/models/xlsx_template.py
:000000 100644 00000000 34aa53bf A	excel_import_export/tests/__init__.py
:000000 100644 00000000 18618688 A	excel_import_export/tests/sale_order.xlsx
:000000 100644 00000000 69aa6ea0 A	excel_import_export/tests/test_xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 800ea573 1807ea7e M	excel_import_export/wizard/export_xlsx_wizard.py
:100644 100644 febed8d0 750dc17e M	excel_import_export/wizard/import_xlsx_wizard.py
:100644 100644 475b5187 392fe6e5 M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 8e40a2d0 21574896 M	excel_import_export_demo/report_sale_order/report_sale_order.py
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 9738a3c8 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 c7db3f92 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f 933d8614 M	excel_import_export/models/xlsx_import.py
:100644 100644 70c37799 f123d2a6 M	excel_import_export/models/xlsx_report.py
:100644 100644 58689ee5 1460473a M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 800ea573 1807ea7e M	excel_import_export/wizard/export_xlsx_wizard.py
:100644 100644 febed8d0 750dc17e M	excel_import_export/wizard/import_xlsx_wizard.py
:100644 100644 a2d035ef 9463f279 M	excel_import_export_demo/__manifest__.py
:100644 100644 475b5187 e7f1255b M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 8e40a2d0 21574896 M	excel_import_export_demo/report_sale_order/report_sale_order.py
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml
:000000 100644 00000000 79db62f7 A	excel_import_export_demo/tests/__init__.py
:000000 100644 00000000 18618688 A	excel_import_export_demo/tests/sale_order.xlsx
:000000 100644 00000000 c9733b95 A	excel_import_export_demo/tests/test_common.py
:000000 100644 00000000 9c943768 A	excel_import_export_demo/tests/test_xlsx_import_export.py
:000000 100644 00000000 730605c1 A	excel_import_export_demo/tests/test_xlsx_template.py

:100644 100644 96157ea3 fee958bc M	excel_import_export/__manifest__.py
:100644 100644 00ee3d9f 51c2572a M	excel_import_export/models/common.py
:100644 100644 a215d29b 9738a3c8 M	excel_import_export/models/styles.py
:100644 100644 ace11a32 c7db3f92 M	excel_import_export/models/xlsx_export.py
:100644 100644 881b814f 933d8614 M	excel_import_export/models/xlsx_import.py
:100644 100644 70c37799 f123d2a6 M	excel_import_export/models/xlsx_report.py
:100644 100644 58689ee5 1460473a M	excel_import_export/models/xlsx_template.py
:100644 100644 5c9c09a6 a363ad19 M	excel_import_export/views/xlsx_template_view.xml
:100644 100644 800ea573 1807ea7e M	excel_import_export/wizard/export_xlsx_wizard.py
:100644 100644 febed8d0 750dc17e M	excel_import_export/wizard/import_xlsx_wizard.py
:100644 100644 a2d035ef 9463f279 M	excel_import_export_demo/__manifest__.py
:100644 100644 475b5187 e7f1255b M	excel_import_export_demo/import_export_sale_order/templates.xml
:100644 100644 8e40a2d0 21574896 M	excel_import_export_demo/report_sale_order/report_sale_order.py
:100644 100644 4af9c519 45ee33c6 M	excel_import_export_demo/report_sale_order/templates.xml
:000000 100644 00000000 79db62f7 A	excel_import_export_demo/tests/__init__.py
:000000 100644 00000000 18618688 A	excel_import_export_demo/tests/sale_order.xlsx
:000000 100644 00000000 bb3ea32e A	excel_import_export_demo/tests/test_common.py
:000000 100644 00000000 9c943768 A	excel_import_export_demo/tests/test_xlsx_import_export.py
:000000 100644 00000000 730605c1 A	excel_import_export_demo/tests/test_xlsx_template.py
2022-12-20 12:06:26 +06:30
..
models Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
readme Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
security Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
static/description Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
views Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
wizard Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
README.rst Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
__init__.py Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30
__manifest__.py Excel Import/Export/Report (#1522) 2022-12-20 12:06:26 +06:30

README.rst

===================
Excel Import/Export
===================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| 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
.. |badge2| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
    :target: https://github.com/OCA/server-tools/tree/12-add-excel_import_export/excel_import_export
    :alt: OCA/server-tools
.. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/server-tools-12-add-excel_import_export/server-tools-12-add-excel_import_export-excel_import_export
    :alt: Translate me on Weblate
.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
    :target: https://runbot.odoo-community.org/runbot/149/12-add-excel_import_export
    :alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| 

The module provide pre-built functions and wizards for developer to build excel import / export / report with ease.

Without having to code to create excel file, developer do,

- Create menu, action, wizard, model, view a normal Odoo development.
- Design excel template using standard Excel application, e.g., colors, fonts, formulas, etc.
- Instruct how the data will be located in Excel with simple dictionary instruction or from Odoo UI.
- Odoo will combine instruction with excel template, and result in final excel file.

**Table of contents**

.. contents::
   :local:

Installation
============

To install this module, you need to install following python library, **xlrd, xlwt, openpyxl**.

Then, simply install **excel_import_export**.

For samples, install **excel_import_export_sample**.

Usage
=====

This module contain pre-defined function and wizards to make exporting, importing and reporting easy.

At the heart of this module, there are 2 `main methods`

- ``self.env['xlsx.export'].export_xlsx(...)``
- ``self.env['xlsx.import'].import_xlsx(...)``

For reporting, also call `export_xlsx(...)` but through following method

- ``self.env['xslx.report'].report_xlsx(...)``

After install this module, go to Settings > Excel Import/Export > XLSX Templates, this is where the key component located.

As this module provide tools, it is best to explain as use cases. For example use cases, please install **excel_import_export_sample**

**Use Case 1:** Export/Import Excel on existing document

This add export/import action menus in existing document (example - excel_import_export_sample/import_export_sale_order)

1. Create export action menu on document, <act_window> with res_model="export.xlsx.wizard" and src_model="<document_model>", and context['template_domain'] to locate the right template -- actions.xml
2. Create import action menu on document, <act_window> with res_model="import.xlsx.wizard" and src_model="<document_model>", and context['template_domain'] to locate the right template -- action.xml
3. Create/Design Excel Template File (.xlsx), in the template, name the underlining tab used for export/import -- <file>.xlsx
4. Create instruction dictionary for export/import in xlsx.template model -- templates.xml

**Use Case 2:** Import Excel Files

With menu wizard to create new documents (example - excel_import_export_sample/import_sale_orders)

1. Create report menu with search wizard, res_model="import.xlsx.wizard" and context['template_domain'] to locate the right template -- menu_action.xml
2. Create Excel Template File (.xlsx), in the template, name the underlining tab used for import -- <import file>.xlsx
3. Create instruction dictionary for import in xlsx.template model -- templates.xml

**Use Case 3:** Create Excel Report

This create report menu with criteria wizard. (example - excel_import_export_sample/report_sale_order)

1. Create report's menu, action, and add context['template_domain']  to locate the right template for this report -- <report>.xml
2. Create report's wizard for search criteria. The view inherits ``excel_import_export.xlsx_report_view`` and mode="primary". In this view, you only need to add criteria fields, the rest will reuse from interited view -- <report.xml>
3. Create report model as models.Transient, then define search criteria fields, and get reporing data into ``results`` field -- <report>.py
4. Create/Design Excel Template File (.xlsx), in the template, name the underlining tab used for report results -- <report_file>.xlsx
5. Create instruction dictionary for report in xlsx.template model -- templates.xml

Known issues / Roadmap
======================

- Module extension e.g., excel_import_export_async, that add ability to execute as async process.
- Ability to add contextual action in XLSX Tempalte, e.g., Add import action, Add export action. In similar manner as in Server Action.

Changelog
=========

12.0.1.0.0 (2019-02-24)
~~~~~~~~~~~~~~~~~~~~~~~

* Start of the history

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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 <https://github.com/OCA/server-tools/issues/new?body=module:%20excel_import_export%0Aversion:%2012-add-excel_import_export%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Ecosoft

Contributors
~~~~~~~~~~~~

* Kitti Upariphutthiphong. <kittiu@gmail.com> (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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kittiu| 

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/12-add-excel_import_export/excel_import_export>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.