diff --git a/stock_transport_management/README.rst b/stock_transport_management/README.rst new file mode 100644 index 000000000..aeb9a8516 --- /dev/null +++ b/stock_transport_management/README.rst @@ -0,0 +1,28 @@ +Stock Transport Management v10 +============================== + +This module was developed to manage the stock .It helps to track transportation details of every transfer. + +Installation +============ +You need **report_xlsx** to install this module. + +Configuration +============= + +Nothing to configure. + +Usage +===== + +To use this functionality, you need to: +#.First create vehicles(Sales > Configuration > Vehicles) +#Now ,you can create sale order ( Sales > Sale Order) +#.All Transportation details can be viewed in Sales > Transportation Details. +#. You can also print reports of every transportation.(Sales > Reports > Transportation Reports) + + +Credits +======= +Developer: Saritha @ cybrosys + diff --git a/stock_transport_management/__init__.py b/stock_transport_management/__init__.py new file mode 100644 index 000000000..0ae54827c --- /dev/null +++ b/stock_transport_management/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + + +from . import models +import wizards,report diff --git a/stock_transport_management/__manifest__.py b/stock_transport_management/__manifest__.py new file mode 100644 index 000000000..c9e422924 --- /dev/null +++ b/stock_transport_management/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +{ + 'name': "Stock Transport Management", + 'version': '10.0.1.0.0', + 'summary': """Manage Stock Transport Management With Ease""", + 'description': """This Module Manage Transport Management Of Stocks""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Tools', + 'depends': ['base', 'sale', 'stock', 'report'], + 'data': [ + 'views/transport_vehicle_view.xml', + 'views/transport_vehicle_status_view.xml', + 'views/transportation_sale_order_view.xml', + 'views/transport_warehouse_view.xml', + 'views/transport_wizard_view.xml', + 'views/transport_report.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} \ No newline at end of file diff --git a/stock_transport_management/models/__init__.py b/stock_transport_management/models/__init__.py new file mode 100644 index 000000000..a9837635d --- /dev/null +++ b/stock_transport_management/models/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from . import transport_vehicle +import transport_vehicle_status +import transport_sale_order +import transport_warehouse diff --git a/stock_transport_management/models/transport_sale_order.py b/stock_transport_management/models/transport_sale_order.py new file mode 100644 index 000000000..2d63c39cd --- /dev/null +++ b/stock_transport_management/models/transport_sale_order.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from odoo import models, fields + + +class VehicleSaleOrder(models.Model): + _inherit = 'sale.order' + + transportation_name = fields.Many2one('sale.vehicle', string="Transportation Via", + domain=[('active_available', '=', True)]) + diff --git a/stock_transport_management/models/transport_vehicle.py b/stock_transport_management/models/transport_vehicle.py new file mode 100644 index 000000000..a0da484c1 --- /dev/null +++ b/stock_transport_management/models/transport_vehicle.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from odoo import models, fields, api + + +class VehicleCreation(models.Model): + _name = 'sale.vehicle' + + name = fields.Char(string="Vehicle Name", required=True) + driver_name = fields.Many2one('res.partner', string="Contact Name", required=True) + vehicle_image = fields.Binary(string='Image', store=True, attachment=True) + licence_plate = fields.Char(string="Licence Plate", required=True) + mob_no = fields.Char(string="Mobile Number", required=True) + vehicle_address = fields.Char(string="Address") + vehicle_city = fields.Char(string='City') + vehicle_zip = fields.Char(string='ZIP') + state_id = fields.Many2one('res.country.state', string='State') + country_id = fields.Many2one('res.country', string='Country') + active_available = fields.Boolean(string="Active", default=True) + + @api.one + def complete_name_compute(self): + self.name = self.ref_name + if self.licence_plate: + self.name = str(self.licence_plate) + ' / ' + str(self.ref_name) + diff --git a/stock_transport_management/models/transport_vehicle_status.py b/stock_transport_management/models/transport_vehicle_status.py new file mode 100644 index 000000000..fd0cababf --- /dev/null +++ b/stock_transport_management/models/transport_vehicle_status.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from odoo import models, fields + + +class VehicleStatus(models.Model): + _name = 'vehicle.status' + + name = fields.Char(string="Vehicle Name", required=True) + transport_date = fields.Date(string="Transportation Date") + no_parcels = fields.Char(string="No Of Parcels") + sale_order = fields.Char(string='Order Reference') + delivery_order = fields.Char(string="Delivery Order") + state = fields.Selection([ + ('draft', 'Draft'), + ('start', 'Start'), + ('waiting', 'Waiting'), + ('cancel', 'Cancel'), + ('done', 'Done'), + ], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft') + + def start_action(self): + vehicle = self.env['sale.vehicle'].search([('name', '=', self.name)]) + vals = {'active_available': False} + vehicle.write(vals) + self.write({'state': 'start'}) + + def action_cancel(self): + self.write({'state': 'cancel'}) + vehicle = self.env['sale.vehicle'].search([('name', '=', self.name)]) + vals = {'active_available': True} + vehicle.write(vals) + + def action_done(self): + self.write({'state': 'done'}) + vehicle = self.env['sale.vehicle'].search([('name', '=', self.name)]) + vals = {'active_available': True} + vehicle.write(vals) + + def action_waiting(self): + vehicle = self.env['sale.vehicle'].search([('name', '=', self.name)]) + vals = {'active_available': False} + vehicle.write(vals) + self.write({'state': 'waiting'}) + + def action_reshedule(self): + self.write({'state': 'draft'}) + + + diff --git a/stock_transport_management/models/transport_warehouse.py b/stock_transport_management/models/transport_warehouse.py new file mode 100644 index 000000000..a3f2829e3 --- /dev/null +++ b/stock_transport_management/models/transport_warehouse.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from odoo import models, fields, api + + +class VehicleSaleOrder(models.Model): + _inherit = 'stock.picking' + + transportation_name = fields.Char(string="Transportation Via", compute="get_transportation") + no_parcels = fields.Integer(string="No Of Parcels") + transportation_details = fields.One2many('vehicle.status', compute='fetch_details', string="Transportation Details") + + @api.multi + def get_transportation(self): + res = self.env['sale.order'].search([('name', '=', self.sale_id.name)]) + self.transportation_name = res.transportation_name.name + order = self.env['vehicle.status'].search([('sale_order', '=', self.sale_id.name)]) + if not order and self.transportation_name: + vals = {'name': self.transportation_name, + 'no_parcels':self.no_parcels, + 'sale_order': self.sale_id.name, + 'delivery_order': self.name, + 'transport_date': self.min_date, + } + obj = self.env['vehicle.status'].create(vals) + return obj + + @api.onchange('no_parcels') + def get_parcel(self): + order = self.env['vehicle.status'].search([('sale_order', '=', self.sale_id.name)]) + vals = {'no_parcels': self.no_parcels} + order.write(vals) + + @api.multi + def fetch_details(self): + order = self.env['vehicle.status'].search([('sale_order', '=', self.sale_id.name)]) + self.transportation_details = order + + + diff --git a/stock_transport_management/report/__init__.py b/stock_transport_management/report/__init__.py new file mode 100644 index 000000000..06371cc60 --- /dev/null +++ b/stock_transport_management/report/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from . import transport_xlsx + diff --git a/stock_transport_management/report/transport_xlsx.py b/stock_transport_management/report/transport_xlsx.py new file mode 100644 index 000000000..ed6e3da49 --- /dev/null +++ b/stock_transport_management/report/transport_xlsx.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## +from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx +import datetime + + +class TransportReportXls(ReportXlsx): + + def generate_xlsx_report(self, workbook, data, obj): + logged_users = self.env['res.company']._company_default_get('sale.order') + sheet = workbook.add_worksheet() + format1 = workbook.add_format({'font_size': 16, 'align': 'vcenter', 'bg_color': '#D3D3D3', 'bold': True}) + format1.set_font_color('#000080') + format2 = workbook.add_format({'font_size': 12, 'bold': True, 'bg_color': '#D3D3D3'}) + format3 = workbook.add_format({'font_size': 10, 'bold': True}) + format4 = workbook.add_format({'font_size': 10}) + format1.set_align('center') + format2.set_align('center') + format3.set_align('center') + sheet.merge_range('A3:L3', "Transportation Report", format1) + report_date = datetime.datetime.now().strftime("%m/%d/%Y") + sheet.merge_range('K1:L1', report_date, format4) + sheet.merge_range('A1:B1', logged_users.name, format4) + if data['form']['start_date']: + date_start = data['form']['start_date'] + else: + date_start = "" + if data['form']['end_date']: + date_end = data['form']['end_date'] + else: + date_end = "" + if date_start: + sheet.write('A5', "Date From :", format3) + sheet.write('A6', date_start, format4) + if date_end: + sheet.write('C5', "Date To :", format3) + sheet.write('C6', date_end, format4) + sheet.write('A8', "Vehicle Name ", format2) + sheet.write('B8', "", format2) + sheet.write('C8', "Date", format2) + sheet.write('D8', "", format2) + sheet.write('E8', "Sale Order", format2) + sheet.write('F8', "", format2) + sheet.write('G8', "Delivery Order", format2) + sheet.write('H8', "", format2) + sheet.write('I8', "No of Parcels", format2) + sheet.write('J8', "", format2) + sheet.write('K8', "Status", format2) + if date_start and date_end: + report_obj = self.env['vehicle.status'].search([('transport_date', ">=", date_start) and + ('transport_date', "<=", date_end)]) + else: + report_obj = self.env['vehicle.status'].search([]) + row_number = 9 + col_number = 0 + for values in report_obj: + sheet.write(row_number, col_number, values['name'], format3) + sheet.write(row_number, col_number + 2, values['transport_date'], format3) + sheet.write(row_number, col_number + 4, values['sale_order'], format3) + sheet.write(row_number, col_number + 6, values['delivery_order'], format3) + sheet.write(row_number, col_number + 8, values['no_parcels'], format3) + sheet.write(row_number, col_number + 10, values['state'], format3) + row_number += 1 + +TransportReportXls('report.stock_transport_management.transport_report_xls.xlsx', 'vehicle.status') \ No newline at end of file diff --git a/stock_transport_management/static/description/banner.jpg b/stock_transport_management/static/description/banner.jpg new file mode 100644 index 000000000..7ed4cd1d0 Binary files /dev/null and b/stock_transport_management/static/description/banner.jpg differ diff --git a/stock_transport_management/static/description/cybro_logo.png b/stock_transport_management/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/stock_transport_management/static/description/cybro_logo.png differ diff --git a/stock_transport_management/static/description/icon.png b/stock_transport_management/static/description/icon.png new file mode 100644 index 000000000..870e80e1c Binary files /dev/null and b/stock_transport_management/static/description/icon.png differ diff --git a/stock_transport_management/static/description/index.html b/stock_transport_management/static/description/index.html new file mode 100644 index 000000000..e70c1077c --- /dev/null +++ b/stock_transport_management/static/description/index.html @@ -0,0 +1,112 @@ +
+
+

Stock Transport Management (STM)

+

Manage Stock Transport With Ease

+

Cybrosys Technologies , www.cybrosys.com

+
+

Major Features:

+
    +
  •   Manage transport details of picking the stock.
  • +
  •   Assigns transportation details to sale order.
  • +
  •   Option to reshedule transportation entries.
  • +
  •   Transport entry reports.
  • +
+
+
+
+ +
+
+
+

Overview

+

+ Stock Transport Management, aims to manage transport details of picking the stocks. +

+

+ *While creating new quotation you can assign transport via , this order and will be + transferred via this Vehicle. +

+ * You can view all transport entry under Sales > Transportation Details menu. +

+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+

Assign Transport Details To Sale Order

+
+

+ We can assign transportation details to sale order +

+
+
+
+ +
+
+
+
+ +
+
+

Transportation Details

+
+
+ +
+
+
+

+ View all transport entries and click on the start button to start the journey. We also have + option to reschedule transportation.. +

+
+
+
+ +
+
+

Report

+
+

+ Have option to print report of all transportation entries +

+
+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ + +
+ + + + diff --git a/stock_transport_management/static/description/report.png b/stock_transport_management/static/description/report.png new file mode 100644 index 000000000..73ccce0d6 Binary files /dev/null and b/stock_transport_management/static/description/report.png differ diff --git a/stock_transport_management/static/description/sale_order.png b/stock_transport_management/static/description/sale_order.png new file mode 100644 index 000000000..c85d245d1 Binary files /dev/null and b/stock_transport_management/static/description/sale_order.png differ diff --git a/stock_transport_management/static/description/transport_details.png b/stock_transport_management/static/description/transport_details.png new file mode 100644 index 000000000..5ce46a78c Binary files /dev/null and b/stock_transport_management/static/description/transport_details.png differ diff --git a/stock_transport_management/static/description/vehicle.png b/stock_transport_management/static/description/vehicle.png new file mode 100644 index 000000000..5be1c043d Binary files /dev/null and b/stock_transport_management/static/description/vehicle.png differ diff --git a/stock_transport_management/views/transport_report.xml b/stock_transport_management/views/transport_report.xml new file mode 100644 index 000000000..4ba502333 --- /dev/null +++ b/stock_transport_management/views/transport_report.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/stock_transport_management/views/transport_vehicle_status_view.xml b/stock_transport_management/views/transport_vehicle_status_view.xml new file mode 100644 index 000000000..a66f8fc19 --- /dev/null +++ b/stock_transport_management/views/transport_vehicle_status_view.xml @@ -0,0 +1,65 @@ + + + + + Vehicles + vehicle.status + +
+
+
+ + + + + + + + + + + + + +
+
+
+ + + Vehicle + vehicle.status + + + + + + + + + + + + + Vehicle + ir.actions.act_window + vehicle.status + tree,form + form + + +

+ Click to define a new Vehicle. +

+
+
+ + + +
+
\ No newline at end of file diff --git a/stock_transport_management/views/transport_vehicle_view.xml b/stock_transport_management/views/transport_vehicle_view.xml new file mode 100644 index 000000000..2bce8787b --- /dev/null +++ b/stock_transport_management/views/transport_vehicle_view.xml @@ -0,0 +1,85 @@ + + + + + Vehicles + sale.vehicle + +
+ + +
+
+ + + + + + + + + + + + + + +
+
+
+
+ + + sale.vehicle.kanban + sale.vehicle + + + + + +
+
+ +
+
+ + [] +
    +
  • Name :
  • +
  • Phone Number :
  • +
+
+
+
+
+
+
+
+
+ + + Vehicle + ir.actions.act_window + sale.vehicle + kanban,tree,form + form + + +

+ Click to define a new Vehicle. +

+
+
+ + + +
+
\ No newline at end of file diff --git a/stock_transport_management/views/transport_warehouse_view.xml b/stock_transport_management/views/transport_warehouse_view.xml new file mode 100644 index 000000000..e3297a7df --- /dev/null +++ b/stock_transport_management/views/transport_warehouse_view.xml @@ -0,0 +1,22 @@ + + + + + Warehouse + stock.picking + + + + + + + + + + + + + + + + diff --git a/stock_transport_management/views/transport_wizard_view.xml b/stock_transport_management/views/transport_wizard_view.xml new file mode 100644 index 000000000..d24272d52 --- /dev/null +++ b/stock_transport_management/views/transport_wizard_view.xml @@ -0,0 +1,36 @@ + + + + + Transport Report + transport.report.wizard + +
+ + + + + + + + +
+
+
+
+
+ + + + +
+
\ No newline at end of file diff --git a/stock_transport_management/views/transportation_sale_order_view.xml b/stock_transport_management/views/transportation_sale_order_view.xml new file mode 100644 index 000000000..e2d77813b --- /dev/null +++ b/stock_transport_management/views/transportation_sale_order_view.xml @@ -0,0 +1,15 @@ + + + + + Sale Order + sale.order + + + + + + + + + \ No newline at end of file diff --git a/stock_transport_management/wizards/__init__.py b/stock_transport_management/wizards/__init__.py new file mode 100644 index 000000000..fb93ca856 --- /dev/null +++ b/stock_transport_management/wizards/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +import transport_wizard diff --git a/stock_transport_management/wizards/transport_wizard.py b/stock_transport_management/wizards/transport_wizard.py new file mode 100644 index 000000000..6ea8d8efb --- /dev/null +++ b/stock_transport_management/wizards/transport_wizard.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# 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 . +# +############################################################################## + +from odoo import models, fields, _ + + +class TransportReport(models.TransientModel): + _name = 'transport.report.wizard' + + start_date = fields.Date(string="From Date") + end_date = fields.Date(string="To Date") + + def print_report(self): + context = self._context + datas = {'ids': context.get('active_ids', [])} + datas['model'] = 'vehicle.status' + datas['form'] = self.read()[0] + for field in datas['form'].keys(): + if isinstance(datas['form'][field], tuple): + datas['form'][field] = datas['form'][field][0] + return {'type': 'ir.actions.report.xml', + 'report_name': 'stock_transport_management.transport_report_xls.xlsx', + 'datas': datas, + 'name': 'Transportation Report' + } + +