[REF] purchase: search view of purchase order and form view of merge order wizard
[odoo/odoo.git] / addons / pos_sales_user.py
1 # -*- encoding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution
5 #    Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6 #    $Id$
7 #
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.
12 #
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.
17 #
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/>.
20 #
21 ##############################################################################
22
23 from osv import fields
24 from osv import osv
25 import time
26 import ir
27 from mx import DateTime
28 import datetime
29 import pooler
30 from tools import config
31 import wizard
32 import netsvc
33
34
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" />
40
41 </form>
42 """
43
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},
48
49 }
50
51
52 class wizard_pos_sales_user(wizard.interface):
53
54     states = {
55         'init' : {
56             'actions' : [],
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') ]}
61         },
62         'print_report' : {
63             'actions' : [],
64             'result' : {'type' : 'print',
65                    'report':'pos.sales.user',
66                     'state' : 'end'}
67         },
68     }
69 wizard_pos_sales_user('pos.sales.user')