# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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 Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ############################################################################## import wizard import pooler import time from tools.translate import _ def _action_open_window(self, cr, uid, data, context): domain = [] from_date = data['form']['from_date'] to_date = data['form']['to_date'] if from_date and to_date: domain = [('date','>=',from_date),('date','<=',to_date)] elif from_date: domain = [('date','>=',from_date)] elif to_date: domain = [('date','<=',to_date)] mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data') result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter') id = mod_obj.read(cr, uid, result, ['res_id']) return { 'name': _('Analytic Entries'), 'view_type': 'form', "view_mode": 'tree,form', 'res_model': 'account.analytic.line', 'type': 'ir.actions.act_window', 'domain': domain, 'search_view_id': id['res_id'],} class account_analytic_line(wizard.interface): form1 = '''