From c895d1003f3b86cc37c7b165199cca7c1b83e99d Mon Sep 17 00:00:00 2001 From: Serpent Consulting Services Date: Fri, 18 May 2012 13:09:13 +0530 Subject: [PATCH 01/90] [PATCH 01/86] [ADD] Added modules for hotel management --- hotel_housekeeping/__init__.py | 26 ++ hotel_housekeeping/__openerp__.py | 50 +++ hotel_housekeeping/hotel_housekeeping.py | 136 +++++++ .../hotel_housekeeping_data.xml | 23 ++ .../hotel_housekeeping_report.xml | 13 + .../hotel_housekeeping_view.xml | 182 +++++++++ .../hotel_housekeeping_wizard.xml | 21 + .../hotel_housekeeping_workflow.xml | 92 +++++ hotel_housekeeping/i18n/es.po | 366 ++++++++++++++++++ hotel_housekeeping/i18n/fr_BE.po | 350 +++++++++++++++++ .../i18n/hotel_housekeeping.pot | 350 +++++++++++++++++ hotel_housekeeping/i18n/sv.po | 355 +++++++++++++++++ hotel_housekeeping/report/__init__.py | 24 ++ hotel_housekeeping/report/activity_detail.rml | 110 ++++++ hotel_housekeeping/report/activity_detail.sxw | Bin 0 -> 11735 bytes .../report/housekeeping_report.py | 61 +++ .../security/ir.model.access.csv | 7 + hotel_housekeeping/wizard/__init__.py | 24 ++ .../wizard/housekeeping_wizard.py | 67 ++++ 19 files changed, 2257 insertions(+) create mode 100755 hotel_housekeeping/__init__.py create mode 100755 hotel_housekeeping/__openerp__.py create mode 100755 hotel_housekeeping/hotel_housekeeping.py create mode 100755 hotel_housekeeping/hotel_housekeeping_data.xml create mode 100755 hotel_housekeeping/hotel_housekeeping_report.xml create mode 100755 hotel_housekeeping/hotel_housekeeping_view.xml create mode 100755 hotel_housekeeping/hotel_housekeeping_wizard.xml create mode 100755 hotel_housekeeping/hotel_housekeeping_workflow.xml create mode 100644 hotel_housekeeping/i18n/es.po create mode 100755 hotel_housekeeping/i18n/fr_BE.po create mode 100755 hotel_housekeeping/i18n/hotel_housekeeping.pot create mode 100644 hotel_housekeeping/i18n/sv.po create mode 100755 hotel_housekeeping/report/__init__.py create mode 100755 hotel_housekeeping/report/activity_detail.rml create mode 100755 hotel_housekeeping/report/activity_detail.sxw create mode 100755 hotel_housekeeping/report/housekeeping_report.py create mode 100755 hotel_housekeeping/security/ir.model.access.csv create mode 100755 hotel_housekeeping/wizard/__init__.py create mode 100755 hotel_housekeeping/wizard/housekeeping_wizard.py diff --git a/hotel_housekeeping/__init__.py b/hotel_housekeeping/__init__.py new file mode 100755 index 000000000..76336001a --- /dev/null +++ b/hotel_housekeeping/__init__.py @@ -0,0 +1,26 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 hotel_housekeeping +import wizard +import report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/hotel_housekeeping/__openerp__.py b/hotel_housekeeping/__openerp__.py new file mode 100755 index 000000000..5298fd72c --- /dev/null +++ b/hotel_housekeeping/__openerp__.py @@ -0,0 +1,50 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . +# +############################################################################## + + +{ + "name" : "Hotel Housekeeping Management", + "version" : "1.0", + "author" : "Tiny", + "category" : "Generic Modules/Hotel Housekeeping", + "description": """ + Module for Hotel/Hotel Housekeeping. You can manage: + * Housekeeping process + * Housekeeping history room wise + + Different reports are also provided, mainly for hotel statistics. + """, + "depends" : ["hotel"], + "init_xml" : [], + "demo_xml" : ["hotel_housekeeping_data.xml", + ], + "update_xml" : [ + "hotel_housekeeping_view.xml", + "hotel_housekeeping_workflow.xml", + "hotel_housekeeping_report.xml", + "hotel_housekeeping_wizard.xml", + "security/ir.model.access.csv", + ], + "active": False, + "installable": True +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/hotel_housekeeping/hotel_housekeeping.py b/hotel_housekeeping/hotel_housekeeping.py new file mode 100755 index 000000000..3de5b66f3 --- /dev/null +++ b/hotel_housekeeping/hotel_housekeeping.py @@ -0,0 +1,136 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . +# +############################################################################## + +from osv import fields,osv +import time +import netsvc + +class product_category(osv.osv): + _inherit = "product.category" + _columns = { + 'isactivitytype':fields.boolean('Is Activity Type'), + } + _defaults = { + 'isactivitytype': lambda *a: True, + } +product_category() + +class hotel_housekeeping_activity_type(osv.osv): + _name = 'hotel.housekeeping.activity.type' + _description = 'Activity Type' + _inherits = {'product.category':'activity_id'} + + _columns = { + 'activity_id':fields.many2one('product.category','category',required=True), + } + +hotel_housekeeping_activity_type() + +class product_product(osv.osv): + _inherit = "product.product" + _columns = { + 'isact':fields.boolean('Is Activity'), + } +product_product() + +class h_activity(osv.osv): + _name = 'h.activity' + _inherits = {'product.product':'h_id'} + _description = 'Housekeeping Activity' + + _columns = { + 'h_id': fields.many2one('product.product','Product'), + } +h_activity() + + +class hotel_housekeeping(osv.osv): + _name = "hotel.housekeeping" + _description = "Reservation" + + _columns = { + 'current_date':fields.date("Today's Date",required=True), + 'clean_type':fields.selection([('daily','Daily'),('checkin','Check-in'),('checkout','Check-out')],'Clean Type',required=True), + 'room_no':fields.many2one('hotel.room','Room No',required=True), + 'activity_lines':fields.one2many('hotel.housekeeping.activities','a_list','Activities'), + 'room_no':fields.many2one('product.product','Room No',required=True), + 'inspector':fields.many2one('res.users','Inspector',required=True), + 'inspect_date_time':fields.datetime('Inspect Date Time',required=True), + 'quality':fields.selection([('bad','Bad'),('good','Good'),('ok','Ok')],'Quality',required=True), + 'state': fields.selection([('dirty','Dirty'),('clean','Clean'),('inspect','Inspect'),('done','Done'),('cancel', 'Cancelled')], 'state', select=True, required=True, readonly=True), + } + + _defaults={ + 'state': lambda *a: 'dirty', + 'current_date':lambda *a: time.strftime('%Y-%m-%d'), + } + + def action_set_to_dirty(self, cr, uid, ids, *args): + self.write(cr, uid, ids, {'state': 'dirty'}) + wf_service = netsvc.LocalService('workflow') + for id in ids: + wf_service.trg_create(uid, self._name, id, cr) + return True + + def room_cancel(self, cr, uid, ids, *args): + self.write(cr, uid, ids, { + 'state':'cancel' + }) + return True + + def room_done(self, cr, uid, ids, *args): + self.write(cr, uid, ids, { + 'state':'done' + }) + return True + + def room_inspect(self, cr, uid, ids, *args): + + self.write(cr, uid, ids, { + 'state':'inspect' + }) + return True + + def room_clean(self, cr, uid, ids, *args): + + self.write(cr, uid, ids, { + 'state':'clean' + }) + return True + +hotel_housekeeping() + +class hotel_housekeeping_activities(osv.osv): + _name = "hotel.housekeeping.activities" + _description = "Housekeeping Activities " + _columns = { + 'a_list':fields.many2one('hotel.housekeeping','Reservation'), + 'activity_name':fields.many2one('h.activity','Housekeeping Activity'), + 'housekeeper':fields.many2one('res.users','Housekeeper',required=True), + 'clean_start_time':fields.datetime('Clean Start Time',required=True), + 'clean_end_time':fields.datetime('Clean End Time',required=True), + 'dirty':fields.boolean('Dirty'), + 'clean':fields.boolean('Clean'), + } +hotel_housekeeping_activities() + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/hotel_housekeeping/hotel_housekeeping_data.xml b/hotel_housekeeping/hotel_housekeeping_data.xml new file mode 100755 index 000000000..76ebf1c8c --- /dev/null +++ b/hotel_housekeeping/hotel_housekeeping_data.xml @@ -0,0 +1,23 @@ + + + + + + + All Activities + + + + + Room Activity + + + + + Bed Activity + + + + + + \ No newline at end of file diff --git a/hotel_housekeeping/hotel_housekeeping_report.xml b/hotel_housekeeping/hotel_housekeeping_report.xml new file mode 100755 index 000000000..f66355f5d --- /dev/null +++ b/hotel_housekeeping/hotel_housekeeping_report.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/hotel_housekeeping/hotel_housekeeping_view.xml b/hotel_housekeeping/hotel_housekeeping_view.xml new file mode 100755 index 000000000..27504c23d --- /dev/null +++ b/hotel_housekeeping/hotel_housekeeping_view.xml @@ -0,0 +1,182 @@ + + + + + + + hotel.housekeeping.form + hotel.housekeeping + form + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +