# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################## import time import netsvc from osv import fields, osv import pooler from tools.misc import currency import mx.DateTime from mx.DateTime import RelativeDateTime, now, DateTime, localtime class account_report(osv.osv): _name = "account.report.report" _description = "Account reporting" # _color = [ # ('', ''), # ('green','Green'), # ('red','Red'), # ('pink','Pink'), # ('blue','Blue'), # ('yellow','Yellow'), # ('cyan','Cyan'), # ('lightblue','Light Blue'), # ('orange','Orange'), # ] # _style = [ # ('1','Header 1'), # ('2','Header 2'), # ('3','Header 3'), # ('4','Header 4'), # ('5','Normal'), # ('6', 'Small'), # ] def _amount_get(self, cr, uid, ids, field_name, arg, context={}): obj_fy=self.pool.get('account.fiscalyear') obj_period=self.pool.get('account.period') def _calc_context(key,obj): if key==0: return obj.find(cr,uid) else: obj_key=obj.browse(cr,uid,obj.find(cr,uid)) if isinstance(obj_key,list): obj_key=obj_key[0] key_ids=obj.search(cr,uid,[('date_stop','<',obj_key.date_start)]) if len(key_ids)