Browse Source

[ADD] Initial Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
efb641d1d0
  1. 28
      stock_transport_management/README.rst
  2. 26
      stock_transport_management/__init__.py
  3. 25
      stock_transport_management/__manifest__.py
  4. 27
      stock_transport_management/models/__init__.py
  5. 32
      stock_transport_management/models/transport_sale_order.py
  6. 47
      stock_transport_management/models/transport_vehicle.py
  7. 71
      stock_transport_management/models/transport_vehicle_status.py
  8. 61
      stock_transport_management/models/transport_warehouse.py
  9. 25
      stock_transport_management/report/__init__.py
  10. 85
      stock_transport_management/report/transport_xlsx.py
  11. BIN
      stock_transport_management/static/description/banner.jpg
  12. BIN
      stock_transport_management/static/description/cybro_logo.png
  13. BIN
      stock_transport_management/static/description/icon.png
  14. 112
      stock_transport_management/static/description/index.html
  15. BIN
      stock_transport_management/static/description/report.png
  16. BIN
      stock_transport_management/static/description/sale_order.png
  17. BIN
      stock_transport_management/static/description/transport_details.png
  18. BIN
      stock_transport_management/static/description/vehicle.png
  19. 14
      stock_transport_management/views/transport_report.xml
  20. 65
      stock_transport_management/views/transport_vehicle_status_view.xml
  21. 85
      stock_transport_management/views/transport_vehicle_view.xml
  22. 22
      stock_transport_management/views/transport_warehouse_view.xml
  23. 36
      stock_transport_management/views/transport_wizard_view.xml
  24. 15
      stock_transport_management/views/transportation_sale_order_view.xml
  25. 24
      stock_transport_management/wizards/__init__.py
  26. 47
      stock_transport_management/wizards/transport_wizard.py

28
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

26
stock_transport_management/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
from . import models
import wizards,report

25
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,
}

27
stock_transport_management/models/__init__.py

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
from . import transport_vehicle
import transport_vehicle_status
import transport_sale_order
import transport_warehouse

32
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(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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)])

47
stock_transport_management/models/transport_vehicle.py

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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)

71
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(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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'})

61
stock_transport_management/models/transport_warehouse.py

@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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

25
stock_transport_management/report/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
from . import transport_xlsx

85
stock_transport_management/report/transport_xlsx.py

@ -0,0 +1,85 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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')

BIN
stock_transport_management/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
stock_transport_management/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
stock_transport_management/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

112
stock_transport_management/static/description/index.html

@ -0,0 +1,112 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Stock Transport Management (STM)</h2>
<h3 class="oe_slogan">Manage Stock Transport With Ease</h3>
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4>
<div>
<h4><p>Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Manage transport details of picking the stock.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Assigns transportation details to sale order.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Option to reshedule transportation entries.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Transport entry reports.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">
Stock Transport Management, aims to manage transport details of picking the stocks.
</p>
<p>
*While creating new quotation you can assign transport via , this order and will be
transferred via this Vehicle.
<p>
* You can view all transport entry under Sales &gt; Transportation Details menu.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="vehicle.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan">Assign Transport Details To Sale Order</h3>
<div class="oe_span6">
<p class='oe_mt32'>
<centre>We can assign transportation details to sale order</centre>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="sale_order.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan"> Transportation Details</h3>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="transport_details.png">
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
View all transport entries and click on the start button to start the journey. We also have
option to reschedule transportation..
</p>
</div>
</div>
</section>
<section class="oe_container dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan"> Report</h3>
<div class="oe_span6">
<p class='oe_mt32'>
Have option to print report of all transportation entries
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="report.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<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>

BIN
stock_transport_management/static/description/report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
stock_transport_management/static/description/sale_order.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
stock_transport_management/static/description/transport_details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
stock_transport_management/static/description/vehicle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

14
stock_transport_management/views/transport_report.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<report
id="transport_xlsx"
model="vehicle.status"
string=" "
report_type="xlsx"
name="stock_transport_management.transport_report_xls.xlsx"
file="stock_transport_management.transport_report_xls.xlsx"
attachment_use="False"
/>
</data>
</odoo>

65
stock_transport_management/views/transport_vehicle_status_view.xml

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="transport_management_vehicle_status_form_view">
<field name="name">Vehicles</field>
<field name="model">vehicle.status</field>
<field name="arch" type="xml">
<form string="Vehicle">
<header>
<button name="action_reshedule" states="cancel" string="Reshedule" type="object" class="btn-primary"/>
<button name="start_action" states="draft" string="Start" type="object" class="btn-primary"/>
<button name="action_cancel" states="draft" type="object" string="Cancel"/>
<button name="action_waiting" states="start" type="object" string="Waiting"/>
<button name="action_done" states="draft,start,waiting" type="object" string="Done"/>
<field name="state" widget="statusbar" statusbar_visible="draft,start,waiting,cancel,done" readonly="1"/>
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="delivery_order"/>
<field name="sale_order"/>
</group>
<group>
<field name="transport_date"/>
<field name="no_parcels"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="vehicle_status_tree_view" model="ir.ui.view">
<field name="name">Vehicle</field>
<field name="model">vehicle.status</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="delivery_order"/>
<field name="sale_order"/>
<field name="transport_date"/>
<field name="no_parcels"/>
</tree>
</field>
</record>
<record id="vehicle_status_action" model="ir.actions.act_window">
<field name="name">Vehicle</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">vehicle.status</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="vehicle_status_tree_view"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new Vehicle.
</p>
</field>
</record>
<menuitem id="main_transportation_vehicle_status_menu" name="Transportation Details" parent="sales_team.menu_sales" action="vehicle_status_action" sequence="25"/>
</data>
</odoo>

85
stock_transport_management/views/transport_vehicle_view.xml

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="transport_management_vehicle_creation_form_view">
<field name="name">Vehicles</field>
<field name="model">sale.vehicle</field>
<field name="arch" type="xml">
<form string="Vehicle">
<sheet>
<field name="vehicle_image" widget="image" class="oe_avatar"/>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" placeholder=" Vehicle Name" style="width:50%%"/>
</h1>
<label for="licence_plate"/>
<h2>
<field name="licence_plate" style="width:25%%"/>
</h2>
</div>
<group>
<group>
<field name="driver_name"/>
<field name="vehicle_address"/>
<field name="vehicle_city"/>
<field name="country_id"/>
</group>
<group>
<field name="mob_no"/>
<field name="vehicle_zip"/>
<field name="state_id"/>
<field name="active_available" readonly="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="vehicle_template_kanban_view" model="ir.ui.view">
<field name="name">sale.vehicle.kanban</field>
<field name="model">sale.vehicle</field>
<field name="arch" type="xml">
<kanban>
<field name="vehicle_image" modifiers="{}"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('sale.vehicle', 'vehicle_image', record.id.value)"/>
</div>
<div class="oe_kanban_details">
<strong>
<span t-if="record.name.value">[<field name="name"/>]</span>
<ul>
<li>Name :<field name="driver_name"/></li>
<li>Phone Number : <field name="mob_no"/> </li>
</ul>
</strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="vehicle_template_action" model="ir.actions.act_window">
<field name="name">Vehicle</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.vehicle</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="vehicle_template_kanban_view"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new Vehicle.
</p>
</field>
</record>
<menuitem id="main_transportation_vehicle_creation_menu" name="Vehicles" parent="sales_team.menu_sale_config" action="vehicle_template_action" sequence="2"/>
</data>
</odoo>

22
stock_transport_management/views/transport_warehouse_view.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="transportation_warehouse_form_view" model="ir.ui.view">
<field name="name"> Warehouse</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="transportation_name"/>
<field name="no_parcels"/>
</xpath>
<notebook position="inside">
<page string="Transportation Details">
<field name="transportation_details"/>
</page>
</notebook>
</field>
</record>
</data>
</odoo>

36
stock_transport_management/views/transport_wizard_view.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="transport_report_wizard_view_form" model="ir.ui.view">
<field name="name">Transport Report</field>
<field name="model">transport.report.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<group>
<field name="start_date"/>
</group>
<group>
<field name="end_date"/>
</group>
</group>
<footer>
<button name="print_report" type="object" string="Print XLS" class="oe_highlight"/>
or
<button special="cancel" string="Cancel"/>
</footer>
</form>
</field>
</record>
<act_window
id="transport_report_open_wizard"
name="Transport Report"
res_model="transport.report.wizard"
view_mode="form"
view_id="transport_report_wizard_view_form"
target="new"/>
<menuitem id="main_transportation_wizard_menu" name="Transportation Reports" parent="sales_team.menu_sale_report" action="transport_report_open_wizard" sequence="22"/>
</data>
</odoo>

15
stock_transport_management/views/transportation_sale_order_view.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="transportation_sale_order_form_view" model="ir.ui.view">
<field name="name"> Sale Order</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='confirmation_date']" position="after">
<field name="transportation_name"/>
</xpath>
</field>
</record>
</data>
</odoo>

24
stock_transport_management/wizards/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
import transport_wizard

47
stock_transport_management/wizards/transport_wizard.py

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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'
}
Loading…
Cancel
Save