1
# -*- encoding: utf-8 -*-
2
1
##############################################################################
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/>.
2
#Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
3
# Fabien Pinckaers <fp@tiny.Be>
5
# WARNING: This program as such is intended to be used by professional
6
# programmers who take the whole responsability of assessing all potential
7
# consequences resulting from its eventual inadequacies and bugs
8
# End users who are looking for a ready-to-use solution with commercial
9
# garantees and support are strongly adviced to contract a Free Software
12
# This program is Free Software; you can redistribute it and/or
13
# modify it under the terms of the GNU General Public License
14
# as published by the Free Software Foundation; either version 2
15
# of the License, or (at your option) any later version.
17
# This program is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# GNU General Public License for more details.
22
# You should have received a copy of the GNU General Public License
23
# along with this program; if not, write to the Free Software
24
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
26
##############################################################################
30
35
from tools import config
38
class product_category(osv.osv):
39
_inherit="product.category"
41
'isactivitytype':fields.boolean('Is Activity Type'),
45
class hotel_housekeeping_activity_type(osv.osv):
46
_name='hotel.housekeeping.activity.type'
47
_description='Activity Type'
48
_inherits = {'product.category':'activity_id'}
50
'activity_id':fields.many2one('product.category','category',required=True),
53
'isactivitytype': lambda *a: 1,
57
hotel_housekeeping_activity_type()
60
class product_product(osv.osv):
61
_inherit="product.product"
63
'isact':fields.boolean('Is Activity'),
69
class h_activity(osv.osv):
72
_inherits={'product.product':'h_id'}
74
_description='Housekeeping Activity'
76
'h_id': fields.many2one('product.product','Product_id'),
79
'isact': lambda *a: 1,
33
85
class hotel_housekeeping(osv.osv):
34
86
_name = "hotel.housekeeping"
35
87
_description = "Reservation"
39
91
'room_no':fields.many2one('hotel.room','Room No',required=True),
40
92
'activity_lines':fields.one2many('hotel.housekeeping.activities','a_list','Activities'),
41
93
'room_no':fields.many2one('product.product','Room No',required=True),
42
'activity_lines':fields.one2many('hotel.housekeeping.activities','a_list','Activities'),
43
94
'inspector':fields.many2one('res.users','Inspector',required=True),
44
95
'inspect_date_time':fields.datetime('Inspect Date Time',required=True),
45
96
'quality':fields.selection([('good','Good'),('ok','Ok')],'Quality',required=True),
60
111
def room_cancel(self, cr, uid, ids, *args):
62
113
self.write(cr, uid, ids, {
67
119
def room_done(self, cr, uid, ids, *args):
69
121
self.write(cr, uid, ids, {
83
135
self.write(cr, uid, ids, {
92
142
hotel_housekeeping()
94
class product_category(osv.osv):
95
_inherit="product.category"
97
'isactivitytype':fields.boolean('Is Activity Type'),
101
class hotel_housekeeping_activity_type(osv.osv):
102
_name='hotel.housekeeping.activity.type'
103
_description='Activity Type'
104
_inherits = {'product.category':'activity_id'}
106
'activity_id':fields.many2one('product.category','category',required=True),
109
'isactivitytype': lambda *a: 1,
113
hotel_housekeeping_activity_type()
115
class housekeeping_activity(osv.osv):
116
_name = "housekeeping.activity"
117
_description = "Housekeeping Activity List"
119
'name':fields.char('Activity Name',size=64,required=True),
120
'categ_id':fields.many2one('product.category','Category', required=True, change_default=True),
123
housekeeping_activity()
146
#class housekeeping_activity(osv.osv):
147
# _name = "housekeeping.activity"
148
# _description = "Housekeeping Activity List"
150
# 'name':fields.char('Activity Name',size=64,required=True),
151
# 'categ_id':fields.many2one('product.category','Category', required=True, change_default=True),
154
#housekeeping_activity()
125
156
class hotel_housekeeping_activities(osv.osv):
126
157
_name = "hotel.housekeeping.activities"
127
158
_description = "Housekeeping Activities "
129
160
'a_list':fields.many2one('hotel.housekeeping'),
130
'activity_name':fields.many2one('housekeeping.activity','Housekeeping Activity'),
131
'housekeeper':fields.many2one('res.users','Housekeeper'),
161
'activity_name':fields.many2one('h.activity','Housekeeping Activity'),
162
'housekeeper':fields.many2one('res.users','Housekeeper',required=True),
132
163
'clean_start_time':fields.datetime('Clean Start Time',required=True),
133
164
'clean_end_time':fields.datetime('Clean End Time',required=True),
134
165
'dirty':fields.boolean('Dirty'),
139
170
hotel_housekeeping_activities()
141
class product_category(osv.osv):
142
_inherit="product.category"
144
'isactivitytype':fields.boolean('Is Activity Type'),
148
class hotel_housekeeping_activity_type(osv.osv):
149
_name='hotel.housekeeping.activity.type'
150
_description='Activity Type'
151
_inherits = {'product.category':'activity_id'}
153
'activity_id':fields.many2one('product.category','category',required=True),
156
'isactivitytype': lambda *a: 1,
160
hotel_housekeeping_activity_type()
161
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: