1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
6
# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $
8
# WARNING: This program as such is intended to be used by professional
9
# programmers who take the whole responsability of assessing all potential
10
# consequences resulting from its eventual inadequacies and bugs
11
# End users who are looking for a ready-to-use solution with commercial
12
# garantees and support are strongly adviced to contract a Free Software
15
# This program is Free Software; you can redistribute it and/or
16
# modify it under the terms of the GNU General Public License
17
# as published by the Free Software Foundation; either version 2
18
# of the License, or (at your option) any later version.
20
# This program is distributed in the hope that it will be useful,
21
# but WITHOUT ANY WARRANTY; without even the implied warranty of
22
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
# GNU General Public License for more details.
25
# You should have received a copy of the GNU General Public License
26
# along with this program; if not, write to the Free Software
27
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29
##############################################################################
32
from osv import fields, osv
34
from tools.misc import currency
37
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
40
class color_rml(osv.osv):
42
_description = "Rml Colors"
44
'name': fields.char('Name', size=64, required=True),
45
'code': fields.char('code',size=64,required=True),
50
class account_report_bs(osv.osv):
51
_name = "account.report.bs"
52
_description = "Account reporting for Balance Sheet"
55
('Courier','Courier'),
56
('Courier-Bold','Courier-Bold'),
57
('Courier-BoldOblique','Courier-BoldOblique'),
58
('Courier-Oblique','Courier-Oblique'),
59
('Helvetica','Helvetica'),
60
('Helvetica-Bold','Helvetica-Bold'),
61
('Helvetica-Oblique','Helvetica-Oblique'),
63
('Times-Bold','Times-Bold'),
64
('Times-BoldItalic','Times-BoldItalic'),
65
('Times-Italic','Times-Italic'),
66
('Times-Roman','Times-Roman'),
76
('lightblue','Light Blue'),
86
def onchange_parent_id(self, cr, uid, ids, parent_id):
89
acc=self.pool.get('account.report.report').browse(cr,uid,parent_id)
91
if int(acc.style) < 6:
92
v['style'] = str(int(acc.style)+1)
96
'name': fields.char('Name', size=64, required=True),
97
'sequence': fields.integer('Sequence'),
98
'code': fields.char('Code', size=64, required=True),
99
'account_id': fields.many2many('account.account', 'account_report_rel', 'report_id', 'account_id', 'Accounts'),
100
'note': fields.text('Note'),
101
# 'style': fields.selection(_style, 'Style'),
102
'color_font' : fields.many2one('color.rml','Font Color'),
103
'color_back' : fields.many2one('color.rml','Back Color'),
104
'font_style' : fields.selection(_font, 'Font'),
105
'parent_id': fields.many2one('account.report.bs', 'Parent'),
106
'child_id': fields.one2many('account.report.bs', 'parent_id', 'Childs'),
109
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
116
ids = self.search(cr, user, [('code','=',name)]+ args, limit=limit, context=context)
118
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
120
ids = self.search(cr, user, args, limit=limit, context=context)
121
return self.name_get(cr, user, ids, context=context)
124
('code_uniq', 'unique (code)', 'The code of the report entry must be unique !')