Skip to content

Commit

Permalink
[MIG] spreadsheet_oca: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoRomera committed Jul 26, 2024
1 parent ae924b6 commit 754e885
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion spreadsheet_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Spreadsheet Oca",
"summary": """
Allow to edit spreadsheets""",
"version": "16.0.1.3.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "CreuBlanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/spreadsheet",
Expand Down
3 changes: 2 additions & 1 deletion spreadsheet_oca/models/ir_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def _build_bus_channel_list(self, channels):
model_name, "read", raise_exception=False
):
continue

Check warning on line 45 in spreadsheet_oca/models/ir_websocket.py

View check run for this annotation

Codecov / codecov/patch

spreadsheet_oca/models/ir_websocket.py#L45

Added line #L45 was not covered by tests
# If user don't have access to the model, we don't even try to read
# If user don't have access to the model, we don't
# even try to read

document = self.env[model_name].search(

Check warning on line 49 in spreadsheet_oca/models/ir_websocket.py

View check run for this annotation

Codecov / codecov/patch

spreadsheet_oca/models/ir_websocket.py#L49

Added line #L49 was not covered by tests
[("id", "=", res_id)], limit=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class SpreadsheetSpreadsheetImportMode(models.Model):
_name = "spreadsheet.spreadsheet.import.mode"
_description = "Import Mode"
_order = "sequence asc"
_order = "sequence asc, id"
_rec_name = "name"

sequence = fields.Integer(default=20)
Expand Down
32 changes: 13 additions & 19 deletions spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="spreadsheet_oca.ActionSpreadsheetOca" owl="1">
<t t-name="spreadsheet_oca.ActionSpreadsheetOca">
<div class="o_spreadsheet_oca_container">
<SpreadsheetControlPanel record="record" />
<SpreadsheetRenderer
Expand All @@ -12,13 +12,13 @@
/>
</div>
</t>
<t t-name="spreadsheet_oca.PivotPanel" owl="1">
<t t-name="spreadsheet_oca.PivotPanel">
<PivotPanelDisplay
pivotId="pivotId"
pivotDefinition="pivotDefinition"
/>
</t>
<t t-name="spreadsheet_oca.PivotPanelDisplay" owl="1">
<t t-name="spreadsheet_oca.PivotPanelDisplay">
<div class="o_spreadsheet_oca_datasource_panel">
<div class="o_spreadsheet_oca_datasource_panel_field">
<div
Expand Down Expand Up @@ -99,10 +99,10 @@

</t>

<t t-name="spreadsheet_oca.ListPanel" owl="1">
<t t-name="spreadsheet_oca.ListPanel">
<ListPanelDisplay listId="listId" listDefinition="listDefinition" />
</t>
<t t-name="spreadsheet_oca.ListPanelDisplay" owl="1">
<t t-name="spreadsheet_oca.ListPanelDisplay">
<div class="o_spreadsheet_oca_datasource_panel">
<div class="o_spreadsheet_oca_datasource_panel_field">
<div
Expand Down Expand Up @@ -139,7 +139,7 @@
</div>

</t>
<t t-name="spreadsheet_oca.FilterPanel" owl="1">
<t t-name="spreadsheet_oca.FilterPanel">
<div
t-foreach="env.model.getters.getGlobalFilters()"
t-as="filter"
Expand Down Expand Up @@ -172,7 +172,7 @@
>Add text</button>
</div>
</t>
<t t-name="spreadsheet_oca.EditFilterPanel" owl="1">
<t t-name="spreadsheet_oca.EditFilterPanel">
<div class="o_spreadsheet_oca_filter">
<div class="spreadsheet_oca_filter_label">
<span>Label</span>
Expand Down Expand Up @@ -312,7 +312,7 @@
<button t-on-click="onSave" class="btn btn-primary">Save</button>
</div>
</t>
<t t-name="spreadsheet_oca.SpreadsheetRenderer" owl="1">
<t t-name="spreadsheet_oca.SpreadsheetRenderer">
<Spreadsheet model="spreadsheet_model" />
<Dialog
title="state.dialogTitle"
Expand All @@ -338,7 +338,7 @@
</t>
</Dialog>
</t>
<t t-name="spreadsheet_oca.SpreadsheetName" owl="1">
<t t-name="spreadsheet_oca.SpreadsheetName">
<input
type="text"
class="o_spreadsheet_oca_name"
Expand All @@ -354,7 +354,7 @@
> name is required</span>
</t>

<t t-name="spreadsheet_oca.Breadcrumbs.Small" owl="1">
<t t-name="spreadsheet_oca.Breadcrumbs.Small">
<ol class="breadcrumb">
<t t-if="breadcrumbs.length > 1">
<t
Expand All @@ -377,7 +377,7 @@
</t>


<t t-name="spreadsheet_oca.Breadcrumbs" owl="1">
<t t-name="spreadsheet_oca.Breadcrumbs">
<ol class="breadcrumb">
<t
t-foreach="breadcrumbs"
Expand Down Expand Up @@ -415,7 +415,7 @@
</ol>
</t>

<t t-name="spreadsheet_oca.SpreadsheetControlPanel" owl="1">
<t t-name="spreadsheet_oca.SpreadsheetControlPanel">
<div class="o_control_panel" t-ref="root">
<div t-if="display['top']" class="o_cp_top">
<div
Expand All @@ -441,7 +441,7 @@
</div>
</div>
</t>
<t t-name="spreadsheet_oca.OdooPanel" owl="1">
<t t-name="spreadsheet_oca.OdooPanel">
<div class="o-section">
<div class="o-section-title">Link to Odoo menu</div>
<div class="o-section-value">
Expand All @@ -459,7 +459,6 @@
t-name="spreadsheet_oca.OdooStackablePanel"
t-inherit="spreadsheet_oca.OdooPanel"
t-inherit-mode="primary"
owl="1"
>
<xpath expr="div[hasclass('o-section')]" position="before">
<div class="o-section">
Expand All @@ -480,7 +479,6 @@
<t
t-inherit="spreadsheet.o-spreadsheet-BarConfigPanel"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div" position="inside">
<div class="o-section">
Expand All @@ -500,7 +498,6 @@
<t
t-inherit="spreadsheet.o-spreadsheet-LineConfigPanel"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div" position="inside">
<div class="o-section">
Expand All @@ -520,7 +517,6 @@
<t
t-inherit="spreadsheet.o-spreadsheet-LineBarPieConfigPanel"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div" position="inside">
<div class="o-section">
Expand All @@ -540,7 +536,6 @@
<t
t-inherit="spreadsheet.o-spreadsheet-GaugeChartConfigPanel"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div" position="inside">
<div class="o-section">
Expand All @@ -560,7 +555,6 @@
<t
t-inherit="spreadsheet.o-spreadsheet-ScorecardChartConfigPanel"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div" position="inside">
<div class="o-section">
Expand Down
6 changes: 3 additions & 3 deletions spreadsheet_oca/static/src/spreadsheet/spreadsheet.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-inherit="web.PivotView.Buttons" t-inherit-mode="extension" owl="1">
<t t-inherit="web.PivotView.Buttons" t-inherit-mode="extension">
<xpath expr="//button[hasclass('o_pivot_download')]" position="after">
<div t-att-data-tooltip="getSpreadsheetInsertionTooltip()">
<button
Expand All @@ -14,7 +14,7 @@
</xpath>
</t>

<t t-inherit="web.ListView.Buttons" t-inherit-mode="extension" owl="1">
<t t-inherit="web.ListView.Buttons" t-inherit-mode="extension">
<xpath
expr="//button[hasclass('o_list_export_xlsx')]/.."
position="after"
Expand All @@ -32,7 +32,7 @@
</t>


<t t-inherit="web.GraphView.Buttons" t-inherit-mode="extension" owl="1">
<t t-inherit="web.GraphView.Buttons" t-inherit-mode="extension">
<xpath expr="//button[hasclass('fa-pie-chart')]" position="after">
<button
class="btn btn-secondary fa fa-table"
Expand Down
2 changes: 1 addition & 1 deletion spreadsheet_oca/views/spreadsheet_spreadsheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<field name="action" ref="spreadsheet_spreadsheet_act_window" />
<field
name="web_icon"
>spreadsheet_oca,static/description/icon.svg</field>
>spreadsheet_oca,static/description/icon.png</field>
<field
name="groups_id"
eval="[(4, ref('spreadsheet_oca.group_user'))]"
Expand Down
12 changes: 8 additions & 4 deletions spreadsheet_oca/wizards/spreadsheet_spreadsheet_import.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,31 @@
<field name="mode_id" widget="selection_badge" />
<field
name="name"
attrs="{'invisible': [('mode', '!=', 'new')], 'required': [('mode', '=', 'new')]}"
invisible="mode != 'new'"
required="mode == 'new'"
/>
<field name="datasource_name" required="1" />
<field name="mode" invisible="1" />
<field name="import_data" invisible="1" />
<field
name="spreadsheet_id"
domain="['|', ('owner_id', '=', uid), ('contributor_ids', '=', uid)]"
attrs="{'invisible': [('mode', 'not in', ['add', 'add_sheet'])], 'required': [('mode', 'in', ['add', 'add_sheet'])]}"
invisible="mode not in ['add', 'add_sheet']"
required="mode in ['add', 'add_sheet']"
options="{'no_create': True}"
/>
<field name="can_be_dynamic" invisible="1" />
<field name="is_tree" invisible="1" />
<field
name="dynamic"
force_save="1"
attrs="{'invisible': [('can_be_dynamic', '=', False)], 'readonly': [('is_tree', '=', True)]}"
invisible="not can_be_dynamic"
readonly="is_tree"
/>
<field
name="number_of_rows"
attrs="{'invisible': [('dynamic', '=', False)], 'required': [('dynamic', '=', True)]}"
invisible="not dynamic"
required="dynamic"
/>
</group>
</sheet>
Expand Down

0 comments on commit 754e885

Please sign in to comment.