| @ -0,0 +1,34 @@ | |||||
|  | Cab Booking Management System v10 | ||||
|  | ================================= | ||||
|  | 
 | ||||
|  | This module was developed to  manage the cab system.It helps booking the cab, maintains logs | ||||
|  | and record every activity related to the cab management. | ||||
|  | 
 | ||||
|  | Installation | ||||
|  | ============ | ||||
|  | 
 | ||||
|  | Just select it from available modules to install it, there is no need to extra installations. | ||||
|  | 
 | ||||
|  | Configuration | ||||
|  | ============= | ||||
|  | 
 | ||||
|  | Nothing to configure. | ||||
|  | 
 | ||||
|  | Usage | ||||
|  | ===== | ||||
|  | 
 | ||||
|  | To use this functionality, you need to: | ||||
|  | #.First create cabs(Cab Management > Cabs) | ||||
|  | #.Then,you need to set timing for each cabs( Cab management > Timing) | ||||
|  | #.On clicking Booking menu( Cab management > Booking) ,you have option to select cabs based on your time and location | ||||
|  | #. Email is sent,once your booking is confirmed | ||||
|  | #.To get total expense,first you need to set maintenance form ( Cab management > Maintenance).In this form ,you can | ||||
|  | select cab and date, and all total activity of that cab on that day is fetched here. | ||||
|  | #.To get data's on maintenance form ,first you must book one cab | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | Credits | ||||
|  | ======= | ||||
|  | Developer: Saritha @ cybrosys | ||||
|  | Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in | ||||
|  | 
 | ||||
| @ -0,0 +1,24 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | #    Author: Nilmar Shereef(<http://www.cybrosys.com>) | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | 
 | ||||
|  | from . import models | ||||
| @ -0,0 +1,47 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | { | ||||
|  |     'name': "Cab Booking Management System", | ||||
|  |     'summary': """Complete Cab Booking Management and its Related Records""", | ||||
|  |     'author': "Cybrosys Techno Solution", | ||||
|  |     'website': "http://www.cybrosys.com", | ||||
|  |     'category': 'Tools', | ||||
|  |     'version': '0.1', | ||||
|  |     'depends': ['base', 'mail'], | ||||
|  |     'data': [ | ||||
|  |         'views/templates.xml', | ||||
|  |         'views/cab_log_view.xml', | ||||
|  |         'views/cab_conf_view.xml', | ||||
|  |         'views/cab_location_view.xml', | ||||
|  |         'views/cab_timing_view.xml', | ||||
|  |         'views/cab_booking_view.xml', | ||||
|  |         'views/cab_creation_view.xml', | ||||
|  |         'views/cab_maintanence_view.xml', | ||||
|  |         'security/ir.model.access.csv' | ||||
|  |             ], | ||||
|  |     'images': ['static/description/banner.jpg'], | ||||
|  |     'license': 'AGPL-3', | ||||
|  |     'installable': True, | ||||
|  |     'auto_install': False, | ||||
|  |     'application': True, | ||||
|  | } | ||||
| @ -0,0 +1,32 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | #    Author: Nilmar Shereef(<http://www.cybrosys.com>) | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | 
 | ||||
|  | from . import cab_creation | ||||
|  | from . import cab_log | ||||
|  | from . import cab_conf | ||||
|  | from . import cab_booking | ||||
|  | from . import cab_location | ||||
|  | from . import cab_timing | ||||
|  | from. import cab_maintanence | ||||
|  | 
 | ||||
|  | 
 | ||||
| @ -0,0 +1,50 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | from odoo import models, fields, api | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabBooking(models.Model): | ||||
|  |     _name = 'cab.booking' | ||||
|  |     _rec_name = 'booking_date' | ||||
|  | 
 | ||||
|  |     booking_date = fields.Date(string="Booking Date", required=True) | ||||
|  |     cab_timing = fields.Many2one('cab.time', string="Timing", required=True) | ||||
|  |     cab_routes = fields.Many2one('cab.location', string="Route", required=True) | ||||
|  |     seat_available = fields.One2many('cab.timing', compute="scheduled_details") | ||||
|  | 
 | ||||
|  |     @api.onchange('cab_routes', 'cab_timing') | ||||
|  |     def scheduled_details(self): | ||||
|  |         data = self.env['cab.timing'].search([('cab_route.name', '=', self.cab_routes.name), | ||||
|  |                                               ('cab_time.name', '=', self.cab_timing.name)]) | ||||
|  |         self.seat_available = data | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
| @ -0,0 +1,31 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | from odoo import models, fields | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabConfiguration(models.Model): | ||||
|  |     _name = 'cab.configuration' | ||||
|  |     _rec_name = 'cab_manager' | ||||
|  | 
 | ||||
|  |     auto_approve = fields.Boolean(string="Auto Approve") | ||||
|  |     cab_manager = fields.Many2one('res.users', string='Manager', required=True) | ||||
| @ -0,0 +1,64 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | 
 | ||||
|  | from odoo import models, fields, api | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabManagement(models.Model): | ||||
|  |     _name = 'cab.management' | ||||
|  | 
 | ||||
