Skip to content

Commit d6bf124

Browse files
committed
pre-commit: xml autoformat
1 parent e199dae commit d6bf124

27 files changed

+1316
-982
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ repos:
2121
rev: "1.19.1"
2222
hooks:
2323
- id: prettier
24+
# TODO Avoid awebdeveloper/pre-commit-prettier if possible
25+
# HACK https://github.com/prettier/prettier/issues/7407
26+
- repo: https://github.com/awebdeveloper/pre-commit-prettier
27+
rev: v0.0.1
28+
hooks:
29+
- id: prettier
30+
name: prettier xml plugin
31+
additional_dependencies:
32+
33+
- "@prettier/[email protected]"
34+
files: \.xml$
2435
- repo: https://github.com/pre-commit/mirrors-eslint
2536
rev: v6.8.0
2637
hooks:
@@ -67,11 +78,11 @@ repos:
6778
name: pylint with optional checks
6879
args: ["--rcfile=.pylintrc", "--exit-zero"]
6980
verbose: true
70-
additional_dependencies: ["pylint-odoo==3.0.3"]
81+
additional_dependencies: ["pylint-odoo==3.1.0"]
7182
- id: pylint
7283
name: pylint with mandatory checks
7384
args: ["--rcfile=.pylintrc-mandatory"]
74-
additional_dependencies: ["pylint-odoo==3.0.3"]
85+
additional_dependencies: ["pylint-odoo==3.1.0"]
7586
- repo: https://github.com/asottile/pyupgrade
7687
rev: v1.26.2
7788
hooks:

.prettierrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ printWidth: 88
55
proseWrap: always
66
semi: true
77
trailingComma: "es5"
8+
xmlWhitespaceSensitivity: "ignore"

