Skip to content

Commit b0847b4

Browse files
committed
[IMP] spreadsheet_oca: Extension views on separate files and added just after file
If this files aren't charged just after the main file if some module that is charged before spreadsheet_oca makes a primary template, the button will not be shown.
1 parent d9822d4 commit b0847b4

File tree

5 files changed

+61
-46
lines changed

5 files changed

+61
-46
lines changed

spreadsheet_oca/__manifest__.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,26 @@
2222
"assets": {
2323
"web.assets_backend": [
2424
"spreadsheet_oca/static/src/spreadsheet/spreadsheet.scss",
25-
"spreadsheet_oca/static/src/spreadsheet/spreadsheet.xml",
2625
"spreadsheet_oca/static/src/spreadsheet/spreadsheet_action.esm.js",
2726
"spreadsheet_oca/static/src/spreadsheet/pivot_controller.esm.js",
2827
"spreadsheet_oca/static/src/spreadsheet/graph_controller.esm.js",
2928
"spreadsheet_oca/static/src/spreadsheet/list_controller.esm.js",
3029
"spreadsheet_oca/static/src/spreadsheet/list_renderer.esm.js",
30+
(
31+
"after",
32+
"web/static/src/views/graph/graph_controller.xml",
33+
"spreadsheet_oca/static/src/spreadsheet/graph_controller.xml",
34+
),
35+
(
36+
"after",
37+
"web/static/src/views/list/list_controller.xml",
38+
"spreadsheet_oca/static/src/spreadsheet/list_controller.xml",
39+
),
40+
(
41+
"after",
42+
"web/static/src/views/pivot/pivot_controller.xml",
43+
"spreadsheet_oca/static/src/spreadsheet/pivot_controller.xml",
44+
),
3145
],
3246
"spreadsheet.o_spreadsheet": [
3347
"spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<templates xml:space="preserve">
3+
<t t-inherit="web.GraphView.Buttons" t-inherit-mode="extension" owl="1">
4+
<xpath expr="//button[hasclass('fa-pie-chart')]" position="after">
5+
<button
6+
class="btn btn-secondary fa fa-table"
7+
t-on-click="onSpreadsheetButtonClicked"
8+
data-tooltip="Add to spreadsheet"
9+
aria-label="Add to spreadsheet"
10+
t-attf-disabled="{{noDataDisplayed ? 'disabled' : false}}"
11+
/>
12+
13+
</xpath>
14+
</t>
15+
</templates>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<templates xml:space="preserve">
3+
<t t-inherit="web.ListView.Buttons" t-inherit-mode="extension" owl="1">
4+
<xpath expr="//button[hasclass('o_list_export_xlsx')]/.." position="after">
5+
<t t-if="!env.isSmall">
6+
<button
7+
type="button"
8+
class="btn btn-secondary fa fa-table o_list_export_spreadsheet"
9+
data-tooltip="Add to spreadsheet"
10+
aria-label="Add to spreadesheet"
11+
t-on-click="(ev) => this.onSpreadsheetButtonClicked(ev)"
12+
/>
13+
</t>
14+
</xpath>
15+
</t>
16+
</templates>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<templates xml:space="preserve">
3+
<t t-inherit="web.PivotView.Buttons" t-inherit-mode="extension" owl="1">
4+
<xpath expr="//button[hasclass('o_pivot_download')]" position="after">
5+
<div t-att-data-tooltip="getSpreadsheetInsertionTooltip()">
6+
<button
7+
class="btn btn-secondary fa fa-table"
8+
t-on-click="onSpreadsheetButtonClicked"
9+
aria-label="Add to spreadsheet"
10+
t-att-disabled="disableSpreadsheetInsertion()"
11+
/>
12+
</div>
13+
</xpath>
14+
</t>
15+
</templates>

spreadsheet_oca/static/src/spreadsheet/spreadsheet.xml

-45
This file was deleted.

0 commit comments

Comments
 (0)