~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to travel/custom.py

  • Committer: Fabien Pinckaers
  • Date: 2008-11-12 06:43:12 UTC
  • Revision ID: fp@tinyerp.com-20081112064312-fp85io97i1e95tuz
moved

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
##############################################################################
1
22
from osv import osv, fields
2
23
 
3
24
class travel_hostel(osv.osv):
4
 
        _name = 'travel.hostel'
5
 
        _inherit = 'res.partner'
6
 
        _table = 'res_partner'
7
 
        _columns = {
8
 
                'rooms_id': fields.one2many('travel.room', 'hostel_id', 'Rooms'),
9
 
                'quality': fields.char('Quality', size=16),
10
 
        }
 
25
    _name = 'travel.hostel'
 
26
    _inherit = 'res.partner'
 
27
    _table = 'res_partner'
 
28
    _columns = {
 
29
        'rooms_id': fields.one2many('travel.room', 'hostel_id', 'Rooms'),
 
30
        'quality': fields.char('Quality', size=16),
 
31
    }
11
32
travel_hostel()
12
33
 
13
34
class travel_airport(osv.osv):
14
 
        _name = 'travel.airport'
15
 
        _columns = {
16
 
                'name': fields.char('Airport name', size=16),
17
 
                'city': fields.char('City', size=16),
18
 
                'country': fields.many2one('res.country', 'Country')
19
 
        }
 
35
    _name = 'travel.airport'
 
36
    _columns = {
 
37
        'name': fields.char('Airport name', size=16),
 
38
        'city': fields.char('City', size=16),
 
39
        'country': fields.many2one('res.country', 'Country')
 
40
    }
20
41
travel_airport()
21
42
 
22
43
class travel_room(osv.osv):
23
 
        _name = 'travel.room'
24
 
        _inherit = 'product.product'
25
 
        _table = 'product_product'
26
 
        _columns = {
27
 
                'beds': fields.integer('Nbr of Beds'),
28
 
                'view': fields.selection([('sea','Sea'),('street','Street')], 'Room View'),
29
 
                'hostel_id': fields.many2one('travel.hostel', 'Hostel'),
30
 
        }
 
44
    _name = 'travel.room'
 
45
    _inherit = 'product.product'
 
46
    _table = 'product_product'
 
47
    _columns = {
 
48
        'beds': fields.integer('Nbr of Beds'),
 
49
        'view': fields.selection([('sea','Sea'),('street','Street')], 'Room View'),
 
50
        'hostel_id': fields.many2one('travel.hostel', 'Hostel'),
 
51
    }
31
52
travel_room()
32
53
class travel_flight(osv.osv):
33
 
        _name = 'travel.flight'
34
 
        _inherit = 'product.product'
35
 
        _table = 'product_product'
36
 
        _columns = {
37
 
                'partner_id': fields.many2one('res.partner', 'PArtner'),
38
 
                'date': fields.datetime('Departure Date'),
39
 
                'airport_from': fields.many2one('travel.airport', 'Airport Departure'),
40
 
                'airport_to': fields.many2one('travel.airport', 'Airport Arrival'),
41
 
        }
 
54
    _name = 'travel.flight'
 
55
    _inherit = 'product.product'
 
56
    _table = 'product_product'
 
57
    _columns = {
 
58
        'partner_id': fields.many2one('res.partner', 'PArtner'),
 
59
        'date': fields.datetime('Departure Date'),
 
60
        'airport_from': fields.many2one('travel.airport', 'Airport Departure'),
 
61
        'airport_to': fields.many2one('travel.airport', 'Airport Arrival'),
 
62
    }
42
63
travel_flight()
43
64
 
 
65
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
66