Files
odoo_source/addons/web/models/report_layout.py
T
Christophe Matthieu 61eef73b52 [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).
2018-08-13 17:09:28 +02:00

18 lines
425 B
Python

# -*- coding: ascii -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import fields, models
_logger = logging.getLogger(__name__)
class View(models.Model):
_name = "report.layout"
view_id = fields.Many2one('ir.ui.view', 'Document Template', required=True)
image = fields.Char(string="Preview image src")
pdf = fields.Char(string="Preview pdf src")