1 # -*- encoding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ##############################################################################
23 from osv import fields
27 from mx import DateTime
30 from tools import config
35 sale_forecast_res_form= """<?xml version="1.0"?>
36 <form string="Sale by User">
37 <field name="date_start" />
38 <field name="date_end" />
39 <field name="user_id" />
44 sale_forecast_res_field= {
45 'date_start': {'string':'Start Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
46 'date_end': {'string':'End Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
47 'user_id': {'string': 'Salesman', 'type': 'many2many', 'relation': 'res.users', 'required': True},
52 class wizard_pos_sales_user(wizard.interface):
57 'result' : {'type' : 'form',
58 'arch' : sale_forecast_res_form,
59 'fields' : sale_forecast_res_field,
60 'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
64 'result' : {'type' : 'print',
65 'report':'pos.sales.user',
69 wizard_pos_sales_user('pos.sales.user')