|  |     name = fields.Char(string="Cab Name", required=True) | ||||
|  |     cab_image = fields.Binary(string='Image', store=True, attachment=True) | ||||
|  |     licence_plate = fields.Char(string="Licence Plate", required=True) | ||||
|  |     activity_period_from = fields.Date(string="Activity Period") | ||||
|  |     activity_period_to = fields.Date(string="To") | ||||
|  |     driver_plot = fields.Char(string="Driver Ploted") | ||||
|  |     cab_value = fields.Float(string="Cab Value") | ||||
|  |     cab_model = fields.Char(string="Cab Model") | ||||
|  |     cab_color = fields.Char(string="Cab Color") | ||||
|  |     aq_date = fields.Date(string="Aquisition Date") | ||||
|  |     chas_no = fields.Char(string="Chasis No") | ||||
|  |     odo_reading = fields.Float(string="Odometre Reading") | ||||
|  |     seating_capacity = fields.Integer(string="Seating Capacity", required=True) | ||||
|  |     fuel_type = fields.Char(string="Fuel Type") | ||||
|  |     related_log_details = fields.One2many('cab.log', string="Log Details", compute="auto_fetch_log_details") | ||||
|  |     total_log_details = fields.One2many('cab.maintanence', string='Total Expenses', compute="auto_fetch_total_details") | ||||
|  |     location_log_details = fields.One2many('cab.log', string="Location", compute="auto_fetch_location_details") | ||||
|  | 
 | ||||
|  |     @api.onchange('activity_period_from', 'activity_period_to') | ||||
|  |     def auto_fetch_log_details(self): | ||||
|  |         data = self.env['cab.log'].search([("cab_log_date", ">=", self.activity_period_from), | ||||
|  |                                            ("cab_log_date", "<=", self.activity_period_to)]) | ||||
|  |         self.related_log_details = data | ||||
|  | 
 | ||||
|  |     @api.onchange('activity_period_from', 'activity_period_to') | ||||
|  |     def auto_fetch_total_details(self): | ||||
|  |         data = self.env['cab.maintanence'].search([("cab_log_date", ">=", self.activity_period_from), | ||||
|  |                                            ("cab_log_date", "<=", self.activity_period_to)]) | ||||
|  |         self.total_log_details = data | ||||
|  | 
 | ||||
|  |     @api.onchange('activity_period_from', 'activity_period_to') | ||||
|  |     def auto_fetch_location_details(self): | ||||
|  |         data = self.env['cab.log'].search([("cab_log_date", ">=", self.activity_period_from), | ||||
|  |                                            ("cab_log_date", "<=", self.activity_period_to)]) | ||||
|  |         self.location_log_details = data | ||||
| @ -0,0 +1,13 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | 
 | ||||
|  | from odoo import models, fields, api | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabLocation(models.Model): | ||||
|  |     _name = 'cab.location' | ||||
|  | 
 | ||||
|  |     name = fields.Char(string='City', required=True) | ||||
|  |     cab_zip = fields.Char(string='ZIP') | ||||
|  |     cab_code = fields.Char(string='City Code', size=64, help="The official code for the city") | ||||
|  |     state_id = fields.Many2one('res.country.state', string='State', required=True) | ||||
|  |     country_id = fields.Many2one('res.country', string='Country', required=True) | ||||
| @ -0,0 +1,150 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | 
 | ||||
|  | from odoo import models, fields, api | ||||
|  | from odoo.tools.translate import _ | ||||
|  | from odoo.exceptions import UserError | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabLog(models.Model): | ||||
|  |     _name = 'cab.log' | ||||
|  |     _inherit = ['mail.thread', 'ir.needaction_mixin'] | ||||
|  |     _description = 'Cab' | ||||
|  | 
 | ||||
|  |     name = fields.Many2one('cab.management', string="Name", required=True) | ||||
|  |     cab_log_date = fields.Date(string="Date", required=True) | ||||
|  |     fuel_used = fields.Float(string="Fuel Used", required=True) | ||||
|  |     seat_capacity = fields.Integer(string="Seat Capacity", related="name.seating_capacity") | ||||
|  |     seat_available = fields.Integer(string="Seat Available") | ||||
|  |     cab_location = fields.Many2one('cab.location', string="Location", required=True) | ||||
|  |     seat_booked = fields.Integer(string="Seat Booked", required=True) | ||||
|  |     odo_metre = fields.Float(string="OdoMetre Reading", required=True) | ||||
|  |     cab_expense = fields.Float(string="Expense", required=True) | ||||
|  |     cab_log_timing = fields.Many2one('cab.time', string="Timing", required=True) | ||||
|  |     total_passenger = fields.Integer(string="Total Passenger", required=True) | ||||
|  |     partner_id = fields.Many2one('res.users', string="User Name", required=True) | ||||
|  |     cab_image = fields.Binary(string='Image', store=True, attachment=True) | ||||
|  |     seat_check = fields.Integer(string='Seat Condition Check') | ||||
|  |     state = fields.Selection([ | ||||
|  |         ('draft', 'Draft'), | ||||
|  |         ('approved', 'Approved'), | ||||
|  |         ('discard', 'Discard'), | ||||
|  |         ('cancel', 'Cancelled'), | ||||
|  |         ('done', 'Done') | ||||
|  |     ], default='draft') | ||||
|  | 
 | ||||
|  |     @api.onchange('seat_booked') | ||||
|  |     def auto_fill_passenger_field(self): | ||||
|  |         if self.seat_available < self.seat_booked: | ||||
|  |             self.seat_check = 1 | ||||
|  | 
 | ||||
|  |     @api.onchange('total_passenger') | ||||
|  |     def error_message(self): | ||||
|  |         if self.seat_check == 1: | ||||
|  |             raise UserError("Sorry,No Available Seats") | ||||
|  |         elif self.seat_booked != self.total_passenger: | ||||
|  |             raise UserError("Sorry, No of seat requested for booking and total passenger must be equal") | ||||
|  | 
 | ||||
|  |     @api.one | ||||
|  |     def action_approve(self): | ||||
|  |         self.state = "approved" | ||||
|  | 
 | ||||
|  |     @api.one | ||||
|  |     def action_cancel(self): | ||||
|  |         self.state = "cancel" | ||||
|  | 
 | ||||
|  |     @api.one | ||||
|  |     def action_discard(self): | ||||
|  |         self.state = "discard" | ||||
|  | 
 | ||||
|  |     @api.onchange('cab_log_date', 'state') | ||||
|  |     def auto_cabs_approve(self): | ||||
|  |         for data in self.env['cab.configuration'].search([]): | ||||
|  |             if data.auto_approve != False: | ||||
|  |                 user_obj = self.env.user | ||||
|  |                 if user_obj == data.cab_manager: | ||||
|  |                     self.state = 'approved' | ||||
|  | 
 | ||||
|  |     @api.onchange('cab_log_date', 'name', 'seat_booked') | ||||
|  |     def change_available_seat(self): | ||||
|  |         for data in self.env['cab.management'].search([]): | ||||
|  |             if self.name.name == data.name: | ||||
|  |                 flag = 0 | ||||
|  |                 total_seat_booked = 0 | ||||
|  |                 for records in self.env['cab.log'].search([]): | ||||
|  |                     if self.cab_log_date == records.cab_log_date: | ||||
|  |                         total_seat_booked = total_seat_booked+records.seat_booked | ||||
|  |                         flag += 1 | ||||
|  | 
 | ||||
|  |                 if flag > 0: | ||||
|  |                     test_val = self.seat_capacity - total_seat_booked | ||||
|  |                     self.seat_available = test_val | ||||
|  | 
 | ||||
|  |                 else: | ||||
|  |                     self.seat_available = self.seat_capacity | ||||
|  | 
 | ||||
|  |     @api.multi | ||||
|  |     def action_sent(self): | ||||
|  |         self.ensure_one() | ||||
|  |         ir_model_data = self.env['ir.model.data'] | ||||
|  |         try: | ||||
|  |             template_id = ir_model_data.get_object_reference('cab_booking_management', 'email_template_edi_cab')[1] | ||||
|  |         except ValueError: | ||||
|  |             template_id = False | ||||
|  |         try: | ||||
|  |             compose_form_id = ir_model_data.get_object_reference('mail', 'email_compose_message_wizard_form')[1] | ||||
|  |         except ValueError: | ||||
|  |             compose_form_id = False | ||||
|  |         ctx = dict() | ||||
|  |         print self.ids[0] | ||||
|  |         ctx.update({ | ||||
|  |             'default_model': 'cab.log', | ||||
|  |             'default_res_id': self.ids[0], | ||||
|  |             'default_use_template': bool(template_id), | ||||
|  |             'default_template_id': template_id, | ||||
|  |             'default_composition_mode': 'comment', | ||||
|  |         }) | ||||
|  |         return { | ||||
|  |             'type': 'ir.actions.act_window', | ||||
|  |             'view_type': 'form', | ||||
|  |             'view_mode': 'form', | ||||
|  |             'res_model': 'mail.compose.message', | ||||
|  |             'views': [(compose_form_id, 'form')], | ||||
|  |             'view_id': compose_form_id, | ||||
|  |             'target': 'new', | ||||
|  |             'context': ctx, | ||||
|  |         } | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class MailComposeMessage(models.TransientModel): | ||||
|  |     _inherit = 'mail.compose.message' | ||||
|  | 
 | ||||
|  |     @api.multi | ||||
|  |     def send_mail(self, auto_commit=False): | ||||
|  |         if self._context.get('default_model') == 'cab.log' and self._context.get('default_res_id'): | ||||
|  |             order = self.env['cab.log'].browse([self._context['default_res_id']]) | ||||
|  |             if order.state == 'approved': | ||||
|  |                 order.state = 'done' | ||||
|  |             order.sent = True | ||||
|  |             self = self.with_context(mail_post_autofollow=True) | ||||
|  |         return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit) | ||||
| @ -0,0 +1,55 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | 
 | ||||
|  | from odoo import models, fields, api | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabMaintanence(models.Model): | ||||
|  |     _name = 'cab.maintanence' | ||||
|  | 
 | ||||
|  |     name = fields.Many2one('cab.management', string="Name", required=True) | ||||
|  |     cab_log_date = fields.Date(string="Date", required=True) | ||||
|  |     fuel_used = fields.Float(string="Fuel Used") | ||||
|  |     odo_metre = fields.Float(string="OdoMetre Reading") | ||||
|  |     cab_expense = fields.Float(string="Expense") | ||||
|  |     total_passenger = fields.Integer(string="Total Passenger") | ||||
|  | 
 | ||||
