17 changed files with 1436 additions and 0 deletions
			
			
		@ -0,0 +1,48 @@ | 
				
			|||||
 | 
					
 | 
				
			||||
 | 
					Report To Car Workshop v9 | 
				
			||||
 | 
					========================= | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					This module manages the report of Car Workshop. This is fully | 
				
			||||
 | 
					integrated with Car Workshop Management module. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Installation | 
				
			||||
 | 
					============ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					To install this module, you need to install Car Workshop Management | 
				
			||||
 | 
					module located in: | 
				
			||||
 | 
					https://apps.odoo.com/apps/modules/9.0/fleet_car_workshop/ | 
				
			||||
 | 
					Also Report Xls located in : https://github.com/OCA/reporting-engine | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Implementation | 
				
			||||
 | 
					============== | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Reports can be in downloaded in XLS and PDF format.Also we can | 
				
			||||
 | 
					filter results based on: | 
				
			||||
 | 
					    +Vehicle | 
				
			||||
 | 
					    +Date | 
				
			||||
 | 
					    +State/Status | 
				
			||||
 | 
					    +Customer | 
				
			||||
 | 
					    +Assigned Person. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Credits | 
				
			||||
 | 
					======= | 
				
			||||
 | 
					* Cybrosys Techno Solutions, http://www.Cybrosys.com | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Author | 
				
			||||
 | 
					------ | 
				
			||||
 | 
					Developer: Treesa Maria Jude @ cybrosys, treesa@cybrosys.in | 
				
			||||
 | 
					Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
@ -0,0 +1,24 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					import report | 
				
			||||
 | 
					import wizards | 
				
			||||
@ -0,0 +1,42 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					{ | 
				
			||||
 | 
					    'name': 'Car Workshop Report', | 
				
			||||
 | 
					    'version': '9.0.1.0.0', | 
				
			||||
 | 
					    'summary': 'Reports for Car Workshop Management', | 
				
			||||
 | 
					    'category': 'Industries', | 
				
			||||
 | 
					    'author': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'website': "http://www.cybrosys.com", | 
				
			||||
 | 
					    'company': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'depends': ['report_xls', 'fleet_car_workshop'], | 
				
			||||
 | 
					    'data': [ | 
				
			||||
 | 
					        'views/report_wizard.xml', | 
				
			||||
 | 
					        'views/workshop_pdf_template.xml' | 
				
			||||
 | 
					    ], | 
				
			||||
 | 
					    'license': 'LGPL-3', | 
				
			||||
 | 
					    'images': ['static/description/banner.jpg'], | 
				
			||||
 | 
					    'installable': True, | 
				
			||||
 | 
					    'auto_install': False, | 
				
			||||
 | 
					    'application': False, | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
@ -0,0 +1,25 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					import car_xls_report | 
				
			||||
 | 
					import car_pdf_report | 
				
			||||
 | 
					
 | 
				
			||||
@ -0,0 +1,405 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					import datetime | 
				
			||||
 | 
					from openerp.report import report_sxw | 
				
			||||
 | 
					from openerp.osv import osv | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					def get_xls(obj): | 
				
			||||
 | 
					    getvals = { | 
				
			||||
 | 
					        'name': obj.name, | 
				
			||||
 | 
					        'vehicle': obj.vehicle_id.name.name, | 
				
			||||
 | 
					        'date_deadline': obj.date_deadline, | 
				
			||||
 | 
					        'partner_id': obj.partner_id.name, | 
				
			||||
 | 
					        'user_id': obj.user_id.name, | 
				
			||||
 | 
					        'amount_total': obj.amount_total, | 
				
			||||
 | 
					        'stage_id': obj.stage_id.name, | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					    return getvals | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class CarReport(report_sxw.rml_parse): | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def __init__(self, cr, uid, name, context=None): | 
				
			||||
 | 
					        super(CarReport, self).__init__(cr, uid, name, context=context) | 
				
			||||
 | 
					        self.localcontext.update({ | 
				
			||||
 | 
					            'get_details': self.get_details, | 
				
			||||
 | 
					            'get_date': self.get_date, | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					        self.context = context | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def get_date(self): | 
				
			||||
 | 
					        date = datetime.datetime.now() | 
				
			||||
 | 
					        return date | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def get_details(self, data): | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        lines = [] | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        if data['filter_vehicle'] is True: | 
				
			||||
 | 
					            if data['filter_user'] is True: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                #  ----------------------- FILTER ON DATE PARTNER STATE SP ------------------------- | 
				
			||||
 | 
					                if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                        and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                            and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND PARTNER SP ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                            and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND STATE SP------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON PARTNER AND STATE SP------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                            and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE SP------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # -----------------------  FILTER ON PARTNER SP------------------------- | 
				
			||||
 | 
					                elif data['filter_partner'] is True: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON STATE SP------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ------------------------ FILTER ON SP--------------------------------------- | 
				
			||||
 | 
					                else: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.user_id.id == data['sales_person'][l] \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                #  ----------------------- FILTER ON DATE PARTNER STATE ------------------------- | 
				
			||||
 | 
					                if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                        and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                        and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND PARTNER ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND STATE ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                    and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON PARTNER AND STATE ------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                    and (data['date_to'] >= obj.date_deadline): | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # -----------------------  FILTER ON PARTNER ------------------------- | 
				
			||||
 | 
					                elif data['filter_partner'] is True: | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON STATE ------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if obj.stage_id.id == data['stage_id'][0] and obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- VEHICLE ONLY ------------------------- | 
				
			||||
 | 
					                else: | 
				
			||||
 | 
					                        for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        else: | 
				
			||||
 | 
					            if data['filter_user'] is True: | 
				
			||||
 | 
					                #  ----------------------- FILTER ON DATE PARTNER STATE SP ------------------------- | 
				
			||||
 | 
					                if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                        and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND PARTNER SP ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND STATE SP------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON PARTNER AND STATE SP------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE SP------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # -----------------------  FILTER ON PARTNER SP------------------------- | 
				
			||||
 | 
					                elif data['filter_partner'] is True: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                    lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON STATE SP------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False: | 
				
			||||
 | 
					                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ------------------------ FILTER ON SP--------------------------------------- | 
				
			||||
 | 
					                else: | 
				
			||||
 | 
					                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                #  ----------------------- FILTER ON DATE PARTNER STATE ------------------------- | 
				
			||||
 | 
					                if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                        and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                    and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND PARTNER ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE AND STATE ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                        if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                            lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON PARTNER AND STATE ------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if obj.stage_id.id == data['stage_id'][0] and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON DATE ------------------------- | 
				
			||||
 | 
					                elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                        if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline): | 
				
			||||
 | 
					                            lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # -----------------------  FILTER ON PARTNER ------------------------- | 
				
			||||
 | 
					                elif data['filter_partner'] is True: | 
				
			||||
 | 
					                    for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- FILTER ON STATE ------------------------- | 
				
			||||
 | 
					                elif data['stage_id'] is not False: | 
				
			||||
 | 
					                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                        if obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                            lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                # ----------------------- NO FILTERS ------------------------- | 
				
			||||
 | 
					                else: | 
				
			||||
 | 
					                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                        lines.append(get_xls(obj)) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        return lines | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class PrintReport(osv.AbstractModel): | 
				
			||||
 | 
					    _name = 'report.car_workshop_report.workshop_pdf' | 
				
			||||
 | 
					    _inherit = 'report.abstract_report' | 
				
			||||
 | 
					    _template = 'car_workshop_report.workshop_pdf' | 
				
			||||
 | 
					    _wrapped_report_class = CarReport | 
				
			||||
@ -0,0 +1,571 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					import xlwt | 
				
			||||
 | 
					import datetime | 
				
			||||
 | 
					from openerp.addons.report_xls.report_xls import report_xls | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					def get_xls(obj): | 
				
			||||
 | 
					    getvals = { | 
				
			||||
 | 
					        'name': obj.name, | 
				
			||||
 | 
					        'vehicle': obj.vehicle_id.name.name, | 
				
			||||
 | 
					        'date_deadline': obj.date_deadline, | 
				
			||||
 | 
					        'partner_id': obj.partner_id.name, | 
				
			||||
 | 
					        'user_id': obj.user_id.name, | 
				
			||||
 | 
					        'amount_total': obj.amount_total, | 
				
			||||
 | 
					        'stage_id': obj.stage_id.name, | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					    templist1 = [(1, 3, 0, 'text', getvals['name']), | 
				
			||||
 | 
					                 (2, 3, 0, 'text', getvals['vehicle']), | 
				
			||||
 | 
					                 (3, 2, 0, 'text', getvals['date_deadline']), | 
				
			||||
 | 
					                 (4, 2, 0, 'text', getvals['partner_id']), | 
				
			||||
 | 
					                 (5, 2, 0, 'text', getvals['user_id']), | 
				
			||||
 | 
					                 (6, 1, 0, 'number', getvals['amount_total']), | 
				
			||||
 | 
					                 (7, 1, 0, 'text',   getvals['stage_id']), | 
				
			||||
 | 
					                 ] | 
				
			||||
 | 
					    return templist1 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class SaleOrderReport(report_xls): | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def generate_xls_report(self, _p, _xs, data, objects, wb): | 
				
			||||
 | 
					            report_name = "Car Workshop Report" | 
				
			||||
 | 
					            ws = wb.add_sheet(report_name[:31]) | 
				
			||||
 | 
					            ws.panes_frozen = True | 
				
			||||
 | 
					            ws.remove_splits = True | 
				
			||||
 | 
					            ws.portrait = 1 | 
				
			||||
 | 
					            ws.fit_width_to_pages = 1 | 
				
			||||
 | 
					            row_pos = 0 | 
				
			||||
 | 
					            ws.set_horz_split_pos(row_pos) | 
				
			||||
 | 
					            ws.header_str = self.xls_headers['standard'] | 
				
			||||
 | 
					            ws.footer_str = self.xls_footers['standard'] | 
				
			||||
 | 
					            _xs.update({ | 
				
			||||
 | 
					                'xls_title': 'font: bold true, height 350;' | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            _xs.update({ | 
				
			||||
 | 
					                'xls_sub_title': 'font: bold false, height 250;' | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            cell_style = xlwt.easyxf(_xs['xls_title'] + _xs['center']) | 
				
			||||
 | 
					            cell_center = xlwt.easyxf(_xs['center']) | 
				
			||||
 | 
					            cell_center_bold_no = xlwt.easyxf(_xs['center'] + _xs['bold']) | 
				
			||||
 | 
					            cell_left_b = xlwt.easyxf(_xs['left'] + _xs['bold']) | 
				
			||||
 | 
					            c_specs = [('report_name', 8, 0, 'text', report_name)] | 
				
			||||
 | 
					            row_pos += 1 | 
				
			||||
 | 
					            row_data = self.xls_row_template(c_specs, ['report_name']) | 
				
			||||
 | 
					            row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=cell_style) | 
				
			||||
 | 
					            ws.row(row_pos - 1).height_mismatch = True | 
				
			||||
 | 
					            ws.row(row_pos - 1).height = 220 * 2 | 
				
			||||
 | 
					            row_pos += 1 | 
				
			||||
 | 
					            date_report = "Date Of Report :" + str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M %p")) | 
				
			||||
 | 
					            top2 = [('entry1', 3, 0, 'text', date_report)] | 
				
			||||
 | 
					            row_data = self.xls_row_template(top2, [x[0] for x in top2]) | 
				
			||||
 | 
					            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_left_b) | 
				
			||||
 | 
					            row_pos += 1 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            if data['filter'] == 'filter_date': | 
				
			||||
 | 
					                filter1 = "Filter By Date:" + 'Date' | 
				
			||||
 | 
					                top4 = [(1, 2, 0, 'text', filter1)] | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                row_data = self.xls_row_template(top4, [x[0] for x in top4]) | 
				
			||||
 | 
					                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center_bold_no) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                date_from = "Date from :" + str(data['date_from']) | 
				
			||||
 | 
					                date_to = "Date to :" + str(data['date_to']) | 
				
			||||
 | 
					                top6 = [(1, 2, 0, 'text', date_from), ] | 
				
			||||
 | 
					                row_data = self.xls_row_template(top6, [x[0] for x in top6]) | 
				
			||||
 | 
					                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					                top6 = [(1, 2, 0, 'text', date_to), ] | 
				
			||||
 | 
					                row_data = self.xls_row_template(top6, [x[0] for x in top6]) | 
				
			||||
 | 
					                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					                row_pos += 1 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                filter1 = "Filter By Date:" + 'No filter' | 
				
			||||
 | 
					                top4 = [(1, 2, 0, 'text', filter1)] | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                row_data = self.xls_row_template(top4, [x[0] for x in top4]) | 
				
			||||
 | 
					                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center_bold_no) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            templist = [(1, 3, 0, 'text', 'Task '), | 
				
			||||
 | 
					                        (2, 3, 0, 'text', 'Vehicle'), | 
				
			||||
 | 
					                        (3, 2, 0, 'text', 'Deadline'), | 
				
			||||
 | 
					                        (4, 2, 0, 'text', 'Customer'), | 
				
			||||
 | 
					                        (5, 2, 0, 'text', 'Assignrd To'), | 
				
			||||
 | 
					                        (6, 1, 0, 'text', 'Total'), | 
				
			||||
 | 
					                        (7, 1, 0, 'text', 'Status'), ] | 
				
			||||
 | 
					            row_pos += 1 | 
				
			||||
 | 
					            row_data = self.xls_row_template(templist, [x[0] for x in templist]) | 
				
			||||
 | 
					            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center_bold_no) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            if data['filter_vehicle'] is True: | 
				
			||||
 | 
					                    if data['filter_user'] is True: | 
				
			||||
 | 
					                        #  ----------------------- FILTER ON DATE PARTNER STATE SP ------------------------- | 
				
			||||
 | 
					                        if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                                and data['stage_id'] is not False: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                    and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                    and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                    and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                                templist1 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist1, [x[0] for x in templist1]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE AND PARTNER SP ------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                    and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                    and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE AND STATE SP------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                            if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                    and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                    and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON PARTNER AND STATE SP------------------------- | 
				
			||||
 | 
					                        elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                            if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                    and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE SP------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if (data['date_from'] <= obj.date_deadline)\ | 
				
			||||
 | 
					                                                and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # -----------------------  FILTER ON PARTNER SP------------------------- | 
				
			||||
 | 
					                        elif data['filter_partner'] is True: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                            if obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                    and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                    and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                templist3 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist3, [x[0] for x in templist3]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON STATE SP------------------------- | 
				
			||||
 | 
					                        elif data['stage_id'] is not False: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                templist4 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ------------------------ FILTER ON SP--------------------------------------- | 
				
			||||
 | 
					                        else: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.user_id.id == data['sales_person'][l] \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                templist4 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                                row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					                    else: | 
				
			||||
 | 
					                        #  ----------------------- FILTER ON DATE PARTNER STATE ------------------------- | 
				
			||||
 | 
					                        if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                                and data['stage_id'] is not False: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                            templist1 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist1, [x[0] for x in templist1]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE AND PARTNER ------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                            templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE AND STATE ------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if (data['date_from'] <= obj.date_deadline)\ | 
				
			||||
 | 
					                                            and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                            and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                        templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON PARTNER AND STATE ------------------------- | 
				
			||||
 | 
					                        elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                                and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                            templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE ------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if (data['date_from'] <= obj.date_deadline)  \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k] \ | 
				
			||||
 | 
					                                            and (data['date_to'] >= obj.date_deadline): | 
				
			||||
 | 
					                                        templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # -----------------------  FILTER ON PARTNER ------------------------- | 
				
			||||
 | 
					                        elif data['filter_partner'] is True: | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                and obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                            templist3 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist3, [x[0] for x in templist3]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON STATE ------------------------- | 
				
			||||
 | 
					                        elif data['stage_id'] is not False: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                            for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                            and obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                        templist4 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- VEHICLE ONLY ------------------------- | 
				
			||||
 | 
					                        else: | 
				
			||||
 | 
					                            if len(data['vehicles']) == 0: | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    templist4 = get_xls(obj) | 
				
			||||
 | 
					                                    row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                    row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					                            else: | 
				
			||||
 | 
					                                for k in range(0, len(data['vehicles'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.vehicle_id.name.id == data['vehicles'][k]: | 
				
			||||
 | 
					                                            templist4 = get_xls(obj) | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                if data['filter_user'] is True: | 
				
			||||
 | 
					                        #  ----------------------- FILTER ON DATE PARTNER STATE SP ------------------------- | 
				
			||||
 | 
					                        if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                                and data['stage_id'] is not False: | 
				
			||||
 | 
					                            for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and obj.partner_id.id == data['partner_name'][j]\ | 
				
			||||
 | 
					                                                and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                            templist1 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist1, [x[0] for x in templist1]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE AND PARTNER SP ------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                            for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                                and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                            templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE AND STATE SP------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON PARTNER AND STATE SP------------------------- | 
				
			||||
 | 
					                        elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                            for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                                and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                            templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON DATE SP------------------------- | 
				
			||||
 | 
					                        elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # -----------------------  FILTER ON PARTNER SP------------------------- | 
				
			||||
 | 
					                        elif data['filter_partner'] is True: | 
				
			||||
 | 
					                            for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                                for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                    for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                        obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                        if obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                                and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                            templist3 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                            row_data = self.xls_row_template(templist3, [x[0] for x in templist3]) | 
				
			||||
 | 
					                                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ----------------------- FILTER ON STATE SP------------------------- | 
				
			||||
 | 
					                        elif data['stage_id'] is not False: | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                            and obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        templist4 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                        # ------------------------ FILTER ON SP--------------------------------------- | 
				
			||||
 | 
					                        else: | 
				
			||||
 | 
					                            for l in range(0, len(data['sales_person'])): | 
				
			||||
 | 
					                                for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                    obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                    if obj.user_id.id == data['sales_person'][l]: | 
				
			||||
 | 
					                                        templist4 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                        row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                        row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					                else: | 
				
			||||
 | 
					                    #  ----------------------- FILTER ON DATE PARTNER STATE ------------------------- | 
				
			||||
 | 
					                    if data['filter'] == 'filter_date' and data['filter_partner'] is True \ | 
				
			||||
 | 
					                            and data['stage_id'] is not False: | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j] \ | 
				
			||||
 | 
					                                        and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                    templist1 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                    row_data = self.xls_row_template(templist1, [x[0] for x in templist1]) | 
				
			||||
 | 
					                                    row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # ----------------------- FILTER ON DATE AND PARTNER ------------------------- | 
				
			||||
 | 
					                    elif data['filter'] == 'filter_date' and data['filter_partner'] is True: | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if (data['date_from'] <= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                    templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                    row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                    row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # ----------------------- FILTER ON DATE AND STATE ------------------------- | 
				
			||||
 | 
					                    elif data['filter'] == 'filter_date' and data['stage_id'] is not False: | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline) \ | 
				
			||||
 | 
					                                    and obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # ----------------------- FILTER ON PARTNER AND STATE ------------------------- | 
				
			||||
 | 
					                    elif data['stage_id'] is not False and data['filter_partner'] is True: | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.stage_id.id == data['stage_id'][0] \ | 
				
			||||
 | 
					                                        and obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                    templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                    row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                    row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # ----------------------- FILTER ON DATE ------------------------- | 
				
			||||
 | 
					                    elif data['filter'] == 'filter_date': | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if (data['date_from'] <= obj.date_deadline) and (data['date_to'] >= obj.date_deadline): | 
				
			||||
 | 
					                                templist2 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                row_data = self.xls_row_template(templist2, [x[0] for x in templist2]) | 
				
			||||
 | 
					                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # -----------------------  FILTER ON PARTNER ------------------------- | 
				
			||||
 | 
					                    elif data['filter_partner'] is True: | 
				
			||||
 | 
					                        for j in range(0, len(data['partner_name'])): | 
				
			||||
 | 
					                            for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                                obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                                if obj.partner_id.id == data['partner_name'][j]: | 
				
			||||
 | 
					                                    templist3 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                    row_data = self.xls_row_template(templist3, [x[0] for x in templist3]) | 
				
			||||
 | 
					                                    row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # ----------------------- FILTER ON STATE ------------------------- | 
				
			||||
 | 
					                    elif data['stage_id'] is not False: | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            if obj.stage_id.id == data['stage_id'][0]: | 
				
			||||
 | 
					                                templist4 = get_xls(obj) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                                row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                    # ----------------------- NO FILTERS ------------------------- | 
				
			||||
 | 
					                    else: | 
				
			||||
 | 
					                        for i in self.pool.get('car.workshop').search(self.cr, self.uid, []): | 
				
			||||
 | 
					                            obj = self.pool.get('car.workshop').browse(self.cr, self.uid, i) | 
				
			||||
 | 
					                            templist4 = get_xls(obj) | 
				
			||||
 | 
					                            row_data = self.xls_row_template(templist4, [x[0] for x in templist4]) | 
				
			||||
 | 
					                            row_pos = self.xls_write_row(ws, row_pos, row_data, cell_center) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					SaleOrderReport('report.workshop_report', 'car.workshop') | 
				
			||||
| 
		 After Width: | Height: | Size: 65 KiB  | 
| 
		 After Width: | Height: | Size: 50 KiB  | 
| 
		 After Width: | Height: | Size: 12 KiB  | 
@ -0,0 +1,99 @@ | 
				
			|||||
 | 
					<section class="oe_container"> | 
				
			||||
 | 
					    <div class="oe_row oe_spaced"> | 
				
			||||
 | 
					        <h2 class="oe_slogan">Car Workshop Management PDF/XLS Report</h2> | 
				
			||||
 | 
					        <h3 class="oe_slogan">Reports with filter facilities</h3> | 
				
			||||
 | 
					        <h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4> | 
				
			||||
 | 
					            <ul> | 
				
			||||
 | 
					               <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   Reporting Module for Car Workshop Application.</li> | 
				
			||||
 | 
					                <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   PDF & XLS Reports.</li> | 
				
			||||
 | 
					                <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   Filter Facilities.</li> | 
				
			||||
 | 
					            </ul> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</section> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<section class="oe_container oe_dark"> | 
				
			||||
 | 
					    <div class="oe_row oe_spaced"> | 
				
			||||
 | 
					        <div class="oe_span12"> | 
				
			||||
 | 
					            <h2 class="oe_slogan">Report Wizard</h2> | 
				
			||||
 | 
					            <h3 class="oe_slogan">Both XLS and PDF reports</h3> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					         <div class="oe_span12"> | 
				
			||||
 | 
					              <p class='oe_mt32'> | 
				
			||||
 | 
					Reports can be downloaded in  XLS and PDF format. | 
				
			||||
 | 
					Filter results based on: | 
				
			||||
 | 
					        </p> | 
				
			||||
 | 
					             <ul> | 
				
			||||
 | 
					               <li style="list-style:none !important;"> ⇨</span>   Vehicles</li> | 
				
			||||
 | 
					                <li style="list-style:none !important;"> ⇨</span>   Date.</li> | 
				
			||||
 | 
					                <li style="list-style:none !important;"> ⇨</span>   State/Status.</li> | 
				
			||||
 | 
					                <li style="list-style:none !important;"> ⇨</span>   Customers.</li> | 
				
			||||
 | 
					                <li style="list-style:none !important;"> ⇨</span>   Technician.</li> | 
				
			||||
 | 
					            </ul> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					        <div class="oe_span12"> | 
				
			||||
 | 
					            <div class="oe_demo oe_picture oe_screenshot"> | 
				
			||||
 | 
					                    <img src="wizard.png"> | 
				
			||||
 | 
					            </div> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</section> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<section class="oe_container"> | 
				
			||||
 | 
					    <div class="oe_row oe_spaced"> | 
				
			||||
 | 
					        <div class="oe_span12"> | 
				
			||||
 | 
					            <h2 class="oe_slogan">PDF Report</h2> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					        <div class="oe_span5"> | 
				
			||||
 | 
					            <div class="oe_demo  oe_screenshot" style="margin: 15px 18%;"> | 
				
			||||
 | 
					                    <img src="pdf.png"> | 
				
			||||
 | 
					            </div> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</section> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<section class="oe_container oe_dark"> | 
				
			||||
 | 
					    <div class="oe_row oe_spaced"> | 
				
			||||
 | 
					        <div class="oe_span12"> | 
				
			||||
 | 
					            <h2 class="oe_slogan">XLS Report</h2> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					        <div class="oe_span25"> | 
				
			||||
 | 
					            <div class="oe_demo oe_picture oe_screenshot"> | 
				
			||||
 | 
					                    <img src="xls.png"> | 
				
			||||
 | 
					            </div> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</section> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<section class="oe_container"> | 
				
			||||
 | 
					    <div class="oe_row oe_spaced"> | 
				
			||||
 | 
					        <div class="oe_span12"> | 
				
			||||
 | 
					            <div class="col-md-12"> <p class='oe_mt32' style="text-align:center;"> | 
				
			||||
 | 
					                If you want to analyze the working of Car Workshop Management Module, Click Here:</p> | 
				
			||||
 | 
					            </div> | 
				
			||||
 | 
					            <div class="col-md-12"> <a  class="btn btn-info btn-lg mt8 center-block" | 
				
			||||
 | 
					                style="color: #FFFFFF !important; width: 55%;" href="https://apps.odoo.com/apps/modules/9.0/fleet_car_workshop/"><i | 
				
			||||
 | 
					                class="fa fa-car "></i> Car Workshop Management </a> | 
				
			||||
 | 
					            </div> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</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: 39 KiB  | 
| 
		 After Width: | Height: | Size: 29 KiB  | 
| 
		 After Width: | Height: | Size: 36 KiB  | 
@ -0,0 +1,67 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="utf-8"?> | 
				
			||||
 | 
					<openerp> | 
				
			||||
 | 
					     <data> | 
				
			||||
 | 
					        <record id="workshop_xls_view" model="ir.ui.view"> | 
				
			||||
 | 
					            <field name="name">workshop.xls.Report.view</field> | 
				
			||||
 | 
					            <field name="model">workshop.report</field> | 
				
			||||
 | 
					            <field name="arch" type="xml"> | 
				
			||||
 | 
					                  <form string="Workshop Report"> | 
				
			||||
 | 
					                        <group> | 
				
			||||
 | 
					                            <group> | 
				
			||||
 | 
					                                <field name="filter_vehicle"/> | 
				
			||||
 | 
					                                <field name="vehicles" widget="many2many_tags" attrs="{'invisible': [('filter_vehicle','=',False)], 'required': [('filter_vehicle', '=', True)]}"/> | 
				
			||||
 | 
					                            <field name="stage_id"/></group> | 
				
			||||
 | 
					                            <group> | 
				
			||||
 | 
					                           <field name="filter_partner"/> | 
				
			||||
 | 
					                            <field name="filter_user"/> | 
				
			||||
 | 
					                            </group> | 
				
			||||
 | 
					                        </group> | 
				
			||||
 | 
					                        <notebook> | 
				
			||||
 | 
					                             <page string="Filters" name="filters"> | 
				
			||||
 | 
					                                <group> | 
				
			||||
 | 
					                                     <field name="filter" /> | 
				
			||||
 | 
					                                </group> | 
				
			||||
 | 
					                                <group string="Dates"  attrs="{'invisible':[('filter', '!=', 'filter_date')]}"> | 
				
			||||
 | 
					                                   <field name="date_from" attrs="{'required': [('filter', '=', 'filter_date')]}"/> | 
				
			||||
 | 
					                                   <field name="date_to" attrs="{'required': [('filter', '=', 'filter_date')]}"/> | 
				
			||||
 | 
					                                </group> | 
				
			||||
 | 
					                             </page> | 
				
			||||
 | 
					                            <page string="Partner Details" attrs="{'invisible': [('filter_partner','=',False)]}"> | 
				
			||||
 | 
					                            <group> | 
				
			||||
 | 
					                                <field name="partner_name" widget="many2many_tags"  attrs="{'required': [('filter_partner', '=', True)]}"/> | 
				
			||||
 | 
					                            </group> | 
				
			||||
 | 
					                              </page> | 
				
			||||
 | 
					                             <page string="Sales Person Details" attrs="{'invisible': [('filter_user','=',False)]}"> | 
				
			||||
 | 
					                            <group> | 
				
			||||
 | 
					                                <field name="sales_person" widget="many2many_tags" attrs="{'required': [('filter_user', '=', True)]}"/> | 
				
			||||
 | 
					                            </group> | 
				
			||||
 | 
					                              </page> | 
				
			||||
 | 
					                        </notebook> | 
				
			||||
 | 
					                        <footer> | 
				
			||||
 | 
					                            <button name="check_report" string="Export xls" type="object" | 
				
			||||
 | 
					                                     class="oe_highlight"  style="margin: 0 5px;" | 
				
			||||
 | 
					                                     context="{'xls_export':1}" icon='gtk-print' /> | 
				
			||||
 | 
					                            <button name="print_pdf" string="Print Pdf" type="object" | 
				
			||||
 | 
					                                     class="oe_highlight"  style="margin: 0 5px;" | 
				
			||||
 | 
					                                    icon='gtk-print' /> | 
				
			||||
 | 
					                             or | 
				
			||||
 | 
					                        <button string="Cancel" class="oe_link" special="cancel" /> | 
				
			||||
 | 
					                        </footer> | 
				
			||||
 | 
					                </form> | 
				
			||||
 | 
					            </field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					         <record model="ir.actions.act_window" id="report_list_action"> | 
				
			||||
 | 
					            <field name="name">Workshop Report</field> | 
				
			||||
 | 
					            <field name="res_model">workshop.report</field> | 
				
			||||
 | 
					            <field name="view_type">form</field> | 
				
			||||
 | 
					            <field name="view_mode">form</field> | 
				
			||||
 | 
					             <field name="target">new</field> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					          <menuitem id="workshop_report_wizard" name="Workshop Report" | 
				
			||||
 | 
					                  parent="fleet_car_workshop.report_worksheet" | 
				
			||||
 | 
					                  action="report_list_action"/> | 
				
			||||
 | 
					         </data> | 
				
			||||
 | 
					</openerp> | 
				
			||||
@ -0,0 +1,70 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="utf-8" ?> | 
				
			||||
 | 
					<openerp> | 
				
			||||
 | 
					    <data> | 
				
			||||
 | 
					        <report id="action_report_claims" | 
				
			||||
 | 
					                 model="workshop.report" | 
				
			||||
 | 
					                 string="workshop" | 
				
			||||
 | 
					                 report_type="qweb-pdf" | 
				
			||||
 | 
					                 file="car_workshop_report.workshop_pdf" | 
				
			||||
 | 
					                 name="car_workshop_report.workshop_pdf" | 
				
			||||
 | 
					         /> | 
				
			||||
 | 
					        <template id="workshop_pdf"> | 
				
			||||
 | 
					            <t t-call="report.html_container"> | 
				
			||||
 | 
					                <t t-call="report.internal_layout"> | 
				
			||||
 | 
					                    <div class="page"> | 
				
			||||
 | 
					                        <div class="header" style="text-align:center;"><h1><strong>Car Workshop Report</strong></h1></div> | 
				
			||||
 | 
					                        <div class="row mt32 mb32" style="text-align:center;"> | 
				
			||||
 | 
					                                <div class="col-xs-12"> | 
				
			||||
 | 
					                               <h3>   <strong>  <p t-esc="res_company.name"/></strong></h3> | 
				
			||||
 | 
					                                    <strong>Date of report:</strong> | 
				
			||||
 | 
					                                       <p t-esc="get_date()"/> | 
				
			||||
 | 
					                                </div> | 
				
			||||
 | 
					                        </div> | 
				
			||||
 | 
					                        <table class="table table-condensed"> | 
				
			||||
 | 
					                            <thead> | 
				
			||||
 | 
					                                <tr > | 
				
			||||
 | 
					                                    <th >Task</th> | 
				
			||||
 | 
					                                    <th >Vehicle</th> | 
				
			||||
 | 
					                                    <th >Deadline</th> | 
				
			||||
 | 
					                                    <th >Customer</th> | 
				
			||||
 | 
					                                    <th >Assigned To</th> | 
				
			||||
 | 
					                                    <th >Amount</th> | 
				
			||||
 | 
					                                    <th >Status</th> | 
				
			||||
 | 
					                                </tr> | 
				
			||||
 | 
					                            </thead> | 
				
			||||
 | 
					                            <tbody> | 
				
			||||
 | 
					                                <t t-foreach="get_details(data)" t-as="o"> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                    <tr> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                            <span t-esc="o['name']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                            <span t-esc="o['vehicle']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                           <span t-esc="o['date_deadline']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                            <span t-esc="o['partner_id']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                            <span t-esc="o['user_id']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                            <span t-esc="o['amount_total']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                        <td> | 
				
			||||
 | 
					                                            <span t-esc="o['stage_id']"/> | 
				
			||||
 | 
					                                        </td> | 
				
			||||
 | 
					                                    </tr> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                                </t> | 
				
			||||
 | 
					                            </tbody> | 
				
			||||
 | 
					                        </table> | 
				
			||||
 | 
					                    </div> | 
				
			||||
 | 
					                </t> | 
				
			||||
 | 
					            </t> | 
				
			||||
 | 
					        </template> | 
				
			||||
 | 
					    </data> | 
				
			||||
 | 
					</openerp> | 
				
			||||
@ -0,0 +1,23 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					import report_wizard | 
				
			||||
@ -0,0 +1,62 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################## | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					#    Copyright (C) 2017-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 openerp import models, fields | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class SaleReportWizard (models.Model): | 
				
			||||
 | 
					    _name = "workshop.report" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    filter_partner = fields.Boolean('Enable Partner Filter') | 
				
			||||
 | 
					    filter = fields.Selection([('filter_date', 'Date'), ], "Filter by") | 
				
			||||
 | 
					    date_from = fields.Date("Start Date") | 
				
			||||
 | 
					    date_to = fields.Date("End Date") | 
				
			||||
 | 
					    filter_user = fields.Boolean("Enable Sales Person Filter") | 
				
			||||
 | 
					    filter_vehicle = fields.Boolean("Filter By Vehicle") | 
				
			||||
 | 
					    sales_person = fields.Many2many('res.users', string='Sales Person') | 
				
			||||
 | 
					    partner_name = fields.Many2many('res.partner', 'multiple_partners', 'partner_names', string='Partner Name') | 
				
			||||
 | 
					    vehicles = fields.Many2many('fleet.vehicle', string='Vehicle Name',) | 
				
			||||
 | 
					    stage_id = fields.Many2one('worksheet.stages', string='Select State') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def check_report(self, cr, uid, ids, context): | 
				
			||||
 | 
					        data = self.read(cr, uid, ids, ['partner_name', 'filter_partner', 'filter_user', | 
				
			||||
 | 
					                                        'filter', 'date_from', 'sales_person', | 
				
			||||
 | 
					                                        'date_to', 'filter_vehicle', 'vehicles', 'stage_id'], context=context)[0] | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        return {'type': 'ir.actions.report.xml', | 
				
			||||
 | 
					                'report_name': 'workshop_report', | 
				
			||||
 | 
					                'datas': data} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def print_pdf(self, cr, uid, ids, context=None): | 
				
			||||
 | 
					        if context is None: | 
				
			||||
 | 
					            context = {} | 
				
			||||
 | 
					        data = self.read(cr, uid, ids, ['partner_name', 'filter_partner', 'filter_user', | 
				
			||||
 | 
					                                        'filter', 'date_from', 'sales_person', | 
				
			||||
 | 
					                                        'date_to', 'filter_vehicle', 'vehicles', 'stage_id'], context=context)[0] | 
				
			||||
 | 
					        datas = { | 
				
			||||
 | 
					            'ids': context.get('active_ids', []), | 
				
			||||
 | 
					            'model': 'workshop.report', | 
				
			||||
 | 
					            'form': data | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        datas['form']['active_ids'] = context.get('active_ids', False) | 
				
			||||
 | 
					        return self.pool['report'].get_action(cr, uid, [], 'car_workshop_report.workshop_pdf', data=data, | 
				
			||||
 | 
					                                              context=context) | 
				
			||||
					Loading…
					
					
				
		Reference in new issue