You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

230 lines
16 KiB

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
6 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Copyright 2019 Ecosoft Co., Ltd.
  4. License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).-->
  5. <odoo>
  6. <record id="view_xlsx_template_tree" model="ir.ui.view">
  7. <field name="model">xlsx.template</field>
  8. <field name="arch" type="xml">
  9. <tree string="XLSX Template">
  10. <field name="name"/>
  11. </tree>
  12. </field>
  13. </record>
  14. <record id="view_xlsx_template_form" model="ir.ui.view">
  15. <field name="model">xlsx.template</field>
  16. <field name="arch" type="xml">
  17. <form string="XLSX Template">
  18. <sheet>
  19. <h1>
  20. <field name="name" colspan="3"/>
  21. </h1>
  22. <group>
  23. <group>
  24. <field name="description"/>
  25. <field name="to_csv"/>
  26. <field name="csv_delimiter" attrs="{'invisible': [('to_csv', '=', False)]}"/>
  27. <field name="csv_extension" attrs="{'invisible': [('to_csv', '=', False)]}"/>
  28. <field name="csv_quote" attrs="{'invisible': [('to_csv', '=', False)]}"/>
  29. </group>
  30. <group>
  31. <field name="fname" invisible="1"/>
  32. <field name="datas" filename="fname"/>
  33. <field name="gname"/>
  34. <field name="res_model"/>
  35. <field name="redirect_action"/>
  36. </group>
  37. </group>
  38. <notebook>
  39. <page string="Export">
  40. <field name="export_ids">
  41. <tree name="export_instruction" editable="bottom">
  42. <control>
  43. <create string="Add sheet section" context="{'default_section_type': 'sheet'}"/>
  44. <create string="Add header section" context="{'default_section_type': 'head', 'default_row_field': '_HEAD_'}"/>
  45. <create string="Add row section" context="{'default_section_type': 'row'}"/>
  46. <create string="Add data column" context="{'default_section_type': 'data'}"/>
  47. </control>
  48. <field name="sequence" widget="handle"/>
  49. <field name="section_type" invisible="1"/>
  50. <field name="sheet" attrs="{'required': [('section_type', '=', 'sheet')],
  51. 'invisible': [('section_type', '!=', 'sheet')]}"/>
  52. <field name="row_field" attrs="{'required': [('section_type', 'in', ('head', 'row'))],
  53. 'invisible': [('section_type', 'not in', ('head', 'row'))]}"/>
  54. <field name="is_cont" attrs="{'required': [('section_type', 'in', ('head', 'row'))],
  55. 'invisible': [('section_type', 'not in', ('head', 'row'))]}"/>
  56. <field name="excel_cell" attrs="{'required': [('section_type', '=', 'data')],
  57. 'invisible': [('section_type', '!=', 'data')]}"/>
  58. <field name="field_name" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  59. <field name="field_cond" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  60. <field name="is_sum" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  61. <field name="style" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  62. <field name="style_cond" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  63. </tree>
  64. </field>
  65. <div style="margin-top: 4px;">
  66. <h3>Help with Export Instruction</h3>
  67. <p>
  68. Export Instruction is how to write data from an active data record to specified cells in excel sheet.
  69. For example, an active record can be a sale order that user want to export.
  70. The record itself will be mapped to the header part of excel sheet. The record can contain multiple one2many fields, which will be written as data lines.
  71. You can look at following instruction as Excel Sheet(s), each with 1 header section (_HEAD_) and multiple row sections (one2many fields).
  72. </p>
  73. <ul>
  74. <li>In header section part, map data fields (e.g., number, partner_id.name) into cells (e.g., B1, B2).</li>
  75. <li>In row section, data list will be rolled out from one2many row field (e.g., order_line), and map data field (i.e., product_id.name, uom_id.name, qty) into the first row cells to start rolling (e.g., A6, B6, C6).</li>
  76. </ul>
  77. <p>Following are more explaination on each column:</p>
  78. <ul>
  79. <li><b>Sheet</b>: Name (e.g., Sheet 1) or index (e.g., 1) of excel sheet to export data to</li>
  80. <li><b>Row Field</b>: Use _HEAD_ for the record itself, and one2many field (e.g., line_ids) for row data</li>
  81. <li><b>Continue</b>: If not selected, start rolling with specified first row cells. If selected, continue from previous one2many field</li>
  82. <li><b>Cell</b>: Location of data in excel sheet (e.g., A1, B1, ...)</li>
  83. <li><b>Field</b>: Field of the record, e.g., product_id.uom_id.name. They are orm compliant.</li>
  84. <li><b>Field Cond.</b>: Python code in <code>${...}</code> to manipulate field value, e.g., if field = product_id, <code>value</code> will represent product object, e.g., <code>${value and value.uom_id.name or ""}</code></li>
  85. <li><b>Sum</b>: Add sum value on last row, <code>@{sum}</code></li>
  86. <li><b>Style</b>: Default style in <code>#{...}</code> that apply to each cell, e.g., <code>#{align=left;style=text}</code>. See module's <b>style.py</b> for available styles.</li>
  87. <li><b>Style w/Cond.</b>: Conditional style by python code in <code>#?...?</code>, e.g., apply style for specific product, <code>#?value.name == "ABC" and #{font=bold;fill=red} or None?</code></li>
  88. </ul>
  89. <p><b>Note:</b></p>
  90. For code block <code>${...}</code> and <code>#?...?</code>, following object are available,
  91. <ul>
  92. <li><code>value</code>: value from <b>Field</b></li>
  93. <li><code>object</code>: record object or line object depends on <b>Row Field</b></li>
  94. <li><code>model</code>: active model, e.g., self.env['my.model']</li>
  95. <li><code>date, datetime, time</code>: some useful python classes</li>
  96. </ul>
  97. </div>
  98. </page>
  99. <page string="Import">
  100. <field name="import_ids">
  101. <tree name="import_instruction" editable="bottom">
  102. <control>
  103. <create string="Add sheet section" context="{'default_section_type': 'sheet'}"/>
  104. <create string="Add header section" context="{'default_section_type': 'head', 'default_row_field': '_HEAD_'}"/>
  105. <create string="Add row section" context="{'default_section_type': 'row'}"/>
  106. <create string="Add data column" context="{'default_section_type': 'data'}"/>
  107. </control>
  108. <field name="sequence" widget="handle"/>
  109. <field name="section_type" invisible="1"/>
  110. <field name="sheet" attrs="{'required': [('section_type', '=', 'sheet')],
  111. 'invisible': [('section_type', '!=', 'sheet')]}"/>
  112. <field name="row_field" attrs="{'required': [('section_type', 'in', ('head', 'row'))],
  113. 'invisible': [('section_type', 'not in', ('head', 'row'))]}"/>
  114. <field name="no_delete" attrs="{'invisible': [('section_type', '!=', 'row')]}"/>
  115. <field name="excel_cell" attrs="{'required': [('section_type', '=', 'data')],
  116. 'invisible': [('section_type', '!=', 'data')]}"/>
  117. <field name="field_name" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  118. <field name="field_cond" attrs="{'invisible': [('section_type', '!=', 'data')]}"/>
  119. </tree>
  120. </field>
  121. <group string="Post Import Hook">
  122. <field name="post_import_hook" placeholder="${object.post_import_do_something()}"/>
  123. </group>
  124. <hr/>
  125. <div style="margin-top: 4px;">
  126. <h3>Help with Import Instruction</h3>
  127. <p>
  128. Import Instruction is how to get data from excel sheet and write them to an active record.
  129. For example, user create a sales order document, and want to import order lines from excel.
  130. In reverse direction to exporting, data from excel's cells will be mapped to record fields during import.
  131. Cells can be mapped to record in header section (_HEAD_) and data table can be mapped to row section (one2many field, begins from specifed cells.
  132. </p>
  133. <ul>
  134. <li>In header section, map cells (e.g., B1, B2) into data fields (e.g., number, partner_id).</li>
  135. <li>In row section, data table from excel can be imported to one2many row field (e.g., order_line) by mapping cells on first row onwards (e.g., A6, B6, C6) to fields (e.g., product_id, uom_id, qty) </li>
  136. </ul>
  137. <p>Following are more explaination on each column:</p>
  138. <ul>
  139. <li><b>Sheet</b>: Name (e.g., Sheet 1) or index (e.g., 1) of excel sheet</li>
  140. <li><b>Row Field</b>: Use _HEAD_ for the record itself, and one2many field (e.g., line_ids) for row data</li>
  141. <li><b>No Delete</b>: By default, all one2many lines will be deleted before import. Select this, to avoid deletion</li>
  142. <li><b>Cell</b>: Location of data in excel sheet (e.g., A1, B1, ...)</li>
  143. <li><b>Field</b>: Field of the record to be imported to, e.g., product_id</li>
  144. <li><b>Field Cond.</b>: Python code in <code>${...}</code> value will represent data from excel cell, e.g., if A1 = 'ABC', <code>value</code> will represent 'ABC', e.g., <code>${value == "ABC" and "X" or "Y"}</code> thus can change from cell value to other value for import.</li>
  145. </ul>
  146. <p><b>Note:</b></p>
  147. For code block <code>${...}</code>, following object are available,
  148. <ul>
  149. <li><code>value</code>: value from <b>Cell</b></li>
  150. <li><code>model</code>: active model, e.g., self.env['my.model']</li>
  151. <li><code>date, datetime, time</code>: some useful python classes</li>
  152. </ul>
  153. </div>
  154. </page>
  155. <page string="Input Instruction (Dict.)">
  156. <field name="input_instruction"/>
  157. <field name="show_instruction"/><label for="show_instruction"/>
  158. <field name="instruction" attrs="{'invisible': [('show_instruction', '=', False)]}"/>
  159. <hr/>
  160. <div style="margin-top: 4px;">
  161. <h3>Sample Input Instruction as Dictionary</h3>
  162. <p>
  163. Following show very simple example of the dictionary construct.
  164. Normally, this will be within templates.xml file within addons.
  165. </p>
  166. <pre>
  167. <code class="oe_grey">
  168. {
  169. '__EXPORT__': {
  170. 'sale_order': { # sheet can be name (string) or index (integer)
  171. '_HEAD_': {
  172. 'B2': 'partner_id.display_name${value or ""}#{align=left;style=text}',
  173. 'B3': 'name${value or ""}#{align=left;style=text}',
  174. },
  175. 'line_ids': { # prefix with _CONT_ to continue rows from previous row field
  176. 'A6': 'product_id.display_name${value or ""}#{style=text}',
  177. 'C6': 'product_uom_qty${value or 0}#{style=number}',
  178. 'E6': 'price_unit${value or 0}#{style=number}',
  179. 'G6': 'price_subtotal${value or 0}#{style=number}',
  180. },
  181. },
  182. },
  183. '__IMPORT__': {
  184. 'sale_order': { # sheet can be name (string) or index (integer)
  185. 'order_line': { # prefix with _NODEL_ to not delete rows before import
  186. 'A6': 'product_id',
  187. 'C6': 'product_uom_qty',
  188. 'E6': 'price_unit${value > 0 and value or 0}',
  189. },
  190. },
  191. },
  192. '__POST_IMPORT__': '${object.post_import_do_something()}',
  193. }
  194. </code>
  195. </pre>
  196. </div>
  197. </page>
  198. </notebook>
  199. </sheet>
  200. </form>
  201. </field>
  202. </record>
  203. <record id="action_xlsx_template" model="ir.actions.act_window">
  204. <field name="name">XLSX Templates</field>
  205. <field name="type">ir.actions.act_window</field>
  206. <field name="res_model">xlsx.template</field>
  207. <field name="view_type">form</field>
  208. <field name="view_mode">tree,form</field>
  209. <field name="help" type="html">
  210. <p class="oe_view_nocontent_create">
  211. Click to create a XLSX Template Object.
  212. </p>
  213. </field>
  214. </record>
  215. <menuitem id="menu_excel_import_export"
  216. name="Excel Import/Export"
  217. parent="base.menu_custom"
  218. sequence="130"/>
  219. <menuitem id="menu_xlsx_template"
  220. parent="menu_excel_import_export"
  221. action="action_xlsx_template"
  222. sequence="10"/>
  223. </odoo>