|  |     @api.onchange('cab_log_date') | ||||
|  |     def total_log_details(self): | ||||
|  |         total_fuel = 0 | ||||
|  |         odo_metres = 0 | ||||
|  |         expense = 0 | ||||
|  |         passenger = 0 | ||||
|  |         for data in self.env['cab.log'].search([]): | ||||
|  |             if data.cab_log_date == self.cab_log_date: | ||||
|  |                 total_fuel += data.fuel_used | ||||
|  |                 odo_metres += data.odo_metre | ||||
|  |                 expense += data.cab_expense | ||||
|  |                 passenger += data.total_passenger | ||||
|  |         self.fuel_used = total_fuel | ||||
|  |         self.odo_metre = odo_metres | ||||
|  |         self.cab_expense = expense | ||||
|  |         self.total_passenger = passenger | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
| @ -0,0 +1,55 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | # | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | from odoo import models, fields, api | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class CabTiming(models.Model): | ||||
|  |     _name = 'cab.timing' | ||||
|  | 
 | ||||
|  |     name = fields.Many2one('cab.management', string="Cab Name", required=True) | ||||
|  |     cab_time = fields.Many2many('cab.time', 'cab_name_rel', string="Time", required=True, | ||||
|  |                                 help="Use this format 00:00,ex:  01:15") | ||||
|  |     cab_route = fields.Many2one('cab.location', string='Route', required=True) | ||||
|  |     seat = fields.Integer(string="Seating Capacity", related='name.seating_capacity', required=True) | ||||
|  | 
 | ||||
|  |     @api.multi | ||||
|  |     def action_log_form_view(self): | ||||
|  |         return { | ||||
|  |             'name': 'CabLog', | ||||
|  |             'view_type': 'form', | ||||
|  |             'view_mode': 'form', | ||||
|  |             'res_model': 'cab.log', | ||||
|  |             'type': 'ir.actions.act_window', | ||||
|  |             'target': 'current' | ||||
|  |         } | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class Time(models.Model): | ||||
|  |     _name = 'cab.time' | ||||
|  | 
 | ||||
|  |     name = fields.Char(string="Name", required=True, help="Use this format 00:00,ex:  01:15") | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
| 
 | 
| After Width: | Height: | Size: 293 KiB | 
| After Width: | Height: | Size: 28 KiB | 
| After Width: | Height: | Size: 42 KiB | 
| After Width: | Height: | Size: 28 KiB | 
| After Width: | Height: | Size: 39 KiB | 
| After Width: | Height: | Size: 26 KiB | 
| After Width: | Height: | Size: 72 KiB | 
| After Width: | Height: | Size: 70 KiB | 
| After Width: | Height: | Size: 50 KiB | 
| After Width: | Height: | Size: 12 KiB | 
| @ -0,0 +1,161 @@ | |||||
|  | <section class="oe_container"> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <h2 class="oe_slogan">Cab Booking Management System (CBMS)</h2> | ||||
|  |         <h3 class="oe_slogan">Manage the cabs with ease</h3> | ||||
|  |         <h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4> | ||||
|  |         <div> | ||||
|  |             <h4><p>Major Features:</p></h4> | ||||
|  |             <ul> | ||||
|  |                <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  Booking the Cab.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  Auto approval Settings in Configuration.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  Cab Logs for Every Trip.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  Record Every Activity Related to CBMS.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  Email Notification for Successful Booking.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  Booking Status.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>  View All Cab Activities with Advanced Filttrations.</li> | ||||
|  |             </ul> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |             	<img src="cab_creation.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row oe_space"> | ||||
|  |     <h3 class="oe_slogan">Cab Booking</h3> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <p class='oe_mt32'> | ||||
|  |                 <centre>We can book cabs from list of cabs based on your time and location.</centre> | ||||
|  |             </p> | ||||
|  |         </div> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |                 <img src="cab_booking.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <h3 class="oe_slogan"> Auto approval</h3> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |             	<img src="cab_conf.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <p class='oe_mt32'> | ||||
|  |                 Approve  cab booking automatically. | ||||
|  |             </p> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container dark"> | ||||
|  |     <div class="oe_row oe_space"> | ||||
|  |         <h3 class="oe_slogan"> Cab Logs for Every Trip</h3> | ||||
|  |         <div class="oe_span6"> | ||||
|  |         <p class='oe_mt32'> | ||||
|  |             It keep the record of all expenses of each  cab trips. | ||||
|  |         </p> | ||||
|  |         </div> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |                 <img src="log_details.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <h3 class="oe_slogan"> Record Every Activity Related to CBMS</h3> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |             	<img src="cab_activity.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |         <div class="oe_span6"> | ||||
|  |         <p class='oe_mt32'> | ||||
|  |              It shows the total expenses for a cab, on daily basis. | ||||
|  |         </p> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row oe_space"> | ||||
|  |         <h3 class="oe_slogan"> Email Notification for Successful Booking.</h3> | ||||
|  |         <div class="oe_span6"> | ||||
|  |         <p class='oe_mt32'> | ||||
|  |              Email is sent to the user on successful booking of cab. | ||||
|  |         </p> | ||||
|  |         </div> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |                 <img src="mail.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <h3 class="oe_slogan">Booking Status</h3> | ||||
|  |         <div class="oe_span6"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |             	<img src="cab_cancel.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |         <div class="oe_span6"> | ||||
|  |         <p class='oe_mt32'> | ||||
|  |             View your status of booking.You can also cancel your booking. | ||||
|  |         </p> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <div class="oe_row"> | ||||
|  |         <h3 class="oe_slogan">View All Cab Activities with Advanced Filttrations</h3> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_demo oe_picture oe_screenshot"> | ||||
|  |             	<img src="cab_details.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <h2 class="oe_slogan" style="margin-top:20px;" >You Looking for  a free Documentation of this Application.?</h2> | ||||
|  |     <h3 class="oe_slogan">Give a Request Mail to:  <i class="fa fa-envelope" aria-hidden="true"></i>  <a href="#" style="color:blue;">odoo@cybrosys.com</a></h3> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> | ||||
|  |     <div class="oe_slogan" style="margin-top:10px !important;"> | ||||
|  |         <a  class="btn btn-primary btn-lg mt8" | ||||
|  |             style="color: #FFFFFF !important;" href="http://www.cybrosys.com"><i | ||||
|  |             class="fa fa-envelope"></i> Email </a> <a | ||||
|  |             class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" | ||||
|  |             href="http://www.cybrosys.com/contact/"><i | ||||
|  |             class="fa fa-phone"></i> Contact Us </a> <a | ||||
|  |             class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" | ||||
|  |             href="http://www.cybrosys.com/odoo-customization-and-installation/"><i | ||||
|  |             class="fa fa-check-square"></i> Request Customization </a> | ||||
|  |     </div> | ||||
|  |             <img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
| After Width: | Height: | Size: 67 KiB | 
| After Width: | Height: | Size: 25 KiB | 
| @ -0,0 +1,65 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_booking_form_view"> | ||||
|  |             <field name="name">CabBooking</field> | ||||
|  |             <field name="model">cab.booking</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Management"> | ||||
|  |                     <header> | ||||
|  |                          <html> | ||||
|  |                             <div style="text-align: center;"> | ||||
|  |                                 <h1><centre>BOOK YOUR CAB</centre> </h1> | ||||
|  |                             </div> | ||||
|  |                          </html> | ||||
|  |                     </header> | ||||
|  |                     <sheet> | ||||
|  |                         <group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="booking_date"/> | ||||
|  |                                 <field name="cab_routes"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="cab_timing"/> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                         <field name="seat_available"> | ||||
|  |                             <tree name="Cab InformationTree"> | ||||
|  |                                 <field name="name"/> | ||||
|  |                                 <field name="seat" style="text-align: center;"/> | ||||
|  |                                 <button name="action_log_form_view"  type="object"  icon="fa-arrow-right" /> | ||||
|  |                             </tree> | ||||
|  |                         </field> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_booking_tree_view"> | ||||
|  |             <field name="name">CabBooking</field> | ||||
|  |             <field name="model">cab.booking</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree string="Cab Booking"> | ||||
|  |                     <field name="booking_date"/> | ||||
|  |                     <field name="cab_routes"/> | ||||
|  |                     <field name="cab_timing"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_booking_action"> | ||||
|  |             <field name="name">CabBooking</field> | ||||
|  |             <field name="res_model">cab.booking</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form,calender</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create Your First Booking | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <menuitem id="cab_booking_menu" name="Booking" parent="cab_management_menu" action="cab_booking_action" | ||||
|  |                   groups="base.group_user" sequence="60"/> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,55 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record id="cab_management_group" model="res.groups"> | ||||
|  |             <field name="name">Cab Management</field> | ||||
|  |             <field name="category_id" ref="base.module_category_extra"/> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_configuration_form_view"> | ||||
|  |             <field name="name">Cab Config</field> | ||||
|  |             <field name="model">cab.configuration</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Configuration"> | ||||
|  |                     <sheet> | ||||
|  |                         <group string="Cab Configuration"> | ||||
|  |                             <group> | ||||
|  |                                 <field name="auto_approve"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="cab_manager"/> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |          <record model="ir.ui.view" id="cab_conf_tree_view"> | ||||
|  |             <field name="name">Cab Config</field> | ||||
|  |             <field name="model">cab.configuration</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree string="Cab Conf"> | ||||
|  |                     <field name="auto_approve"/> | ||||
|  |                     <field name="cab_manager"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_configuration_action"> | ||||
|  |             <field name="name">Cab Configuration</field> | ||||
|  |             <field name="res_model">cab.configuration</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form</field> | ||||
|  |              <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create the Conf | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <menuitem id="main_cab_configuration_menu" name="Configuration" parent="main_cab_management_menu"/> | ||||
|  |         <menuitem id="cab_configuration_menu" name="Cab Configuration" parent="main_cab_configuration_menu" | ||||
|  |                   action="cab_configuration_action" groups="base.group_user"/> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,146 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_management_form_view"> | ||||
|  |             <field name="name">Cab Details</field> | ||||
|  |             <field name="model">cab.management</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Management"> | ||||
|  |                     <sheet> | ||||
|  |                         <field name="cab_image" widget="image" class="oe_avatar"/> | ||||
|  |                             <div class="oe_title"> | ||||
|  |                                 <label for="name"/> | ||||
|  |                                 <h1> | ||||
|  |                                     <field name="name" placeholder=" Vehicle Name" style="width:50%%"/> | ||||
|  |                                 </h1> | ||||
|  |                                 <label for="licence_plate"/> | ||||
|  |                                 <h2> | ||||
|  |                                     <field name="licence_plate" style="width:25%%"/> | ||||
|  |                                 </h2> | ||||
|  |                             </div> | ||||
|  |                             <div class="oe_title"> | ||||
|  |                                 <group > | ||||
|  |                                     <label for="activity_period_from" class="oe_inline"/> | ||||
|  |                                     <div > | ||||
|  |                                         <field name="activity_period_from" class="oe_inline"/> to | ||||
|  |                                         <field name="activity_period_to" class="oe_inline"/> | ||||
|  |                                     </div> | ||||
|  | 
 | ||||
|  |                                 </group> | ||||
|  |                             </div> | ||||
|  |                         <label for="related_log_details"/> | ||||
|  |                         <field name="related_log_details"> | ||||
|  |                             <tree name="Cab Log Tree"> | ||||
|  |                                <field name="cab_log_date"/> | ||||
|  |                                 <field name="cab_log_timing"/> | ||||
|  |                                 <field name="odo_metre"/> | ||||
|  |                                 <field name="fuel_used"/> | ||||
|  |                                 <field name="total_passenger"/> | ||||
|  |                             </tree> | ||||
|  |                         </field> | ||||
|  | 
 | ||||
|  |                         <notebook> | ||||
|  |                         <page string="Cab Details"> | ||||
|  |                             <group> | ||||
|  |                                 <group> | ||||
|  |                                     <field name="driver_plot"/> | ||||
|  |                                     <field name="cab_value"/> | ||||
|  |                                     <field name="cab_model"/> | ||||
|  |                                     <field name="cab_color"/> | ||||
|  |                                     <field name="aq_date"/> | ||||
|  |                                 </group> | ||||
|  |                                 <group> | ||||
|  |                                     <field name="chas_no"/> | ||||
|  |                                     <field name="odo_reading"/> | ||||
|  |                                     <field name="seating_capacity"/> | ||||
|  |                                     <field name="fuel_type"/> | ||||
|  |                                 </group> | ||||
|  |                             </group> | ||||
|  |                         </page> | ||||
|  |                         <page string="Location"> | ||||
|  |                             <label for="location_log_details"/> | ||||
|  |                             <field name="location_log_details"> | ||||
|  |                             <tree> | ||||
|  |                                 <field name="cab_log_date"/> | ||||
|  |                                 <field name="cab_location"/> | ||||
|  |                                 <field name="partner_id"/> | ||||
|  |                             </tree> | ||||
|  |                             </field> | ||||
|  |                         </page> | ||||
|  |                         <page string="Total Activity"> | ||||
|  |                             <label for="total_log_details"/> | ||||
|  |                             <field name="total_log_details"> | ||||
|  |                             <tree> | ||||
|  |                                 <field name="cab_log_date"/> | ||||
|  |                                 <field name="fuel_used"/> | ||||
|  |                                 <field name="odo_metre"/> | ||||
|  |                                 <field name="total_passenger"/> | ||||
|  |                                 <field name="cab_expense"/> | ||||
|  |                             </tree> | ||||
|  |                             </field> | ||||
|  |                             </page> | ||||
|  |                         </notebook> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record id="cab_template_kanban_view" model="ir.ui.view"> | ||||
|  |             <field name="name">cab.management.kanban</field> | ||||
|  |             <field name="model">cab.management</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |             <kanban> | ||||
|  |                 <field name="cab_image" modifiers="{}"/> | ||||
|  |                 <templates> | ||||
|  |                     <t t-name="kanban-box"> | ||||
|  |                         <div class="oe_kanban_global_click"> | ||||
|  |                             <div class="o_kanban_image"> | ||||
|  |                                 <img t-att-src="kanban_image('cab.management', 'cab_image', record.id.value)"/> | ||||
|  |                             </div> | ||||
|  |                             <div class="oe_kanban_details"> | ||||
|  |                             <strong> | ||||
|  |                                 <span t-if="record.licence_plate.value">[<field name="licence_plate"/>]</span> | ||||
|  |                                 <ul> | ||||
|  |                                     <li>Name :<field name="name"/></li> | ||||
|  |                                     <li>O.M Reading : 0</li> | ||||
|  |                                 </ul> | ||||
|  |                             </strong> | ||||
|  |                             </div> | ||||
|  |                         </div> | ||||
|  |                     </t> | ||||
|  |                 </templates> | ||||
|  |             </kanban> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record id="cab_template_action" model="ir.actions.act_window"> | ||||
|  |             <field name="name">Cab Details</field> | ||||
|  |             <field name="type">ir.actions.act_window</field> | ||||
|  |             <field name="res_model">cab.management</field> | ||||
|  |             <field name="view_mode">kanban,tree,form</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_id" ref="cab_template_kanban_view"/> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create"> | ||||
|  |                     Click to define a new Cab. | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_management_action"> | ||||
|  |             <field name="name">Cab Details</field> | ||||
|  |             <field name="res_model">cab.management</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">kanban,tree,form,calender</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create Your First Cab | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <menuitem id="main_cab_management_menu" name="Cab Management"/> | ||||
|  |         <menuitem id="cab_management_menu" name="Cab Management" parent="main_cab_management_menu"/> | ||||
|  |         <menuitem id="cab_menu" name="Cab" parent="cab_management_menu" action="cab_management_action" | ||||
|  |                   groups="base.group_user" sequence="10"/> | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,57 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_location_form_view"> | ||||
|  |             <field name="name">Location</field> | ||||
|  |             <field name="model">cab.location</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Location"> | ||||
|  |                     <sheet> | ||||
|  |                         <group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="name"/> | ||||
|  |                                 <field name="state_id"/> | ||||
|  |                                 <field name="cab_code"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="cab_zip"/> | ||||
|  |                                 <field name="country_id"/> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  | 
 | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |          <record model="ir.ui.view" id="cab_location_tree_view"> | ||||
|  |             <field name="name">Location</field> | ||||
|  |             <field name="model">cab.location</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree string="Cab Location"> | ||||
|  |                     <field name="name"/> | ||||
|  |                     <field name="state_id"/> | ||||
|  |                     <field name="cab_code"/> | ||||
|  |                     <field name="cab_zip"/> | ||||
|  |                     <field name="country_id"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_location_action"> | ||||
|  |             <field name="name">Location</field> | ||||
|  |             <field name="res_model">cab.location</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form,calender</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create Your First Location | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  |         <menuitem id="main_cab_management_menu" name="Cab Management"/> | ||||
|  |         <menuitem id="cab_management_menu" name="Cab Management" parent="main_cab_management_menu"/> | ||||
|  |         <menuitem id="cab_location_menu" name="Location" parent="cab_management_menu" action="cab_location_action" | ||||
|  |                   groups="base.group_user" sequence="40"/> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,109 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_log_form_view"> | ||||
|  |             <field name="name">Cab Details</field> | ||||
|  |             <field name="model">cab.log</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Log"> | ||||
|  |                     <header> | ||||
|  |                         <button name="action_cancel" | ||||
|  |                                 string="Cancel Booking" | ||||
|  |                                 type="object" | ||||
|  |                                 state="'draft" | ||||
|  |                                 class="oe_highlight" | ||||
|  |                                 attrs = "{'invisible': [('state', 'in', ('approved','draft','discard','cancel'))]}"/> | ||||
|  | 
 | ||||
|  |                         <button name="action_approve" | ||||
|  |                                 string="Approve" | ||||
|  |                                 type="object" | ||||
|  |                                 state="'draft" | ||||
|  |                                 class="oe_highlight" | ||||
|  |                                 attrs = "{'invisible': [('state', 'in', ('discard','approved','cancel','done'))]}"/> | ||||
|  |                         <button name="action_sent" | ||||
|  |                                 string="Send Mail" | ||||
|  |                                 type="object" | ||||
|  |                                 class="oe_highlight" | ||||
|  |                                 context="{'send_rfq':True }" | ||||
|  |                                 attrs = "{'invisible': [('state', 'in', ('discard','draft','cancel','done'))]}" /> | ||||
|  |                         <button name="action_discard" | ||||
|  |                                 string="Discard" | ||||
|  |                                 type="object" | ||||
|  |                                 class="oe_highlight" | ||||
|  |                                 attrs = "{'invisible': [('state', 'in', ('approved','discard','cancel','sent','done'))]}" /> | ||||
|  |                         <field name="state" | ||||
|  |                                widget="statusbar" | ||||
|  |                                statusbar_visible="draft,approved,sent,discard,cancel" | ||||
|  |                                statusbar_colors='{"approved":"red"}'/> | ||||
|  |                     </header> | ||||
|  |                     <sheet> | ||||
|  |                         <field name="cab_image" | ||||
|  |                                widget="image" | ||||
|  |                                class="oe_avatar"/> | ||||
|  |                         <div class="oe_title"> | ||||
|  |                             <label for="name"/> | ||||
|  |                             <h1> | ||||
|  |                                 <field name="name" placeholder=" Cab Name" style="width:50%%" /> | ||||
|  |                             </h1> | ||||
|  |                         </div> | ||||
|  |                         <group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="cab_log_date"/> | ||||
|  |                                 <field name="fuel_used"/> | ||||
|  |                                 <field name="seat_capacity"/> | ||||
|  |                                 <field name="seat_available"/> | ||||
|  |                                 <field name="cab_location"/> | ||||
|  |                                 <field name="seat_booked"  attrs="{'readonly':['|',('seat_available', '==', 0) ] }"/> | ||||
|  |                                 <field name="seat_check" invisible="1"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="odo_metre"/> | ||||
|  |                                 <field name="cab_expense"/> | ||||
|  |                                 <field name="cab_log_timing"/> | ||||
|  |                                 <field name="total_passenger"/> | ||||
|  |                                 <field name="partner_id" attrs="{'readonly':['|',('seat_check', '==', 1)]}" /> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_log_tree_view"> | ||||
|  |             <field name="name">Log Details</field> | ||||
|  |             <field name="model">cab.log</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree string="Cab Log"> | ||||
|  |                     <field name="name"/> | ||||
|  |                     <field name="seat_available"/> | ||||
|  |                     <field name="cab_log_date"/> | ||||
|  |                     <field name="cab_log_timing"/> | ||||
|  |                     <field name="cab_location"/> | ||||
|  |                     <field name="odo_metre"/> | ||||
|  |                     <field name="fuel_used"/> | ||||
|  |                     <field name="cab_expense"/> | ||||
|  |                     <field name="partner_id"/> | ||||
|  |                     <field name="seat_booked"/> | ||||
|  |                     <field name="state"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_log_action"> | ||||
|  |             <field name="name">Log Details</field> | ||||
|  |             <field name="res_model">cab.log</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form,calender</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create Your First Trip | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <menuitem id="main_cab_management_menu" name="Cab Management"/> | ||||
|  |         <menuitem id="cab_management_menu" name="Cab Management" parent="main_cab_management_menu"/> | ||||
|  |         <menuitem id="cabs_log_menu" name="Cab Trip" parent="cab_management_menu" action="cab_log_action" | ||||
|  |                   groups="base.group_user" sequence="30"/> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,68 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_maintanence_form_view"> | ||||
|  |             <field name="name">Cab Details</field> | ||||
|  |             <field name="model">cab.maintanence</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Log"> | ||||
|  |                     <header> | ||||
|  |                          <html> | ||||
|  |                             <div style="text-align: center;"> | ||||
|  |                                 <h1><centre>Cab Maintanence(Total Expenses)</centre> </h1> | ||||
|  |                             </div> | ||||
|  |                          </html> | ||||
|  |                     </header> | ||||
|  |                     <sheet> | ||||
|  |                         <div class="oe_title"> | ||||
|  |                             <label for="name"/> | ||||
|  |                             <h1> | ||||
|  |                                 <field name="name" placeholder=" Cab Name" style="width:50%%" /> | ||||
|  |                             </h1> | ||||
|  |                         </div> | ||||
|  |                         <group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="cab_log_date"/> | ||||
|  |                                 <field name="fuel_used"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="odo_metre"/> | ||||
|  |                                 <field name="cab_expense"/> | ||||
|  |                                 <field name="total_passenger"/> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_maintanence_tree_view"> | ||||
|  |             <field name="name">Log Details</field> | ||||
|  |             <field name="model">cab.maintanence</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree string="Cab Log"> | ||||
|  |                     <field name="name"/> | ||||
|  |                     <field name="odo_metre"/> | ||||
|  |                     <field name="cab_log_date"/> | ||||
|  |                     <field name="fuel_used"/> | ||||
|  |                     <field name="cab_expense"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_maintanence_action"> | ||||
|  |             <field name="name">Log Details</field> | ||||
|  |             <field name="res_model">cab.maintanence</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form,calender</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create Your First Record | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <menuitem id="cab_maintanence_menu" name="Maintenance" parent="cab_management_menu" | ||||
|  |                   action="cab_maintanence_action" groups="base.group_user" sequence="20"/> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,61 @@ | |||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_timing_form_view"> | ||||
|  |             <field name="name">Cab Timing</field> | ||||
|  |             <field name="model">cab.timing</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form string="Cab Timing"> | ||||
|  |                     <header> | ||||
|  |                          <html> | ||||
|  |                             <div style="text-align: center;"> | ||||
|  |                                 <h1><centre>Set Your Cab Time</centre> </h1> | ||||
|  |                             </div> | ||||
|  |                          </html> | ||||
|  |                     </header> | ||||
|  | 
 | ||||
|  |                     <sheet> | ||||
|  |                         <group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="name"/> | ||||
|  |                                 <field name="cab_route"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="cab_time"  widget="many2many_tags"/> | ||||
|  |                                 <field name="seat"/> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.ui.view" id="cab_timing_tree_view"> | ||||
|  |             <field name="name">Cab Timing</field> | ||||
|  |             <field name="model">cab.timing</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree string="Cab Timing"> | ||||
|  |                     <field name="name"/> | ||||
|  |                     <field name="cab_route"/> | ||||
|  |                     <field name="cab_time"  widget="many2many_tags"/> | ||||
|  |                     <field name="seat"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record model="ir.actions.act_window" id="cab_timing_action"> | ||||
|  |             <field name="name">Cab Timing</field> | ||||
|  |             <field name="res_model">cab.timing</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form,calender</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create">Create Your First Record | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <menuitem id="cab_timing_menu" name="Timing" parent="cab_management_menu" action="cab_timing_action" | ||||
|  |                   groups="base.group_user" sequence="50"/> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,23 @@ | |||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  | 
 | ||||
|  |         <record id="email_template_edi_cab" model="mail.template"> | ||||
|  |             <field name="name">Cab Booked</field> | ||||
|  |             <field name="email_from">${(object.user_id.email}</field> | ||||
|  |             <field name="email_to">${object.partner_id.id}</field> | ||||
|  |             <field name="partner_to">${object.partner_id.id}</field> | ||||
|  |             <field name="subject">Cab Booked</field> | ||||
|  |             <field name="model_id" ref="cab_booking_management.model_cab_log" /> | ||||
|  |             <field name="auto_delete" eval="True" /> | ||||
|  |             <field name="body_html"><![CDATA[ | ||||
|  |                 <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> | ||||
|  |                     <p>Hello ${object.partner_id.name},</p> | ||||
|  |                     <p> This Email is to inform you that your request for cab on ${object.cab_log_date} is approved </p> | ||||
|  |                 </div> | ||||
|  |             ]]> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |     </data> | ||||
|  | </odoo> | ||||