mis_builder/datas/ir_cron.xml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<odoo noupdate="1">
3-
4-
<record id="ir_cron_vacuum_temp_reports" model="ir.cron">
5-
<field name="name">Vacuum temporary reports</field>
6-
<field name="interval_number">4</field>
7-
<field name="interval_type">hours</field>
8-
<field name="numbercall">-1</field>
9-
<field eval="False" name="doall"/>
10-
<field ref="model_mis_report_instance" name="model_id"/>
11-
<field name="code">model._vacuum_report()</field>
12-
<field name="active" eval="True" />
13-
</record>
14-
3+
<record id="ir_cron_vacuum_temp_reports" model="ir.cron">
4+
<field name="name">Vacuum temporary reports</field>
5+
<field name="interval_number">4</field>
6+
<field name="interval_type">hours</field>
7+
<field name="numbercall">-1</field>
8+
<field eval="False" name="doall" />
9+
<field ref="model_mis_report_instance" name="model_id" />
10+
<field name="code">model._vacuum_report()</field>
11+
<field name="active" eval="True" />
12+
</record>
1513
</odoo>
Lines changed: 100 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,118 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<odoo>
3-
43
<record id="qweb_pdf_export" model="ir.actions.report">
5-
<field name="name">MIS report instance QWEB PDF report</field>
6-
<field name="model">mis.report.instance</field>
7-
<field name="type">ir.actions.report</field>
8-
<field name="report_name">mis_builder.report_mis_report_instance</field>
9-
<field name="report_type">qweb-pdf</field>
4+
<field name="name">MIS report instance QWEB PDF report</field>
5+
<field name="model">mis.report.instance</field>
6+
<field name="type">ir.actions.report</field>
7+
<field name="report_name">mis_builder.report_mis_report_instance</field>
8+
<field name="report_type">qweb-pdf</field>
109
</record>
11-
1210
<template id="assets_report" inherit_id="web.report_assets_common">
1311
<xpath expr="." position="inside">
14-
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet"/>
12+
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet" />
1513
</xpath>
1614
</template>
17-
1815
<!--
1916
TODO we use divs with css table layout, but this has drawbacks:
2017
(bad layout of first column, no colspan for first header row),
2118
consider getting back to a plain HTML table.
2219
-->
23-
2420
<template id="report_mis_report_instance">
25-
<t t-call="web.html_container">
26-
<t t-foreach="docs" t-as="o">
27-
<t t-call="web.internal_layout">
28-
<t t-set="matrix" t-value="o._compute_matrix()"/>
29-
<t t-set="style_obj" t-value="o.env['mis.report.style']"/>
30-
<div class="page">
31-
<h3><span t-field="o.name" /><span> - </span>
32-
<t t-foreach="o.query_company_ids" t-as="company">
33-
<span t-field="company.name" /><span t-if="company != o.query_company_ids[-1]">, </span>
34-
</t>
35-
</h3>
36-
<p>
37-
<div class="mis_report_filers">
38-
<t t-foreach="o.get_filter_descriptions_from_context()" t-as="filter_description">
39-
<div>
40-
<span t-esc="filter_description"/>
41-
</div>
42-
</t>
43-
</div>
44-
</p>
45-
<div class="mis_table">
46-
<div class="mis_thead">
47-
<div class="mis_row">
48-
<div class="mis_cell mis_collabel"></div>
49-
<t t-foreach="matrix.iter_cols()" t-as="col">
50-
<div class="mis_cell mis_collabel">
51-
<t t-esc="col.label"/>
52-
<t t-if="col.description">
53-
<br/>
54-
<t t-esc="col.description"/>
55-
</t>
56-
</div>
57-
<!-- add empty cells because we have no colspan with css tables -->
58-
<t t-foreach="list(col.iter_subcols())[1:]" t-as="subcol">
59-
<div class="mis_cell mis_collabel"></div>
60-
</t>
61-
</t>
62-
</div>
63-
<div class="mis_row">
64-
<div class="mis_cell mis_collabel"></div>
65-
<t t-foreach="matrix.iter_subcols()" t-as="subcol">
66-
<div class="mis_cell mis_collabel">
67-
<t t-esc="subcol.label"/>
68-
<t t-if="subcol.description">
69-
<br/>
70-
<t t-esc="subcol.description"/>
71-
</t>
72-
</div>
73-
</t>
74-
</div>
75-
</div>
76-
<div class="mis_tbody">
77-
<t t-foreach="matrix.iter_rows()" t-as="row">
78-
<div t-if="not ((row.style_props.hide_empty and row.is_empty()) or row.style_props.hide_always)" class="mis_row">
79-
<div t-att-style="style_obj.to_css_style(row.style_props)" class="mis_cell mis_rowlabel">
80-
<t t-esc="row.label"/>
81-
<t t-if="row.description">
82-
<br/>
83-
<t t-esc="row.description"/>
84-
</t>
85-
</div>
86-
<t t-foreach="row.iter_cells()" t-as="cell">
87-
<div t-att-style="cell and style_obj.to_css_style(cell.style_props) or ''" class="mis_cell mis_amount">
88-
<t t-esc="cell and cell.val_rendered or ''"/>
21+
<t t-call="web.html_container">
22+
<t t-foreach="docs" t-as="o">
23+
<t t-call="web.internal_layout">
24+
<t t-set="matrix" t-value="o._compute_matrix()" />
25+
<t t-set="style_obj" t-value="o.env['mis.report.style']" />
26+
<div class="page">
27+
<h3>
28+
<span t-field="o.name" />
29+
<span> - </span>
30+
<t t-foreach="o.query_company_ids" t-as="company">
31+
<span t-field="company.name" />
32+
<span
33+
t-if="company != o.query_company_ids[-1]"
34+
>, </span>
35+
</t>
36+
</h3>
37+
<p>
38+
<div class="mis_report_filers">
39+
<t
40+
t-foreach="o.get_filter_descriptions_from_context()"
41+
t-as="filter_description"
42+
>
43+
<div>
44+
<span t-esc="filter_description" />
45+
</div>
46+
</t>
47+
</div>
48+
</p>
49+
<div class="mis_table">
50+
<div class="mis_thead">
51+
<div class="mis_row">
52+
<div class="mis_cell mis_collabel" />
53+
<t t-foreach="matrix.iter_cols()" t-as="col">
54+
<div class="mis_cell mis_collabel">
55+
<t t-esc="col.label" />
56+
<t t-if="col.description">
57+
<br />
58+
<t t-esc="col.description" />
59+
</t>
60+
</div>
61+
<!-- add empty cells because we have no colspan with css tables -->
62+
<t
63+
t-foreach="list(col.iter_subcols())[1:]"
64+
t-as="subcol"
65+
>
66+
<div class="mis_cell mis_collabel" />
67+
</t>
68+
</t>
69+
</div>
70+
<div class="mis_row">
71+
<div class="mis_cell mis_collabel" />
72+
<t t-foreach="matrix.iter_subcols()" t-as="subcol">
73+
<div class="mis_cell mis_collabel">
74+
<t t-esc="subcol.label" />
75+
<t t-if="subcol.description">
76+
<br />
77+
<t t-esc="subcol.description" />
78+
</t>
79+
</div>
80+
</t>
81+
</div>
82+
</div>
83+
<div class="mis_tbody">
84+
<t t-foreach="matrix.iter_rows()" t-as="row">
85+
<div
86+
t-if="not ((row.style_props.hide_empty and row.is_empty()) or row.style_props.hide_always)"
87+
class="mis_row"
88+
>
89+
<div
90+
t-att-style="style_obj.to_css_style(row.style_props)"
91+
class="mis_cell mis_rowlabel"
92+
>
93+
<t t-esc="row.label" />
94+
<t t-if="row.description">
95+
<br />
96+
<t t-esc="row.description" />
97+
</t>
98+
</div>
99+
<t t-foreach="row.iter_cells()" t-as="cell">
100+
<div
101+
t-att-style="cell and style_obj.to_css_style(cell.style_props) or ''"
102+
class="mis_cell mis_amount"
103+
>
104+
<t
105+
t-esc="cell and cell.val_rendered or ''"
106+
/>
107+
</div>
108+
</t>
109+
</div>
110+
</t>
111+
</div>
89112
</div>
90-
</t>
91113
</div>
92-
</t>
93-
</div>
94-
</div>
95-
</div>
96-
</t>
114+
</t>
115+
</t>
97116
</t>
98-
</t>
99117
</template>
100-
101118
</odoo>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<odoo>
3-
43
<record id="xls_export" model="ir.actions.report">
54
<field name="name">MIS report instance XLS report</field>
65
<field name="model">mis.report.instance</field>
@@ -9,5 +8,4 @@
98
<field name="report_type">xlsx</field>
109
<field name="report_file">mis_report_instance</field>
1110
</record>
12-
1311
</odoo>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo>
3-
43
<record id="mis_builder_multi_company_rule" model="ir.rule">
54
<field name="name">Mis Report Instance multi company</field>
6-
<field name="model_id" ref="model_mis_report_instance"/>
7-
<field name="domain_force">['|',('company_id','=',False),('company_id','in',company_ids)]</field>
5+
<field name="model_id" ref="model_mis_report_instance" />
6+
<field
7+
name="domain_force"
8+
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
89
</record>
9-
1010
</odoo>

0 commit comments

Comments
 (0)