From 9e2ae600280b855a1cf0f29476e4a4c340deaf09 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Fri, 15 Mar 2019 06:40:06 +0700 Subject: [PATCH] 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 --- excel_import_export_demo/README.rst | 112 +++++ excel_import_export_demo/__init__.py | 5 + excel_import_export_demo/__manifest__.py | 22 + .../import_export_sale_order/actions.xml | 32 ++ .../import_export_sale_order/sale_order.xlsx | Bin 0 -> 5328 bytes .../import_export_sale_order/templates.xml | 52 ++ .../import_sale_orders/import_sale_order.xlsx | Bin 0 -> 5328 bytes .../import_sale_orders/menu_action.xml | 25 + .../import_sale_orders/templates.xml | 38 ++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 5 + excel_import_export_demo/readme/HISTORY.rst | 4 + excel_import_export_demo/readme/INSTALL.rst | 3 + excel_import_export_demo/readme/USAGE.rst | 11 + .../report_sale_order/__init__.py | 4 + .../report_sale_order/report_sale_order.py | 35 ++ .../report_sale_order/report_sale_order.xlsx | Bin 0 -> 5337 bytes .../report_sale_order/report_sale_order.xml | 41 ++ .../report_sale_order/templates.xml | 36 ++ .../static/description/index.html | 455 ++++++++++++++++++ excel_import_export_demo/tests/__init__.py | 5 + .../tests/sale_order.xlsx | Bin 0 -> 5328 bytes excel_import_export_demo/tests/test_common.py | 130 +++++ .../tests/test_xlsx_import_export.py | 48 ++ .../tests/test_xlsx_report.py | 29 ++ .../tests/test_xlsx_template.py | 62 +++ 26 files changed, 1155 insertions(+) create mode 100644 excel_import_export_demo/README.rst create mode 100644 excel_import_export_demo/__init__.py create mode 100644 excel_import_export_demo/__manifest__.py create mode 100644 excel_import_export_demo/import_export_sale_order/actions.xml create mode 100644 excel_import_export_demo/import_export_sale_order/sale_order.xlsx create mode 100644 excel_import_export_demo/import_export_sale_order/templates.xml create mode 100644 excel_import_export_demo/import_sale_orders/import_sale_order.xlsx create mode 100644 excel_import_export_demo/import_sale_orders/menu_action.xml create mode 100644 excel_import_export_demo/import_sale_orders/templates.xml create mode 100644 excel_import_export_demo/readme/CONTRIBUTORS.rst create mode 100644 excel_import_export_demo/readme/DESCRIPTION.rst create mode 100644 excel_import_export_demo/readme/HISTORY.rst create mode 100644 excel_import_export_demo/readme/INSTALL.rst create mode 100644 excel_import_export_demo/readme/USAGE.rst create mode 100644 excel_import_export_demo/report_sale_order/__init__.py create mode 100644 excel_import_export_demo/report_sale_order/report_sale_order.py create mode 100644 excel_import_export_demo/report_sale_order/report_sale_order.xlsx create mode 100644 excel_import_export_demo/report_sale_order/report_sale_order.xml create mode 100644 excel_import_export_demo/report_sale_order/templates.xml create mode 100644 excel_import_export_demo/static/description/index.html create mode 100644 excel_import_export_demo/tests/__init__.py create mode 100644 excel_import_export_demo/tests/sale_order.xlsx create mode 100644 excel_import_export_demo/tests/test_common.py create mode 100644 excel_import_export_demo/tests/test_xlsx_import_export.py create mode 100644 excel_import_export_demo/tests/test_xlsx_report.py create mode 100644 excel_import_export_demo/tests/test_xlsx_template.py diff --git a/excel_import_export_demo/README.rst b/excel_import_export_demo/README.rst new file mode 100644 index 000000000..17d98a14a --- /dev/null +++ b/excel_import_export_demo/README.rst @@ -0,0 +1,112 @@ +======================== +Excel Import/Export Demo +======================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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_demo + :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_demo + :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| + +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) + +**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 +===== + +**Use Case 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. + +**Use Case 2:** Import Excel Files + +To test this use case, go to Settings > Excel Import/Export > Sample Import Sales Order + +**Use Case 3:** Create Excel Report + +To test this use case, go to Settings > Excel Import/Export > Sample Sales Report + +Changelog +========= + +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 new file mode 100644 index 000000000..1334da2f4 --- /dev/null +++ b/excel_import_export_demo/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import import_export_sale_order +from . import report_sale_order diff --git a/excel_import_export_demo/__manifest__.py b/excel_import_export_demo/__manifest__.py new file mode 100644 index 000000000..9463f279f --- /dev/null +++ b/excel_import_export_demo/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +{'name': 'Excel Import/Export Demo', + 'version': '12.0.1.0.0', + 'author': 'Ecosoft,Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'website': 'https://github.com/OCA/server-tools/', + 'category': 'Tools', + 'depends': ['excel_import_export', + 'sale_management'], + 'data': ['import_export_sale_order/actions.xml', + 'import_export_sale_order/templates.xml', + 'report_sale_order/report_sale_order.xml', + 'report_sale_order/templates.xml', + 'import_sale_orders/menu_action.xml', + 'import_sale_orders/templates.xml', + ], + 'installable': True, + 'development_status': 'alpha', + 'maintainers': ['kittiu'], + } diff --git a/excel_import_export_demo/import_export_sale_order/actions.xml b/excel_import_export_demo/import_export_sale_order/actions.xml new file mode 100644 index 000000000..bbff83122 --- /dev/null +++ b/excel_import_export_demo/import_export_sale_order/actions.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/excel_import_export_demo/import_export_sale_order/sale_order.xlsx b/excel_import_export_demo/import_export_sale_order/sale_order.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..18618688be4f5aeade17e3f3911e81ef305688b6 GIT binary patch literal 5328 zcmaJ_cRbte*S3k()OZk7%~GwPwQ5z37)4OjrdEgwV%FZFHf>RRv_-{;QWT}Am6{I~ zHHzAMQ{#>2d7r0!`~H4C_aEORpYJ*O+}C~X>zwOAHHb+V2q-8h2yR^x)gt)GK={wz zPGAc+TPGyg3*iQTfIz^7ydOFVo&Qprs0sfdOdYX)!l<&}rbccZBiRt6P=LR~k(#VHk0iXg&6A=b_+)MMD~ka(Z(<6@ z8(+>rSMrYja}bjn*ch`dX(aTZB|+M(pi^C|Xr!|)bX5o3y`?soL5OA4D>Wgmau$Tv zBU{eOtw(5RE%JS{g*#{fShq`wH~MwsA4~~?Mag#_9)6SkCeOwGnY*hjG+S5P3-G6f z-KF(MR0zOWDKuc^m}h&dCQZ4tY+~Gx2&zF&p}leVXaK)&ULpbl=zm3q;csM+Fe^7( z8$EY72WNZaIWVyU6w?$|x8N(ZY0*U!OF0%}7&*HsR0Cjn8 zjH}%DXV=Dd#k7_}(iHQ|!AzM3s&X{JpBm&=EY`BC9uR^o)x#PZIhWtmV|wx&1zpP^ zi9WW}-!F1+aA8$<=TqEBihBLTW$eR(AxcrnJ_~gadd>s`ImRTAi5^vWZ^-k>5DZ(! z3BYKRy3uY#Am%Uxw`zH3H;cSy7=@X8e)>TooVQKo*kHOM(HRMfe#ZAbW(ApAxK`U4 z$Z#3p25%v!%o|W^;Bx8wJb}SB*KEp~CO)4ZA#sun{*xA8Hx;uzD@2%Kjtfw_B+rhIJc}>JB&@pc z(;K<*vZNm$H6+D~pcV@<#nS*P5W{^oc7GT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{IChKf1~^(K7MunxelGToIi{S@b@PEZ9so@{h6uH3)K%} z!$ + + + + + sale.order + sale_order.xlsx + Sale Order Template + Sample Sales Order Tempalte for testing + + { + '__EXPORT__': { + 'sale_order': { + '_HEAD_': { + 'B2': 'partner_id.display_name${value or ""}#{align=left;style=text}', + 'B3': 'name${value or ""}#{align=left;style=text}', + }, + 'order_line': { + 'A6': 'product_id.display_name${value or ""}#{style=text}', + 'B6': 'name${value or ""}#{style=text}', + 'C6': 'product_uom_qty${value or 0}#{style=number}', + 'D6': 'product_uom.name${value or ""}#{style=text}', + 'E6': 'price_unit${value or 0}#{style=number}', + 'F6': 'tax_id${value and ",".join([x.display_name for x in value]) or ""}', + 'G6': 'price_subtotal${value or 0}#{style=number}', + } + } + }, + '__IMPORT__': { + 'sale_order': { + '_NODEL_order_line': { + 'A6': 'product_id', + 'B6': 'name', + 'C6': 'product_uom_qty', + 'D6': 'product_uom', + 'E6': 'price_unit', + 'F6': 'tax_id', + } + } + }, + # '__POST_IMPORT__': '${object.post_import_do_something()}', + } + + + + + + + + diff --git a/excel_import_export_demo/import_sale_orders/import_sale_order.xlsx b/excel_import_export_demo/import_sale_orders/import_sale_order.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..18618688be4f5aeade17e3f3911e81ef305688b6 GIT binary patch literal 5328 zcmaJ_cRbte*S3k()OZk7%~GwPwQ5z37)4OjrdEgwV%FZFHf>RRv_-{;QWT}Am6{I~ zHHzAMQ{#>2d7r0!`~H4C_aEORpYJ*O+}C~X>zwOAHHb+V2q-8h2yR^x)gt)GK={wz zPGAc+TPGyg3*iQTfIz^7ydOFVo&Qprs0sfdOdYX)!l<&}rbccZBiRt6P=LR~k(#VHk0iXg&6A=b_+)MMD~ka(Z(<6@ z8(+>rSMrYja}bjn*ch`dX(aTZB|+M(pi^C|Xr!|)bX5o3y`?soL5OA4D>Wgmau$Tv zBU{eOtw(5RE%JS{g*#{fShq`wH~MwsA4~~?Mag#_9)6SkCeOwGnY*hjG+S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8w)c!ymBpq{gC^sOS4U*7nQcc(Q|!47G10WmEFn!yT9ON zUrDKW*4oDWt&H!11!){fo&^bU_B(QQpdtyFAY2kPw_Z3?y+H6BjXj;Af4iyz3VK{x zPU^lWcf8Fp_}4M%)0&^c@JBTE+kB?SACrk9!r9%{+1=uvkBcqR>@V4x(yaAC7^t*< z65U~#^7dO0P#s512YIC=#chpX6^wegnx1qjyPRS`q@{&zcA%(zgVG{$l=Nx zIuL6d{EjWYtYA+l@L-dL+C z5Gt?~6LLu$%=+^{iscqmX}f28jP_2OIx3_?Faeb2kF|`vR%E7Mgkv~bEgzxYH3Xiy z&Pz_S`CsmA4@3iG1!+=c%6ToTB2CstaoicSlOCE&>#aHhksNJ1?B|!mv5X-`43D}Y zzCnj-5E3yE{1`s{JbXDHKK)<&@1v++BSFI z!)FUV!hf7){2Jxwe)3#y{IChKf1~^(K7MunxelGToIi{S@b@PEZ9so@{h6uH3)K%} z!$ + + + + + Sample Import Sale Order + import.xlsx.wizard + form + form + new + { + 'template_domain': [('res_model', '=', 'sale.order'), + ('fname', '=', 'import_sale_order.xlsx'), + ('gname', '=', False)], } + + + + + + diff --git a/excel_import_export_demo/import_sale_orders/templates.xml b/excel_import_export_demo/import_sale_orders/templates.xml new file mode 100644 index 000000000..b5fad027c --- /dev/null +++ b/excel_import_export_demo/import_sale_orders/templates.xml @@ -0,0 +1,38 @@ + + + + + + sale.order + import_sale_order.xlsx + Import Sale Order Template + Sample Import Sales Order Tempalte for testing + + + { + '__IMPORT__': { + 'sale_order': { + '_HEAD_': { + 'B2': 'partner_id', + }, + 'order_line': { + 'A6': 'product_id', + 'B6': 'name', + 'C6': 'product_uom_qty', + 'D6': 'product_uom', + 'E6': 'price_unit', + 'F6': 'tax_id', + } + } + }, + } + + + + + + + + diff --git a/excel_import_export_demo/readme/CONTRIBUTORS.rst b/excel_import_export_demo/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..9c7a518b1 --- /dev/null +++ b/excel_import_export_demo/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Kitti Upariphutthiphong. (http://ecosoft.co.th) diff --git a/excel_import_export_demo/readme/DESCRIPTION.rst b/excel_import_export_demo/readme/DESCRIPTION.rst new file mode 100644 index 000000000..e1c00d558 --- /dev/null +++ b/excel_import_export_demo/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +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) diff --git a/excel_import_export_demo/readme/HISTORY.rst b/excel_import_export_demo/readme/HISTORY.rst new file mode 100644 index 000000000..b8d1b41b6 --- /dev/null +++ b/excel_import_export_demo/readme/HISTORY.rst @@ -0,0 +1,4 @@ +12.0.1.0.0 (2019-02-24) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Start of the history diff --git a/excel_import_export_demo/readme/INSTALL.rst b/excel_import_export_demo/readme/INSTALL.rst new file mode 100644 index 000000000..d428d7850 --- /dev/null +++ b/excel_import_export_demo/readme/INSTALL.rst @@ -0,0 +1,3 @@ +To install this module, you need to install **excel_import_export** + +Then, simply install **excel_import_export_demo**. diff --git a/excel_import_export_demo/readme/USAGE.rst b/excel_import_export_demo/readme/USAGE.rst new file mode 100644 index 000000000..cdf6bdeff --- /dev/null +++ b/excel_import_export_demo/readme/USAGE.rst @@ -0,0 +1,11 @@ +**Use Case 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. + +**Use Case 2:** Import Excel Files + +To test this use case, go to Settings > Excel Import/Export > Sample Import Sales Order + +**Use Case 3:** Create Excel Report + +To test this use case, go to Settings > Excel Import/Export > Sample Sales Report diff --git a/excel_import_export_demo/report_sale_order/__init__.py b/excel_import_export_demo/report_sale_order/__init__.py new file mode 100644 index 000000000..03a1b8b20 --- /dev/null +++ b/excel_import_export_demo/report_sale_order/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import report_sale_order diff --git a/excel_import_export_demo/report_sale_order/report_sale_order.py b/excel_import_export_demo/report_sale_order/report_sale_order.py new file mode 100644 index 000000000..215748968 --- /dev/null +++ b/excel_import_export_demo/report_sale_order/report_sale_order.py @@ -0,0 +1,35 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from openerp import models, fields, api + + +class ReportSaleOrder(models.TransientModel): + _name = 'report.sale.order' + _description = 'Wizard for report.sale.order' + _inherit = 'xlsx.report' + + # Search Criteria + partner_id = fields.Many2one( + 'res.partner', + string='Partner', + ) + # Report Result, sale.order + results = fields.Many2many( + 'sale.order', + string='Results', + compute='_compute_results', + help='Use compute fields, so there is nothing stored in database', + ) + + @api.multi + def _compute_results(self): + """ On the wizard, result will be computed and added to results line + before export to excel, by using xlsx.export + """ + self.ensure_one() + Result = self.env['sale.order'] + domain = [] + if self.partner_id: + domain += [('partner_id', '=', self.partner_id.id)] + self.results = Result.search(domain) diff --git a/excel_import_export_demo/report_sale_order/report_sale_order.xlsx b/excel_import_export_demo/report_sale_order/report_sale_order.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..6e5cf8fa6128c91cc0d16cbe0958002e08e18327 GIT binary patch literal 5337 zcmaJ_by(Ev)}_0|L6nddq)R#^1W5@2=^Pk3hHj)`Xrx;ZL~0ybx}-rmq(MSLYH0k1 zbDneL^WN+F{W0;(-t+AB?sx4_Q9wllAYox)A|O zxILUOJbBpk{CJBuYAdWm3J;?=4=uR0(-o^R;A(eg>4D}z-uxnnA*O)!iyd=Dd1;rRa9xFMbq{Q;dcO? zlm+wdrE+M7C{D@C=0j_0G+Zp`Ffc~*y>Nj*W@=04UFz4EF$7xNB$E-_y1<-CTqYTAkZ1i@z)F24NHw$`rsJ> zfX{;A(!Nx-E7Z|H|9!3$4e!pX^}&~IxY88&gmjXgT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ph0-LRl0sRye(cgV*U$41pg`RzgyqFP&Wei3ucJu|1Avv$ldSew=?7B*8Ktj!rOnj XgDMK>2pW-)un~_q;#h)+Z$AAW_5?93 literal 0 HcmV?d00001 diff --git a/excel_import_export_demo/report_sale_order/report_sale_order.xml b/excel_import_export_demo/report_sale_order/report_sale_order.xml new file mode 100644 index 000000000..92b1a147d --- /dev/null +++ b/excel_import_export_demo/report_sale_order/report_sale_order.xml @@ -0,0 +1,41 @@ + + + + + + report.sale.order + report.sale.order + + primary + + + + + + + + + + + + + Sample Sales Report + report.sale.order + form + form + new + + {'template_domain': [('res_model', '=', 'report.sale.order'), + ('fname', '=', 'report_sale_order.xlsx'), + ('gname', '=', False)]} + + + + + + diff --git a/excel_import_export_demo/report_sale_order/templates.xml b/excel_import_export_demo/report_sale_order/templates.xml new file mode 100644 index 000000000..45ee33c6d --- /dev/null +++ b/excel_import_export_demo/report_sale_order/templates.xml @@ -0,0 +1,36 @@ + + + + + + report.sale.order + report_sale_order.xlsx + Report Sale Order Template + Sample Report Sales Order Tempalte for testing + + { + '__EXPORT__': { + 1: { + '_HEAD_': { + 'B2': 'partner_id.display_name${value or ""}#{align=left;style=text}', + }, + 'results': { + 'A5': 'name${value or ""}#{style=text}', + 'B5': 'confirmation_date${value or ""}#{style=date}', + 'C5': 'amount_untaxed${value or 0}#{style=number}@{sum}', + 'D5': 'amount_tax${value or 0}#{style=number}@{sum}', + 'E5': 'amount_total${value or 0}#{style=number}@{sum}', + }, + }, + }, + } + + + + + + + + diff --git a/excel_import_export_demo/static/description/index.html b/excel_import_export_demo/static/description/index.html new file mode 100644 index 000000000..5ac32b4e4 --- /dev/null +++ b/excel_import_export_demo/static/description/index.html @@ -0,0 +1,455 @@ + + + + + + +Excel Import/Export Demo + + + +
+

Excel Import/Export Demo

+ + +

License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runbot

+

This module provide some example use case for excel_import_export

+
    +
  1. Import/Export Sales Order (import_export_sale_order)
  2. +
  3. Import New Sales Orders (import_sale_orders)
  4. +
  5. Sales Orders Report (report_sale_order)
  6. +
+

Table of contents

+ +
+

Installation

+

To install this module, you need to install excel_import_export

+

Then, simply install excel_import_export_demo.

+
+
+

Usage

+

Use Case 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.

+

Use Case 2: Import Excel Files

+

To test this use case, go to Settings > Excel Import/Export > Sample Import Sales Order

+

Use Case 3: Create Excel Report

+

To test this use case, go to Settings > Excel Import/Export > Sample Sales Report

+
+
+

Changelog

+
+

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

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current 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/tests/__init__.py b/excel_import_export_demo/tests/__init__.py new file mode 100644 index 000000000..44c33f918 --- /dev/null +++ b/excel_import_export_demo/tests/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +from . import test_xlsx_template +from . import test_xlsx_import_export +from . import test_xlsx_report diff --git a/excel_import_export_demo/tests/sale_order.xlsx b/excel_import_export_demo/tests/sale_order.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..18618688be4f5aeade17e3f3911e81ef305688b6 GIT binary patch literal 5328 zcmaJ_cRbte*S3k()OZk7%~GwPwQ5z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