[FIX] website: remove backslash from redirect with enable_editor
[odoo/odoo.git] / addons / report_webkit / header.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) 
5 # All Right Reserved
6 #
7 # Author : Nicolas Bessi (Camptocamp)
8 #
9 # WARNING: This program as such is intended to be used by professional
10 # programmers who take the whole responsability of assessing all potential
11 # consequences resulting from its eventual inadequacies and bugs
12 # End users who are looking for a ready-to-use solution with commercial
13 # garantees and support are strongly adviced to contract a Free Software
14 # Service Company
15 #
16 # This program is Free Software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License
18 # as published by the Free Software Foundation; either version 2
19 # of the License, or (at your option) any later version.
20 #
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 # GNU General Public License for more details.
25 #
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
29 #
30 ##############################################################################
31
32 from openerp.osv import fields, osv
33
34 class HeaderHTML(osv.osv):
35     """HTML Header allows you to define HTML CSS and Page format"""
36
37     _name = "ir.header_webkit"
38     _columns = {
39         'company_id' : fields.many2one('res.company', 'Company'),
40         'html' : fields.text('webkit header', help="Set Webkit Report Header"),
41         'footer_html' : fields.text('webkit footer', help="Set Webkit Report Footer."),
42         'css' : fields.text('Header CSS'),
43         'name' : fields.char('Name', size=128, required=True),
44         'margin_top' : fields.float('Top Margin (mm)'),
45         'margin_bottom' : fields.float('Bottom Margin (mm)'),
46         'margin_left' : fields.float('Left Margin (mm)'),
47         'margin_right' : fields.float('Right Margin (mm)'),
48         'orientation' : fields.selection(
49                         [('Landscape','Landscape'),('Portrait', 'Portrait')],
50                         'Orientation'
51                         ),
52         'format': fields.selection(
53                 [
54                 ('A0' ,'A0  5   841 x 1189 mm'),
55                 ('A1' ,'A1  6   594 x 841 mm'),
56                 ('A2' ,'A2  7   420 x 594 mm'),
57                 ('A3' ,'A3  8   297 x 420 mm'),
58                 ('A4' ,'A4  0   210 x 297 mm, 8.26 x 11.69 inches'),
59                 ('A5' ,'A5  9   148 x 210 mm'),
60                 ('A6' ,'A6  10  105 x 148 mm'),
61                 ('A7' ,'A7  11  74 x 105 mm'),
62                 ('A8' ,'A8  12  52 x 74 mm'),
63                 ('A9' ,'A9  13  37 x 52 mm'),
64                 ('B0' ,'B0  14  1000 x 1414 mm'),
65                 ('B1' ,'B1  15  707 x 1000 mm'),
66                 ('B2' ,'B2  17  500 x 707 mm'),
67                 ('B3' ,'B3  18  353 x 500 mm'),
68                 ('B4' ,'B4  19  250 x 353 mm'),
69                 ('B5' ,'B5  1   176 x 250 mm, 6.93 x 9.84 inches'),
70                 ('B6' ,'B6  20  125 x 176 mm'),
71                 ('B7' ,'B7  21  88 x 125 mm'),
72                 ('B8' ,'B8  22  62 x 88 mm'),
73                 ('B9' ,'B9  23  33 x 62 mm'),
74                 ('B10',':B10    16  31 x 44 mm'),
75                 ('C5E','C5E 24  163 x 229 mm'),
76                 ('Comm10E','Comm10E 25  105 x 241 mm, U.S. Common 10 Envelope'),
77                 ('DLE', 'DLE 26 110 x 220 mm'),
78                 ('Executive','Executive 4   7.5 x 10 inches, 190.5 x 254 mm'),
79                 ('Folio','Folio 27  210 x 330 mm'),
80                 ('Ledger', 'Ledger  28  431.8 x 279.4 mm'),
81                 ('Legal', 'Legal    3   8.5 x 14 inches, 215.9 x 355.6 mm'),
82                 ('Letter','Letter 2 8.5 x 11 inches, 215.9 x 279.4 mm'),
83                 ('Tabloid', 'Tabloid 29 279.4 x 431.8 mm'),
84                 ],
85                 'Paper size',
86                 required=True,
87                 help="Select Proper Paper size"
88         )
89     }
90
91 class HeaderImage(osv.osv):
92     """Logo allows you to define multiple logo per company"""
93     _name = "ir.header_img"
94     _columns = {
95         'company_id' : fields.many2one('res.company', 'Company'),
96         'img' : fields.binary('Image'),
97         'name' : fields.char('Name', size=128, required =True, help="Name of Image"),
98         'type' : fields.char('Type', size=32, required =True, help="Image type(png,gif,jpeg)")
99     }
100
101 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: