odoo-addon-mis-builder 17.0.1.3.0__py3-none-any.whl → 18.0.1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. odoo/addons/mis_builder/README.rst +7 -6
  2. odoo/addons/mis_builder/__manifest__.py +1 -1
  3. odoo/addons/mis_builder/datas/ir_cron.xml +1 -3
  4. odoo/addons/mis_builder/i18n/ca.po +8 -51
  5. odoo/addons/mis_builder/i18n/de.po +4 -39
  6. odoo/addons/mis_builder/i18n/el.po +4 -39
  7. odoo/addons/mis_builder/i18n/el_GR.po +4 -39
  8. odoo/addons/mis_builder/i18n/es.po +12 -65
  9. odoo/addons/mis_builder/i18n/fr.po +12 -65
  10. odoo/addons/mis_builder/i18n/hr.po +4 -39
  11. odoo/addons/mis_builder/i18n/it.po +13 -80
  12. odoo/addons/mis_builder/i18n/mis_builder.pot +18 -125
  13. odoo/addons/mis_builder/i18n/nl.po +4 -39
  14. odoo/addons/mis_builder/i18n/nl_NL.po +4 -39
  15. odoo/addons/mis_builder/i18n/pt.po +4 -39
  16. odoo/addons/mis_builder/i18n/pt_BR.po +13 -64
  17. odoo/addons/mis_builder/i18n/sv.po +12 -64
  18. odoo/addons/mis_builder/i18n/tr.po +4 -39
  19. odoo/addons/mis_builder/i18n/zh_CN.po +78 -154
  20. odoo/addons/mis_builder/models/aep.py +62 -160
  21. odoo/addons/mis_builder/models/aggregate.py +4 -4
  22. odoo/addons/mis_builder/models/kpimatrix.py +9 -10
  23. odoo/addons/mis_builder/models/mis_kpi_data.py +5 -7
  24. odoo/addons/mis_builder/models/mis_report.py +47 -58
  25. odoo/addons/mis_builder/models/mis_report_instance.py +43 -24
  26. odoo/addons/mis_builder/models/mis_report_style.py +9 -12
  27. odoo/addons/mis_builder/models/mis_report_subreport.py +5 -4
  28. odoo/addons/mis_builder/models/prorata_read_group_mixin.py +51 -31
  29. odoo/addons/mis_builder/models/simple_array.py +2 -2
  30. odoo/addons/mis_builder/readme/CONTRIBUTORS.md +1 -0
  31. odoo/addons/mis_builder/report/mis_report_instance_xlsx.py +2 -2
  32. odoo/addons/mis_builder/static/description/index.html +5 -4
  33. odoo/addons/mis_builder/static/src/components/mis_report_widget.esm.js +38 -22
  34. odoo/addons/mis_builder/static/src/components/mis_report_widget.scss +9 -0
  35. odoo/addons/mis_builder/static/src/components/mis_report_widget.xml +16 -14
  36. odoo/addons/mis_builder/tests/__init__.py +1 -0
  37. odoo/addons/mis_builder/tests/common.py +2 -4
  38. odoo/addons/mis_builder/tests/fake_models.py +18 -1
  39. odoo/addons/mis_builder/tests/test_aep.py +7 -69
  40. odoo/addons/mis_builder/tests/test_data_sources.py +4 -11
  41. odoo/addons/mis_builder/tests/test_kpi_data.py +1 -5
  42. odoo/addons/mis_builder/tests/test_mis_report_instance.py +21 -17
  43. odoo/addons/mis_builder/tests/test_multi_company_aep.py +3 -3
  44. odoo/addons/mis_builder/tests/test_pro_rata_read_group.py +105 -0
  45. odoo/addons/mis_builder/views/mis_report.xml +38 -43
  46. odoo/addons/mis_builder/views/mis_report_instance.xml +38 -40
  47. odoo/addons/mis_builder/views/mis_report_style.xml +6 -6
  48. odoo/addons/mis_builder/wizard/mis_builder_dashboard.py +3 -3
  49. odoo/addons/mis_builder/wizard/mis_builder_dashboard.xml +6 -6
  50. {odoo_addon_mis_builder-17.0.1.3.0.dist-info → odoo_addon_mis_builder-18.0.1.1.0.dist-info}/METADATA +12 -11
  51. odoo_addon_mis_builder-18.0.1.1.0.dist-info/RECORD +87 -0
  52. odoo/addons/mis_builder/static/src/components/mis_report_widget.css +0 -67
  53. odoo_addon_mis_builder-17.0.1.3.0.dist-info/RECORD +0 -87
  54. {odoo_addon_mis_builder-17.0.1.3.0.dist-info → odoo_addon_mis_builder-18.0.1.1.0.dist-info}/WHEEL +0 -0
  55. {odoo_addon_mis_builder-17.0.1.3.0.dist-info → odoo_addon_mis_builder-18.0.1.1.0.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@
4
4
  import datetime
5
5
 
6
6
  import odoo.tests.common as common
7
- from odoo import fields
7
+ from odoo import Command, fields
8
8
  from odoo.tools.safe_eval import safe_eval
9
9
 
10
10
  from ..models.accounting_none import AccountingNone
@@ -43,7 +43,7 @@ class TestMultiCompanyAEP(common.TransactionCase):
43
43
  "account_ar_" + company_key,
44
44
  self.account_model.create(
45
45
  {
46
- "company_id": company.id,
46
+ "company_ids": [Command.link(company.id)],
47
47
  "code": "400AR",
48
48
  "name": "Receivable",
49
49
  "account_type": "asset_receivable",
@@ -57,7 +57,7 @@ class TestMultiCompanyAEP(common.TransactionCase):
57
57
  "account_in_" + company_key,
58
58
  self.account_model.create(
59
59
  {
60
- "company_id": company.id,
60
+ "company_ids": [Command.link(company.id)],
61
61
  "code": "700IN",
62
62
  "name": "Income",
63
63
  "account_type": "income",
@@ -0,0 +1,105 @@
1
+ # Copyright 2025 ACSONE SA/NV (<http://acsone.eu>)
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3
+
4
+ from odoo_test_helper import FakeModelLoader
5
+
6
+ from odoo.tests import TransactionCase
7
+
8
+
9
+ class TestProrataReadGroup(TransactionCase):
10
+ @classmethod
11
+ def setUpClass(cls):
12
+ super().setUpClass()
13
+ cls.loader = FakeModelLoader(cls.env, cls.__module__)
14
+ cls.loader.backup_registry()
15
+ from .fake_models import ProrataReadGroupThing
16
+
17
+ cls.loader.update_registry((ProrataReadGroupThing,))
18
+ cls.addClassCleanup(cls.loader.restore_registry)
19
+
20
+ cls.thing_model = cls.env["prorata.read.group.thing"]
21
+ cls.thing_model.create(
22
+ {
23
+ "date_from": "2024-01-01",
24
+ "date_to": "2024-01-05",
25
+ "account_code": "A1",
26
+ "debit": 7,
27
+ "credit": 0,
28
+ }
29
+ )
30
+ cls.thing_model.create(
31
+ {
32
+ "date_from": "2024-01-01",
33
+ "date_to": "2024-01-20",
34
+ "account_code": "A1",
35
+ "debit": 200,
36
+ "credit": 0,
37
+ }
38
+ )
39
+ cls.thing_model.create(
40
+ {
41
+ "date_from": "2024-01-15",
42
+ "date_to": "2024-01-20",
43
+ "account_code": "A1",
44
+ "debit": 11,
45
+ "credit": 0,
46
+ }
47
+ )
48
+
49
+ def test_prorata_read_group(self):
50
+ """Test a pro-rata read_group with a date period."""
51
+ data = self.thing_model.read_group(
52
+ [("date", ">=", "2024-01-11"), ("date", "<=", "2024-01-20")],
53
+ fields=["debit", "credit", "account_code", "company_id"],
54
+ groupby=["account_code", "company_id"],
55
+ lazy=False,
56
+ )[0]
57
+ self.assertEqual(data["debit"], 111)
58
+ self.assertEqual(data["credit"], 0)
59
+ self.assertEqual(data["account_code"], "A1")
60
+ self.assertEqual(
61
+ data["company_id"], (self.env.company.id, self.env.company.name)
62
+ )
63
+
64
+ def test_read_group(self):
65
+ """Test a regular read_group without date filtering still works."""
66
+ data = self.thing_model.read_group(
67
+ domain=[],
68
+ fields=["debit", "credit", "account_code", "company_id"],
69
+ groupby=["account_code", "company_id"],
70
+ lazy=False,
71
+ )[0]
72
+ self.assertEqual(data["debit"], 218)
73
+ self.assertEqual(data["credit"], 0)
74
+ self.assertEqual(data["account_code"], "A1")
75
+ self.assertEqual(
76
+ data["company_id"], (self.env.company.id, self.env.company.name)
77
+ )
78
+
79
+ def test_prorata_read_group_internal(self):
80
+ """Test a regular _read_group without date filtering still works."""
81
+ data = self.thing_model._read_group(
82
+ domain=[("date", ">=", "2024-01-11"), ("date", "<=", "2024-01-20")],
83
+ groupby=["account_code", "company_id"],
84
+ aggregates=["debit:sum", "credit:sum"],
85
+ )
86
+ self.assertEqual(
87
+ data,
88
+ [
89
+ ("A1", self.env.company, 111, 0),
90
+ ],
91
+ )
92
+
93
+ def test_read_group_internal(self):
94
+ """Test a regular _read_group without date filtering still works."""
95
+ data = self.thing_model._read_group(
96
+ domain=[],
97
+ groupby=["account_code", "company_id"],
98
+ aggregates=["debit:sum", "credit:sum"],
99
+ )
100
+ self.assertEqual(
101
+ data,
102
+ [
103
+ ("A1", self.env.company, 218, 0),
104
+ ],
105
+ )
@@ -1,13 +1,13 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
2
  <odoo>
3
- <record model="ir.ui.view" id="mis_report_view_tree">
4
- <field name="name">mis.report.view.tree</field>
3
+ <record model="ir.ui.view" id="mis_report_view_list">
4
+ <field name="name">mis.report.view.list</field>
5
5
  <field name="model">mis.report</field>
6
6
  <field name="arch" type="xml">
7
- <tree>
7
+ <list>
8
8
  <field name="name" />
9
9
  <field name="description" />
10
- </tree>
10
+ </list>
11
11
  </field>
12
12
  </record>
13
13
 
@@ -31,7 +31,7 @@
31
31
  colspan="2"
32
32
  context="{'default_report_id': id}"
33
33
  >
34
- <tree>
34
+ <list>
35
35
  <field name="sequence" widget="handle" />
36
36
  <field name="description" />
37
37
  <field name="name" />
@@ -45,7 +45,7 @@
45
45
  invisible="type == 'str'"
46
46
  />
47
47
  <field name="expression" />
48
- </tree>
48
+ </list>
49
49
  </field>
50
50
  </page>
51
51
  <page string="Queries">
@@ -55,7 +55,7 @@
55
55
  colspan="2"
56
56
  context="{'default_report_id': id}"
57
57
  >
58
- <tree editable="bottom">
58
+ <list editable="bottom">
59
59
  <field name="name" />
60
60
  <field name="model_id" />
61
61
  <field
@@ -70,16 +70,16 @@
70
70
  domain="[('model_id', '=', model_id), ('ttype', 'in', ('date', 'datetime'))]"
71
71
  />
72
72
  <field name="domain" />
73
- </tree>
73
+ </list>
74
74
  </field>
75
75
  </page>
76
76
  <page string="Sub KPI's">
77
77
  <field name="subkpi_ids" nolabel="1" colspan="2">
78
- <tree editable="bottom">
78
+ <list editable="bottom">
79
79
  <field name="sequence" widget="handle" />
80
80
  <field name="description" />
81
81
  <field name="name" />
82
- </tree>
82
+ </list>
83
83
  </field>
84
84
  </page>
85
85
  <page string="Sub Reports">
@@ -89,13 +89,13 @@
89
89
  colspan="2"
90
90
  context="{'default_report_id': id}"
91
91
  >
92
- <tree editable="bottom">
92
+ <list editable="bottom">
93
93
  <field name="name" />
94
94
  <field
95
95
  name="subreport_id"
96
96
  domain="[('id', '!=', parent.id)]"
97
97
  />
98
- </tree>
98
+ </list>
99
99
  </field>
100
100
  </page>
101
101
  </notebook>
@@ -132,13 +132,13 @@
132
132
  nolabel="1"
133
133
  invisible="not multi"
134
134
  >
135
- <tree editable="bottom">
135
+ <list editable="bottom">
136
136
  <field
137
137
  name="subkpi_id"
138
138
  domain="[('report_id', '=', parent.report_id)]"
139
139
  />
140
140
  <field name="name" />
141
- </tree>
141
+ </list>
142
142
  </field>
143
143
  <field
144
144
  name="expression"
@@ -166,36 +166,31 @@
166
166
  <p
167
167
  > The following special elements are recognized in the expressions
168
168
  to compute accounting data: <code
169
- >{bal|crd|deb|pbal|nbal|fld}{pieu}(.fieldname)[account
169
+ >{bal|crd|deb|pbal|nbal}{pieu}[account
170
170
  selector][journal items domain]</code>. </p>
171
171
  <ul>
172
172
  <li>
173
173
  <code>bal</code>, <code>crd</code>, <code
174
- >deb</code>, <code>
175
- pbal</code>, <code>nbal</code>, <code
176
- >fld</code> : balance, debit, credit,
177
- positive balance, negative balance,
178
- other numerical field. </li>
174
+ >deb</code>, <code>
175
+ pbal</code>, <code
176
+ >nbal</code> : balance, debit, credit,
177
+ positive balance, negative balance. </li>
179
178
  <li>
180
179
  <code>p</code>, <code>i</code>, <code
181
- >e</code> : respectively variation over the period,
180
+ >e</code> : respectively variation over the period,
182
181
  initial balance, ending balance </li>
183
- <li>when <code
184
- >fld</code> is used : a field name specifier
185
- must be provided (e.g. <code
186
- >fldp.quantity</code></li>
187
182
  <li> The <b
188
- >account selector</b> is a like expression on the
183
+ >account selector</b> is a like expression on the
189
184
  account code (eg <code
190
- >70%</code>, etc), or a domain over accounts
185
+ >70%</code>, etc), or a domain over accounts
191
186
  (eg <code
192
- >[('code', 'like', '60%')]</code>). </li>
187
+ >[('code', 'like', '60%')]</code>). </li>
193
188
  <li> The <b
194
- >journal items domain</b> is an Odoo domain filter on
189
+ >journal items domain</b> is an Odoo domain filter on
195
190
  journal items. </li>
196
191
  <li>
197
192
  <code>balu[]</code> : (<code
198
- >u</code> for unallocated) is a special expression
193
+ >u</code> for unallocated) is a special expression
199
194
  that shows the unallocated profit/loss of previous fiscal
200
195
  years. </li>
201
196
  </ul>
@@ -203,7 +198,7 @@
203
198
  Expressions can involve other KPI, sub KPI and
204
199
  query results by name (eg <code>kpi1 + kpi2</code>,
205
200
  <code>kpi2.subkpi1</code>, <code
206
- >query1.field1</code>).
201
+ >query1.field1</code>).
207
202
  </p>
208
203
  <p>
209
204
  Additionally following variables are available
@@ -217,15 +212,15 @@
217
212
  similar to the python builtins. </li>
218
213
  <li>
219
214
  <code>datetime</code>, <code
220
- >datetime</code>, <code
221
- >dateutil</code> : the python modules. </li>
215
+ >datetime</code>, <code
216
+ >dateutil</code> : the python modules. </li>
222
217
  <li>
223
218
  <code>date_from</code>, <code
224
- >date_to</code> : beginning and end date of the
219
+ >date_to</code> : beginning and end date of the
225
220
  period. </li>
226
221
  <li>
227
222
  <code
228
- >AccountingNone</code> : a null value that behaves as 0 in
223
+ >AccountingNone</code> : a null value that behaves as 0 in
229
224
  arithmetic operations. </li>
230
225
  </ul>
231
226
  </div>
@@ -234,19 +229,19 @@
234
229
  <ul>
235
230
  <li>
236
231
  <code
237
- >bal[70]</code> : variation of the balance of account 70 over
232
+ >bal[70]</code> : variation of the balance of account 70 over
238
233
  the period (it is the same as <code
239
- >balp[70]</code>. </li>
234
+ >balp[70]</code>. </li>
240
235
  <li>
241
236
  <code
242
- >bali[70,60]</code> : initial balance of accounts 70 and 60. </li>
237
+ >bali[70,60]</code> : initial balance of accounts 70 and 60. </li>
243
238
  <li>
244
239
  <code
245
- >bale[1%%]</code> : balance of accounts starting with 1 at
240
+ >bale[1%%]</code> : balance of accounts starting with 1 at
246
241
  end of period. </li>
247
242
  <li>
248
243
  <code
249
- >crdp[40%]</code> : sum of all credits on accounts starting
244
+ >crdp[40%]</code> : sum of all credits on accounts starting
250
245
  with 40 during the period. </li>
251
246
  <li>
252
247
  <code>
@@ -270,7 +265,7 @@
270
265
  : balance of move lines related to tax grid 56. </li>
271
266
  <li>
272
267
  <code
273
- >pbale[55%]</code> : sum of all ending balances of accounts
268
+ >pbale[55%]</code> : sum of all ending balances of accounts
274
269
  starting with 55 whose ending balance is positive. </li>
275
270
  </ul>
276
271
  </div>
@@ -282,9 +277,9 @@
282
277
  </record>
283
278
  <record model="ir.actions.act_window" id="mis_report_view_action">
284
279
  <field name="name">MIS Report Templates</field>
285
- <field name="view_id" ref="mis_report_view_tree" />
280
+ <field name="view_id" ref="mis_report_view_list" />
286
281
  <field name="res_model">mis.report</field>
287
- <field name="view_mode">tree,form</field>
282
+ <field name="view_mode">list,form</field>
288
283
  </record>
289
284
  <menuitem
290
285
  id="mis_report_conf_menu"
@@ -22,11 +22,11 @@
22
22
  </form>
23
23
  </field>
24
24
  </record>
25
- <record model="ir.ui.view" id="mis_report_instance_view_tree">
26
- <field name="name">mis.report.instance.view.tree</field>
25
+ <record model="ir.ui.view" id="mis_report_instance_view_list">
26
+ <field name="name">mis.report.instance.view.list</field>
27
27
  <field name="model">mis.report.instance</field>
28
28
  <field name="arch" type="xml">
29
- <tree>
29
+ <list>
30
30
  <button
31
31
  type="object"
32
32
  name="preview"
@@ -47,7 +47,7 @@
47
47
  <field name="currency_id" groups="base.group_multi_currency" />
48
48
  <field name="target_move" />
49
49
  <field name="pivot_date" />
50
- </tree>
50
+ </list>
51
51
  </field>
52
52
  </record>
53
53
  <record model="ir.ui.view" id="mis_report_instance_view_form">
@@ -136,9 +136,7 @@
136
136
  <group>
137
137
  <field name="date" />
138
138
  </group>
139
- <group>
140
-
141
- </group>
139
+ <group />
142
140
  <field
143
141
  name="period_ids"
144
142
  nolabel="1"
@@ -146,15 +144,14 @@
146
144
  required="comparison_mode"
147
145
  context="{'default_report_instance_id': id}"
148
146
  >
149
- <tree decoration-danger="not valid">
147
+ <list decoration-danger="not valid">
150
148
  <field name="sequence" widget="handle" />
151
149
  <field name="name" />
152
150
  <field name="source" />
153
151
  <field name="source_aml_model_id" />
154
152
  <field name="date_from" />
155
153
  <field name="date_to" />
156
- <field name="valid" invisible="1" />
157
- </tree>
154
+ </list>
158
155
  </field>
159
156
  </group>
160
157
  </page>
@@ -195,6 +192,7 @@
195
192
  <field name="landscape_pdf" />
196
193
  <field name="no_auto_expand_accounts" />
197
194
  <field name="display_columns_description" />
195
+ <field name="wide_display_by_default" />
198
196
  </group>
199
197
  </page>
200
198
  <page string="Widget">
@@ -215,9 +213,9 @@
215
213
  </record>
216
214
  <record model="ir.actions.act_window" id="mis_report_instance_view_action">
217
215
  <field name="name">MIS Reports</field>
218
- <field name="view_id" ref="mis_report_instance_view_tree" />
216
+ <field name="view_id" ref="mis_report_instance_view_list" />
219
217
  <field name="res_model">mis.report.instance</field>
220
- <field name="view_mode">tree,form</field>
218
+ <field name="view_mode">list,form</field>
221
219
  <field name="domain">[('temporary', '=', False)]</field>
222
220
  </record>
223
221
  <menuitem
@@ -253,42 +251,42 @@
253
251
  <sheet position="after">
254
252
  <footer>
255
253
  <button
256
- type="object"
257
- name="save_report"
258
- string="Save"
259
- icon="fa-save"
260
- class="btn"
261
- />
254
+ type="object"
255
+ name="save_report"
256
+ string="Save"
257
+ icon="fa-save"
258
+ class="btn"
259
+ />
262
260
  <button
263
- type="object"
264
- name="preview"
265
- string="Preview"
266
- icon="fa-search"
267
- class="btn"
268
- />
261
+ type="object"
262
+ name="preview"
263
+ string="Preview"
264
+ icon="fa-search"
265
+ class="btn"
266
+ />
269
267
  <button
270
- type="object"
271
- name="print_pdf"
272
- string="Print"
273
- icon="fa-print"
274
- class="btn"
275
- />
268
+ type="object"
269
+ name="print_pdf"
270
+ string="Print"
271
+ icon="fa-print"
272
+ class="btn"
273
+ />
276
274
  <button
277
- type="object"
278
- name="export_xls"
279
- string="Export"
280
- icon="fa-download"
281
- class="btn"
282
- /> or <button string="Cancel" class="oe_link" special="cancel" />
275
+ type="object"
276
+ name="export_xls"
277
+ string="Export"
278
+ icon="fa-download"
279
+ class="btn"
280
+ /> or <button string="Cancel" class="oe_link" special="cancel" />
283
281
  </footer>
284
282
  </sheet>
285
283
  </field>
286
284
  </record>
287
285
  <record model="ir.actions.act_window" id="last_mis_report_instance_view_action">
288
286
  <field name="name">Last Reports Generated</field>
289
- <field name="view_id" ref="mis_report_instance_view_tree" />
287
+ <field name="view_id" ref="mis_report_instance_view_list" />
290
288
  <field name="res_model">mis.report.instance</field>
291
- <field name="view_mode">tree,form</field>
289
+ <field name="view_mode">list,form</field>
292
290
  <field name="domain">[('temporary', '=', True)]</field>
293
291
  </record>
294
292
  <menuitem
@@ -337,14 +335,14 @@
337
335
  nolabel="1"
338
336
  colspan="2"
339
337
  >
340
- <tree editable="bottom">
338
+ <list editable="bottom">
341
339
  <field name="sign" />
342
340
  <field
343
341
  name="period_to_sum_id"
344
342
  domain="[('report_instance_id', '=', parent.report_instance_id), ('id', '!=', parent.id)]"
345
343
  options="{'no_create': True, 'no_open': True}"
346
344
  />
347
- </tree>
345
+ </list>
348
346
  </field>
349
347
  <field
350
348
  name="source_sumcol_accdet"
@@ -1,12 +1,12 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
2
  <odoo>
3
- <record model="ir.ui.view" id="mis_report_style_view_tree">
4
- <field name="name">mis.report.style.view.tree</field>
3
+ <record model="ir.ui.view" id="mis_report_style_view_list">
4
+ <field name="name">mis.report.style.view.list</field>
5
5
  <field name="model">mis.report.style</field>
6
6
  <field name="arch" type="xml">
7
- <tree>
7
+ <list>
8
8
  <field name="name" />
9
- </tree>
9
+ </list>
10
10
  </field>
11
11
  </record>
12
12
  <record id="mis_report_style_view_form" model="ir.ui.view">
@@ -62,9 +62,9 @@
62
62
  </record>
63
63
  <record model="ir.actions.act_window" id="mis_report_style_view_action">
64
64
  <field name="name">MIS Report Styles</field>
65
- <field name="view_id" ref="mis_report_style_view_tree" />
65
+ <field name="view_id" ref="mis_report_style_view_list" />
66
66
  <field name="res_model">mis.report.style</field>
67
- <field name="view_mode">tree,form</field>
67
+ <field name="view_mode">list,form</field>
68
68
  </record>
69
69
  <menuitem
70
70
  id="mis_report_style_view_menu"
@@ -46,8 +46,8 @@ class AddMisReportInstanceDashboard(models.TransientModel):
46
46
  .sudo()
47
47
  .create(
48
48
  {
49
- "name": "mis.report.instance.result.view.action.%d"
50
- % self.env.context["active_id"],
49
+ "name": f"mis.report.instance.result.view.action."
50
+ f"{self.env.context['active_id']}",
51
51
  "res_model": active_model,
52
52
  "res_id": active_id,
53
53
  "target": "current",
@@ -67,7 +67,7 @@ class AddMisReportInstanceDashboard(models.TransientModel):
67
67
  )
68
68
  arch = self.dashboard_id.view_id.arch
69
69
  if last_customization:
70
- arch = self.env["ir.ui.view.custom"].browse(last_customization[0].id).arch
70
+ arch = last_customization[0].arch
71
71
  new_arch = etree.fromstring(arch)
72
72
  column = new_arch.xpath("//column")[0]
73
73
  # Due to native dashboard doesn't support form view
@@ -11,12 +11,12 @@
11
11
  </group>
12
12
  <footer>
13
13
  <button
14
- name="action_add_to_dashboard"
15
- string="Add to dashboard"
16
- type="object"
17
- default_focus="1"
18
- class="oe_highlight"
19
- />
14
+ name="action_add_to_dashboard"
15
+ string="Add to dashboard"
16
+ type="object"
17
+ default_focus="1"
18
+ class="oe_highlight"
19
+ />
20
20
  or
21
21
  <button string="Cancel" class="oe_link" special="cancel" />
22
22
  </footer>