summaryrefslogtreecommitdiff
path: root/addons/web/data
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2018-07-26 09:55:01 +0200
committerChristophe Matthieu <chm@odoo.com>2018-08-13 17:09:28 +0200
commit61eef73b52c078daaae37f8d57e93830a2e53410 (patch)
tree8b144174691de487a584bf8ac449fb55d3ad12ab /addons/web/data
parent149eb38b07cace0ec2118d214c56995402008efc (diff)
[IMP] base, *: use a many2one for the company report layout
Before this rev. one could set the report layout on the company using a hardcoded list (background, clean, standard, etc.). Other modules (typically accounting modules) could add options in this list. The used template was built on the layout key. Now, the layout is a many2one field to a newly created model `report.layout`, which is linked to a view with the layout architecture. This gives more control to customize reports and create a new layout (without creating a python module that extend the layout selection).
Diffstat (limited to 'addons/web/data')
-rw-r--r--addons/web/data/report_layout.xml25
-rw-r--r--addons/web/data/res_company.xml8
2 files changed, 33 insertions, 0 deletions
diff --git a/addons/web/data/report_layout.xml b/addons/web/data/report_layout.xml
new file mode 100644
index 00000000000..afa8130d73a
--- /dev/null
+++ b/addons/web/data/report_layout.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+ <record id="report_layout_background" model="report.layout">
+ <field name="view_id" ref="web.external_layout_background"/>
+ <field name="image">/web/static/img/preview_background.png</field>
+ <field name="pdf">/web/static/pdf/preview_background.pdf</field>
+ </record>
+ <record id="report_layout_boxed" model="report.layout">
+ <field name="view_id" ref="web.external_layout_boxed"/>
+ <field name="image">/web/static/img/preview_boxed.png</field>
+ <field name="pdf">/web/static/pdf/preview_boxed.pdf</field>
+ </record>
+ <record id="report_layout_clean" model="report.layout">
+ <field name="view_id" ref="web.external_layout_clean"/>
+ <field name="image">/web/static/img/preview_clean.png</field>
+ <field name="pdf">/web/static/pdf/preview_clean.pdf</field>
+ </record>
+ <record id="report_layout_standard" model="report.layout">
+ <field name="view_id" ref="web.external_layout_standard"/>
+ <field name="image">/web/static/img/preview_standard.png</field>
+ <field name="pdf">/web/static/pdf/preview_standard.pdf</field>
+ </record>
+ </data>
+</odoo> \ No newline at end of file
diff --git a/addons/web/data/res_company.xml b/addons/web/data/res_company.xml
new file mode 100644
index 00000000000..44db6af8931
--- /dev/null
+++ b/addons/web/data/res_company.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data noupdate="1">
+ <record id="base.main_company" model="res.company">
+ <field name="external_report_layout_id" ref="web.external_layout_standard"/>
+ </record>
+ </data>
+</odoo> \ No newline at end of file