diff --git a/freight_management_system/README.rst b/freight_management_system/README.rst new file mode 100644 index 000000000..01c152f5e --- /dev/null +++ b/freight_management_system/README.rst @@ -0,0 +1,17 @@ +Freight Management v15 +====================== +Freight Management + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +Configuration +============= + + No additional configurations needed + +Credits +======= + Developer: Megha v15 @ cybrosys, Contact: odoo@cybrosys.com diff --git a/freight_management_system/__init__.py b/freight_management_system/__init__.py new file mode 100644 index 000000000..66ddbe794 --- /dev/null +++ b/freight_management_system/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# Freight Management +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import model +from . import wizard diff --git a/freight_management_system/__manifest__.py b/freight_management_system/__manifest__.py new file mode 100644 index 000000000..890ed519c --- /dev/null +++ b/freight_management_system/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################### +# Freight Management +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Freight Management', + 'version': '15.0.1.0.0', + 'summary': 'Module for Managing All Frieght Operations', + 'description': 'Module for Managing All Frieght Operations', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'product', 'account'], + 'images': ['static/description/banner.png'], + 'data': [ + 'security/ir.model.access.csv', + 'data/freight_order_data.xml', + 'views/freight_order.xml', + 'views/freight_port.xml', + 'views/freight_container.xml', + 'views/custom_clearance.xml', + 'views/order_track.xml', + 'report/report_order.xml', + 'report/report_tracking.xml', + 'wizard/custom_revision.xml' + ], + 'installable': True, + 'application': False, + 'auto_install': False, + 'license': 'AGPL-3', +} diff --git a/freight_management_system/data/freight_order_data.xml b/freight_management_system/data/freight_order_data.xml new file mode 100644 index 000000000..c5405119b --- /dev/null +++ b/freight_management_system/data/freight_order_data.xml @@ -0,0 +1,23 @@ + + + + + + Freight Order Sequence + freight.order.sequence + FO-%(year)s-%(month)s-%(day)s- + + + + 4 + + + + Main Carriage + 0.00 + 0.00 + 0.00 + + + + \ No newline at end of file diff --git a/freight_management_system/doc/RELEASE_NOTES.md b/freight_management_system/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f445a014e --- /dev/null +++ b/freight_management_system/doc/RELEASE_NOTES.md @@ -0,0 +1,4 @@ +## Module + +#### 04.08.2022 +#### Version 15.0.1.0.0 diff --git a/freight_management_system/model/__init__.py b/freight_management_system/model/__init__.py new file mode 100644 index 000000000..b424eae87 --- /dev/null +++ b/freight_management_system/model/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import freight_order +from . import freight_port +from . import freight_container +from . import custom_clearance +from . import order_track diff --git a/freight_management_system/model/custom_clearance.py b/freight_management_system/model/custom_clearance.py new file mode 100644 index 000000000..92ca66e70 --- /dev/null +++ b/freight_management_system/model/custom_clearance.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from werkzeug import urls +from odoo import api, fields, models, _ + + +class CustomClearance(models.Model): + _name = 'custom.clearance' + _description = 'Custom Clearance' + + name = fields.Char('Name', compute='_compute_name') + freight_id = fields.Many2one('freight.order', required=True) + date = fields.Date('Date') + agent_id = fields.Many2one('res.partner', 'Agent', required=True) + loading_port_id = fields.Many2one('freight.port', string="Loading Port") + discharging_port_id = fields.Many2one('freight.port', + string="Discharging Port") + line_ids = fields.One2many('custom.clearance.line', 'line_id') + state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirm'), + ('done', 'Done')], default='draft') + + @api.depends('freight_id') + def _compute_name(self): + """Compute the name of custom clearance""" + for rec in self: + if rec.freight_id: + rec.name = 'CC - ' + str(rec.freight_id.name) + else: + rec.name = 'CC - ' + + @api.onchange('freight_id') + def _onchange_freight_id(self): + """Getting default values for loading and discharging port""" + for rec in self: + rec.date = rec.freight_id.order_date + rec.loading_port_id = rec.freight_id.loading_port_id + rec.discharging_port_id = rec.freight_id.discharging_port_id + rec.agent_id = rec.freight_id.agent_id + + def action_confirm(self): + """Send mail to inform agents to custom clearance is confirmed""" + for rec in self: + rec.name = 'CC' \ + ' - ' + rec.freight_id.name + rec.state = 'confirm' + base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') + Urls = urls.url_join(base_url, 'web#id=%(id)s&model=custom.clearance&view_type=form' % {'id': self.id}) + Urls_ = urls.url_join(base_url, 'web#id=%(id)s&model=freight.order&view_type=form' % {'id': self.freight_id.id}) + + mail_content = _('Hi %s,
' + 'The Custom Clearance %s is confirmed' + '' + '' + ) % (rec.agent_id.name, rec.name, Urls, + rec.name, Urls_, self.freight_id.name) + main_content = { + 'subject': _('Custom Clerance For %s') % self.freight_id.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': rec.agent_id.email, + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + + def action_revision(self): + """Creating custom revision""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Received/Delivered', + 'view_mode': 'form', + 'target': 'new', + 'res_model': 'custom.clearance.revision.wizard', + 'context': { + 'default_custom_id': self.id + } + } + + def get_revision(self): + """Getting details of custom revision""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Custom Revision', + 'view_mode': 'tree,form', + 'res_model': 'custom.clearance.revision', + 'domain': [('clearance_id', '=', self.id)], + 'context': "{'create': False}" + } + + +class CustomClearanceLine(models.Model): + _name = 'custom.clearance.line' + _description = 'Custom Clearance Line' + + name = fields.Char('Document Name') + document = fields.Binary(string="Documents", store=True, attachment=True) + line_id = fields.Many2one('custom.clearance') + + +class CustomClearanceRevision(models.Model): + _name = 'custom.clearance.revision' + _description = 'Custom Clearance Revision' + + name = fields.Char('Name') + + name = fields.Char() + reason = fields.Text() + clearance_id = fields.Many2one('custom.clearance') diff --git a/freight_management_system/model/freight_container.py b/freight_management_system/model/freight_container.py new file mode 100644 index 000000000..5b02b939d --- /dev/null +++ b/freight_management_system/model/freight_container.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import fields, models + + +class FreightContainer(models.Model): + _name = 'freight.container' + + name = fields.Char('Name', required=True) + code = fields.Char('Code') + size = fields.Float('Size', required=True) + size_uom_id = fields.Many2one('uom.uom', string='Size UOM') + weight = fields.Float('Weight', required=True) + weight_uom_id = fields.Many2one('uom.uom', string='Weight UOM') + volume = fields.Float('Volume', required=True) + volume_uom_id = fields.Many2one('uom.uom', string='Volume UOM') + active = fields.Boolean('Active', default=True) + state = fields.Selection([('available', 'Available'), + ('reserve', 'Reserve')], default='available') + + +class FreightService(models.Model): + _name = 'freight.service' + + name = fields.Char('Name', required=True) + sale_price = fields.Float('Sale Price', required=True) + line_ids = fields.One2many('freight.service.line', 'line_id') + + +class FreightServiceLine(models.Model): + _name = 'freight.service.line' + + partner_id = fields.Many2one('res.partner', string="Vendor") + sale = fields.Float('Sale Price') + line_id = fields.Many2one('freight.service') diff --git a/freight_management_system/model/freight_order.py b/freight_management_system/model/freight_order.py new file mode 100644 index 000000000..10fcbb3bd --- /dev/null +++ b/freight_management_system/model/freight_order.py @@ -0,0 +1,503 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from werkzeug import urls +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class FreightOrder(models.Model): + _name = 'freight.order' + _description = 'Freight Order' + + name = fields.Char('Name', default='New', readonly=True) + shipper_id = fields.Many2one('res.partner', 'Shipper', required=True, + help="Shipper's Details") + consignee_id = fields.Many2one('res.partner', 'Consignee', + help="Details of consignee") + type = fields.Selection([('import', 'Import'), ('export', 'Export')], + 'Import/Export', required=True, + help="Type of freight operation") + transport_type = fields.Selection([('land', 'Land'), ('air', 'Air'), + ('water', 'Water')], "Transport", + help='Type of transportation', + required=True) + land_type = fields.Selection([('ltl', 'LTL'), ('ftl', 'FTL')], + 'Land Shipping', + help="Types of shipment movement involved in Land") + water_type = fields.Selection([('fcl', 'FCL'), ('lcl', 'LCL')], + 'Water Shipping', + help="Types of shipment movement involved in Water") + order_date = fields.Date('Date', default=fields.Date.today(), + help="Date of order") + loading_port_id = fields.Many2one('freight.port', string="Loading Port", + required=True, + help="Loading port of the freight order") + discharging_port_id = fields.Many2one('freight.port', + string="Discharging Port", + required=True, + help="Discharging port of freight order") + state = fields.Selection([('draft', 'Draft'), ('submit', 'Submitted'), + ('confirm', 'Confirmed'), + ('invoice', 'Invoiced'), ('done', 'Done'), + ('cancel', 'Cancel')], default='draft') + clearance = fields.Boolean("Clearance") + clearance_count = fields.Integer(compute='compute_count') + invoice_count = fields.Integer(compute='compute_count') + total_order_price = fields.Float('Total', + compute='_compute_total_order_price') + total_volume = fields.Float('Total Volume', + compute='_compute_total_order_price') + total_weight = fields.Float('Total Weight', + compute='_compute_total_order_price') + order_ids = fields.One2many('freight.order.line', 'order_id') + route_ids = fields.One2many('freight.order.routes.line', 'route_id') + total_route_sale = fields.Float('Total Sale', + compute="_compute_total_route_cost") + service_ids = fields.One2many('freight.order.service', 'line_id') + total_service_sale = fields.Float('Service Total Sale', + compute="_compute_total_service_cost") + agent_id = fields.Many2one('res.partner', 'Agent', required=True, + help="Details of agent") + expected_date = fields.Date('Expected Date') + track_ids = fields.One2many('freight.track', 'track_id') + + @api.depends('order_ids.total_price', 'order_ids.volume', + 'order_ids.weight') + def _compute_total_order_price(self): + """Computing the price of the order""" + for rec in self: + rec.total_order_price = sum(rec.order_ids.mapped('total_price')) + rec.total_volume = sum(rec.order_ids.mapped('volume')) + rec.total_weight = sum(rec.order_ids.mapped('weight')) + + @api.depends('route_ids.sale') + def _compute_total_route_cost(self): + """Computing the total cost of route operation""" + for rec in self: + rec.total_route_sale = sum(rec.route_ids.mapped('sale')) + + @api.depends('service_ids.total_sale') + def _compute_total_service_cost(self): + """Computing the total cost of services""" + for rec in self: + rec.total_service_sale = sum(rec.service_ids.mapped('total_sale')) + + @api.model + def create(self, vals): + """Create Sequence""" + sequence_code = 'freight.order.sequence' + vals['name'] = self.env['ir.sequence'].next_by_code(sequence_code) + return super(FreightOrder, self).create(vals) + + def create_custom_clearance(self): + """Create custom clearance""" + clearance = self.env['custom.clearance'].create({ + 'name': 'CC - ' + self.name, + 'freight_id': self.id, + 'date': self.order_date, + 'loading_port_id': self.loading_port_id.id, + 'discharging_port_id': self.discharging_port_id.id, + 'agent_id': self.agent_id.id, + }) + result = { + 'name': 'action.name', + 'type': 'ir.actions.act_window', + 'views': [[False, 'form']], + 'target': 'current', + 'res_id': clearance.id, + 'res_model': 'custom.clearance', + } + self.clearance = True + return result + + def get_custom_clearance(self): + """Get custom clearance""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Custom Clearance', + 'view_mode': 'tree,form', + 'res_model': 'custom.clearance', + 'domain': [('freight_id', '=', self.id)], + 'context': "{'create': False}" + } + + def track_order(self): + """Track the order""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Received/Delivered', + 'view_mode': 'form', + 'target': 'new', + 'res_model': 'freight.order.track', + 'context': { + 'default_freight_id': self.id + } + } + + def create_invoice(self): + """Create invoice""" + lines = [] + if self.order_ids: + for order in self.order_ids: + value = (0, 0, { + 'name': order.product_id.name, + 'price_unit': order.price, + 'quantity': order.volume + order.weight, + }) + lines.append(value) + + if self.route_ids: + for route in self.route_ids: + value = (0, 0, { + 'name': route.operation_id.name, + 'price_unit': route.sale, + }) + lines.append(value) + + if self.service_ids: + for service in self.service_ids: + value = (0, 0, { + 'name': service.service_id.name, + 'price_unit': service.sale, + 'quantity': service.qty + }) + lines.append(value) + + invoice_line = { + 'move_type': 'out_invoice', + 'partner_id': self.shipper_id.id, + 'invoice_user_id': self.env.user.id, + 'invoice_origin': self.name, + 'ref': self.name, + 'invoice_line_ids': lines, + } + inv = self.env['account.move'].create(invoice_line) + result = { + 'name': 'action.name', + 'type': 'ir.actions.act_window', + 'views': [[False, 'form']], + 'target': 'current', + 'res_id': inv.id, + 'res_model': 'account.move', + } + self.state = 'invoice' + return result + + def action_cancel(self): + """Cancel the record""" + if self.state == 'draft' and self.state == 'submit': + self.state = 'cancel' + else: + raise ValidationError("You can't cancel this order") + + def get_invoice(self): + """View the invoice""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Invoice', + 'view_mode': 'tree,form', + 'res_model': 'account.move', + 'domain': [('ref', '=', self.name)], + 'context': "{'create': False}" + } + + @api.depends('name') + def compute_count(self): + """Compute custom clearance and account move's count""" + for rec in self: + if rec.env['custom.clearance'].search([('freight_id', '=', rec.id)]): + rec.clearance_count = rec.env['custom.clearance'].search_count( + [('freight_id', '=', rec.id)]) + else: + rec.clearance_count = 0 + if rec.env['account.move'].search([('ref', '=', rec.name)]): + rec.invoice_count = rec.env['account.move'].search_count( + [('ref', '=', rec.name)]) + else: + rec.invoice_count = 0 + + def action_submit(self): + """Submitting order""" + for rec in self: + rec.state = 'submit' + base_url = self.env['ir.config_parameter'].sudo().get_param( + 'web.base.url') + Urls = urls.url_join(base_url, 'web#id=%(id)s&model=freight.order&view_type=form' % {'id': self.id}) + + mail_content = _('Hi %s,
' + 'The Freight Order %s is Submitted' + '' + ) % (rec.agent_id.name, rec.name, Urls, rec.name) + email_to = self.env['res.partner'].search([ + ('id', 'in', (self.shipper_id.id, self.consignee_id.id, + self.agent_id.id))]) + for mail in email_to: + main_content = { + 'subject': _('Freight Order %s is Submitted') % self.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': mail.email + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + + def action_confirm(self): + """Confirm order""" + for rec in self: + clearance = self.env['custom.clearance'].search([ + ('freight_id', '=', self.id)]) + if clearance: + if clearance.state == 'confirm': + rec.state = 'confirm' + base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') + Urls = urls.url_join(base_url, 'web#id=%(id)s&model=freight.order&view_type=form' % {'id': self.id}) + mail_content = _('Hi %s,
' + 'The Freight Order %s is Confirmed ' + '' + ) % (rec.agent_id.name, rec.name, + Urls, rec.name) + email_to = self.env['res.partner'].search([ + ('id', 'in', (self.shipper_id.id, + self.consignee_id.id, self.agent_id.id))]) + for mail in email_to: + main_content = { + 'subject': _('Freight Order %s is Confirmed') % self.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': mail.email + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + elif clearance.state == 'draft': + raise ValidationError("the custom clearance ' %s ' is " + "not confirmed" % clearance.name) + else: + raise ValidationError("Create a custom clearance for %s" % rec.name) + + for line in rec.order_ids: + line.container_id.state = 'reserve' + + def action_done(self): + """Mark order as done""" + for rec in self: + base_url = self.env['ir.config_parameter'].sudo().get_param( + 'web.base.url') + Urls = urls.url_join(base_url, 'web#id=%(id)s&model=freight.order&view_type=form' % {'id': self.id}) + + mail_content = _('Hi %s,
' + 'The Freight Order %s is Completed' + '' + ) % (rec.agent_id.name, rec.name, Urls, rec.name) + email_to = self.env['res.partner'].search([ + ('id', 'in', (self.shipper_id.id, self.consignee_id.id, + self.agent_id.id))]) + for mail in email_to: + main_content = { + 'subject': _('Freight Order %s is completed') % self.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': mail.email + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + self.state = 'done' + + for line in rec.order_ids: + line.container_id.state = 'available' + + +class FreightOrderLine(models.Model): + _name = 'freight.order.line' + + order_id = fields.Many2one('freight.order') + container_id = fields.Many2one('freight.container', string='Container', + domain="[('state', '=', 'available')]") + product_id = fields.Many2one('product.product', string='Goods') + billing_type = fields.Selection([('weight', 'Weight'), + ('volume', 'Volume')], string="Billing On") + pricing_id = fields.Many2one('freight.price', string='Pricing') + price = fields.Float('Unit Price') + total_price = fields.Float('Total Price') + volume = fields.Float('Volume') + weight = fields.Float('Weight') + + @api.constrains('weight') + def _check_weight(self): + """Checking the weight of containers""" + for rec in self: + if rec.container_id and rec.billing_type: + if rec.billing_type == 'weight': + if rec.container_id.weight < rec.weight: + raise ValidationError( + 'The weight is must be less ' + 'than or equal to %s' % (rec.container_id.weight)) + + @api.constrains('volume') + def _check_volume(self): + """Checking the volume of containers""" + for rec in self: + if rec.container_id and rec.billing_type: + if rec.billing_type == 'volume': + if rec.container_id.volume < rec.volume: + raise ValidationError( + 'The volume is must be less ' + 'than or equal to %s' % (rec.container_id.volume)) + + @api.onchange('pricing_id', 'billing_type') + def onchange_price(self): + """Calculate the weight and volume of container""" + for rec in self: + if rec.billing_type == 'weight': + rec.volume = 0.00 + rec.price = rec.pricing_id.weight + elif rec.billing_type == 'volume': + rec.weight = 0.00 + rec.price = rec.pricing_id.volume + + @api.onchange('pricing_id', 'billing_type', 'volume', 'weight') + def onchange_total_price(self): + """Calculate sub total price""" + for rec in self: + if rec.billing_type and rec.pricing_id: + if rec.billing_type == 'weight': + rec.total_price = rec.weight * rec.price + elif rec.billing_type == 'volume': + rec.total_price = rec.volume * rec.price + + +class FreightOrderRouteLine(models.Model): + _name = 'freight.order.routes.line' + + route_id = fields.Many2one('freight.order') + operation_id = fields.Many2one('freight.routes', required=True) + source_loc = fields.Many2one('freight.port', 'Source Location') + destination_loc = fields.Many2one('freight.port', 'Destination Location') + transport_type = fields.Selection([('land', 'Land'), ('air', 'Air'), + ('water', 'Water')], "Transport", + required=True) + sale = fields.Float('Sale') + + @api.onchange('operation_id', 'transport_type') + def _onchange_operation_id(self): + """calculate the price of route operation""" + for rec in self: + if rec.operation_id and rec.transport_type: + if rec.transport_type == 'land': + rec.sale = rec.operation_id.land_sale + elif rec.transport_type == 'air': + rec.sale = rec.operation_id.air_sale + elif rec.transport_type == 'water': + rec.sale = rec.operation_id.water_sale + + +class FreightOrderServiceLine(models.Model): + _name = 'freight.order.service' + + line_id = fields.Many2one('freight.order') + service_id = fields.Many2one('freight.service', required=True) + partner_id = fields.Many2one('res.partner', string="Vendor") + qty = fields.Float('Quantity') + cost = fields.Float('Cost') + sale = fields.Float('Sale') + total_sale = fields.Float('Total Sale') + + @api.onchange('service_id', 'partner_id') + def _onchange_partner_id(self): + """Calculate the price of services""" + for rec in self: + if rec.service_id: + if rec.partner_id: + if rec.service_id.line_ids: + for service in rec.service_id.line_ids: + if rec.partner_id == service.partner_id: + rec.sale = service.sale + else: + rec.sale = rec.service_id.sale_price + else: + rec.sale = rec.service_id.sale_price + else: + rec.sale = rec.service_id.sale_price + + @api.onchange('qty', 'sale') + def _onchange_qty(self): + """Calculate the subtotal of route operation""" + for rec in self: + rec.total_sale = rec.qty * rec.sale + + +class Tracking(models.Model): + _name = 'freight.track' + + source_loc = fields.Many2one('freight.port', 'Source Location') + destination_loc = fields.Many2one('freight.port', 'Destination Location') + transport_type = fields.Selection([('land', 'Land'), ('air', 'Air'), + ('water', 'Water')], "Transport") + track_id = fields.Many2one('freight.order') + date = fields.Date('Date') + type = fields.Selection([('received', 'Received'), + ('delivered', 'Delivered')], 'Received/Delivered') diff --git a/freight_management_system/model/freight_port.py b/freight_management_system/model/freight_port.py new file mode 100644 index 000000000..bbc7d7ff5 --- /dev/null +++ b/freight_management_system/model/freight_port.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import fields, models + + +class FreightPort(models.Model): + _name = 'freight.port' + + name = fields.Char('Name') + code = fields.Char('Code') + state_id = fields.Many2one('res.country.state', + domain="[('country_id', '=', country_id)]") + country_id = fields.Many2one('res.country', required=True) + active = fields.Boolean('Active', default=True) + land = fields.Boolean('Land') + air = fields.Boolean('Air') + water = fields.Boolean('Water') + + +class FreightPricing(models.Model): + _name = 'freight.price' + + name = fields.Char('Name', required=True) + volume = fields.Float('Volume Price', required=True) + weight = fields.Float('Weight Price', required=True) + + +class FreightRoutes(models.Model): + _name = 'freight.routes' + + name = fields.Char('Name', required=True) + active = fields.Boolean('Active', default=True) + land_sale = fields.Float('Sale Price for Land', required=True) + air_sale = fields.Float('Sale Price for Air', required=True) + water_sale = fields.Float('Sale Price for Water', required=True) diff --git a/freight_management_system/model/order_track.py b/freight_management_system/model/order_track.py new file mode 100644 index 000000000..b3ebc65e3 --- /dev/null +++ b/freight_management_system/model/order_track.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from werkzeug import urls +from odoo import fields, models, _ + + +class FreightTracking(models.Model): + _name = 'freight.order.track' + + date = fields.Date('Date', default=fields.Date.today()) + freight_id = fields.Many2one('freight.order') + source_loc = fields.Many2one('freight.port', 'Source Location') + destination_loc = fields.Many2one('freight.port', 'Destination Location') + transport_type = fields.Selection([('land', 'Land'), ('air', 'Air'), + ('water', 'Water')], "Transport") + type = fields.Selection([('received', 'Received'), + ('delivered', 'Delivered')], 'Received/Delivered') + + def order_submit(self): + """Create tracking details of order""" + self.env['freight.track'].create({ + 'track_id': self.freight_id.id, + 'source_loc': self.source_loc.id, + 'destination_loc': self.destination_loc.id, + 'transport_type': self.transport_type, + 'date': self.date, + 'type': self.type, + }) + for rec in self.freight_id: + base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') + Urls = urls.url_join(base_url, 'web#id=%(id)s&model=freight.order&view_type=form' % {'id': self.id}) + + mail_content = _('Hi
' + 'The Freight Order %s is %s at %s' + '' + ) % (rec.name, self.type, + self.destination_loc.name, Urls, rec.name) + email_to = self.env['res.partner'].search([ + ('id', 'in', (rec.shipper_id.id, rec.consignee_id.id, + rec.agent_id.id))]) + for mail in email_to: + main_content = { + 'subject': _('Freight Order %s is %s at %s') % (rec.name, + self.type, + self.destination_loc.name,), + 'author_id': rec.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': mail.email + } + mail_id = rec.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + + +class FreightTrackingLine(models.Model): + _name = 'freight.order.track.line' + + track_line_id = fields.Many2one('freight.order.track') + source_loc = fields.Many2one('freight.port', 'Source Location') + destination_loc = fields.Many2one('freight.port', 'Destination Location') + transport_type = fields.Selection([('land', 'Land'), ('air', 'Air'), + ('water', 'Water')], "Transport") + date = fields.Date('Date') + type = fields.Selection([('receive', 'Received'), ('deliver', 'Delivered')], + 'Received/Delivered') diff --git a/freight_management_system/report/report_order.xml b/freight_management_system/report/report_order.xml new file mode 100644 index 000000000..81a7e96bf --- /dev/null +++ b/freight_management_system/report/report_order.xml @@ -0,0 +1,137 @@ + + + + + Freight Order + freight.order + qweb-pdf + freight_management_system.report_freight_order + freight_management_system.report_freight_order + 'Freight Order - %s' % object.name + + report + + + + + + \ No newline at end of file diff --git a/freight_management_system/report/report_tracking.xml b/freight_management_system/report/report_tracking.xml new file mode 100644 index 000000000..0c0baeb00 --- /dev/null +++ b/freight_management_system/report/report_tracking.xml @@ -0,0 +1,81 @@ + + + + + Order Tracking + freight.order + qweb-pdf + freight_management_system.report_freight_track + freight_management_system.report_freight_track + 'Order Tracking - %s' % object.name + + report + + + + \ No newline at end of file diff --git a/freight_management_system/security/ir.model.access.csv b/freight_management_system/security/ir.model.access.csv new file mode 100644 index 000000000..b8af18092 --- /dev/null +++ b/freight_management_system/security/ir.model.access.csv @@ -0,0 +1,18 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_freight_order,freight.order,model_freight_order,base.group_user,1,1,1,1 +access_freight_order_line,freight.order.line,model_freight_order_line,base.group_user,1,1,1,1 +access_freight_port,freight.port,model_freight_port,base.group_user,1,1,1,1 +access_freight_container,freight.container,model_freight_container,base.group_user,1,1,1,1 +access_freight_price,freight.price,model_freight_price,base.group_user,1,1,1,1 +access_freight_routes,freight.routes,model_freight_routes,base.group_user,1,1,1,1 +access_freight_order_routes_line,freight.order.routes.line,model_freight_order_routes_line,base.group_user,1,1,1,1 +access_freight_service,freight.service,model_freight_service,base.group_user,1,1,1,1 +access_freight_service_line,freight.service.line,model_freight_service_line,base.group_user,1,1,1,1 +access_freight_order_service,freight.order.service,model_freight_order_service,base.group_user,1,1,1,1 +access_custom_clearance,custom.clearance,model_custom_clearance,base.group_user,1,1,1,1 +access_custom_clearance_line,custom.clearance.line,model_custom_clearance_line,base.group_user,1,1,1,1 +access_freight_track,freight.track,model_freight_track,base.group_user,1,1,1,1 +access_freight_order_track,freight.order.track,model_freight_order_track,base.group_user,1,1,1,1 +access_custom_clearance_revision_wizard,custom.clearance.revision.wizard,model_custom_clearance_revision_wizard,base.group_user,1,1,1,1 +access_custom_clearance_revision,custom.clearance.revision,model_custom_clearance_revision,base.group_user,1,1,1,1 +access_freight_order_track_line,freight.order.track_line,model_freight_order_track_line,base.group_user,1,1,1,1 diff --git a/freight_management_system/static/description/assets/icons/check.png b/freight_management_system/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/freight_management_system/static/description/assets/icons/check.png differ diff --git a/freight_management_system/static/description/assets/icons/chevron.png b/freight_management_system/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/chevron.png differ diff --git a/freight_management_system/static/description/assets/icons/cogs.png b/freight_management_system/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/cogs.png differ diff --git a/freight_management_system/static/description/assets/icons/consultation.png b/freight_management_system/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/freight_management_system/static/description/assets/icons/consultation.png differ diff --git a/freight_management_system/static/description/assets/icons/ecom-black.png b/freight_management_system/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/ecom-black.png differ diff --git a/freight_management_system/static/description/assets/icons/education-black.png b/freight_management_system/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/freight_management_system/static/description/assets/icons/education-black.png differ diff --git a/freight_management_system/static/description/assets/icons/hotel-black.png b/freight_management_system/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/freight_management_system/static/description/assets/icons/hotel-black.png differ diff --git a/freight_management_system/static/description/assets/icons/license.png b/freight_management_system/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/freight_management_system/static/description/assets/icons/license.png differ diff --git a/freight_management_system/static/description/assets/icons/lifebuoy.png b/freight_management_system/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/freight_management_system/static/description/assets/icons/lifebuoy.png differ diff --git a/freight_management_system/static/description/assets/icons/logo.png b/freight_management_system/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/freight_management_system/static/description/assets/icons/logo.png differ diff --git a/freight_management_system/static/description/assets/icons/manufacturing-black.png b/freight_management_system/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/freight_management_system/static/description/assets/icons/manufacturing-black.png differ diff --git a/freight_management_system/static/description/assets/icons/pos-black.png b/freight_management_system/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/pos-black.png differ diff --git a/freight_management_system/static/description/assets/icons/puzzle.png b/freight_management_system/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/puzzle.png differ diff --git a/freight_management_system/static/description/assets/icons/restaurant-black.png b/freight_management_system/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/restaurant-black.png differ diff --git a/freight_management_system/static/description/assets/icons/service-black.png b/freight_management_system/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/freight_management_system/static/description/assets/icons/service-black.png differ diff --git a/freight_management_system/static/description/assets/icons/trading-black.png b/freight_management_system/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/freight_management_system/static/description/assets/icons/trading-black.png differ diff --git a/freight_management_system/static/description/assets/icons/training.png b/freight_management_system/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/freight_management_system/static/description/assets/icons/training.png differ diff --git a/freight_management_system/static/description/assets/icons/update.png b/freight_management_system/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/freight_management_system/static/description/assets/icons/update.png differ diff --git a/freight_management_system/static/description/assets/icons/user.png b/freight_management_system/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/freight_management_system/static/description/assets/icons/user.png differ diff --git a/freight_management_system/static/description/assets/icons/wrench.png b/freight_management_system/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/freight_management_system/static/description/assets/icons/wrench.png differ diff --git a/freight_management_system/static/description/assets/modules/budget_image.png b/freight_management_system/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/freight_management_system/static/description/assets/modules/budget_image.png differ diff --git a/freight_management_system/static/description/assets/modules/credit_image.png b/freight_management_system/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/freight_management_system/static/description/assets/modules/credit_image.png differ diff --git a/freight_management_system/static/description/assets/modules/employee_image.png b/freight_management_system/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/freight_management_system/static/description/assets/modules/employee_image.png differ diff --git a/freight_management_system/static/description/assets/modules/export_image.png b/freight_management_system/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/freight_management_system/static/description/assets/modules/export_image.png differ diff --git a/freight_management_system/static/description/assets/modules/gantt_image.png b/freight_management_system/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/freight_management_system/static/description/assets/modules/gantt_image.png differ diff --git a/freight_management_system/static/description/assets/modules/quotation_image.png b/freight_management_system/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/freight_management_system/static/description/assets/modules/quotation_image.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_1.png b/freight_management_system/static/description/assets/screenshots/freight_1.png new file mode 100644 index 000000000..fd6d2f31e Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_1.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_10.png b/freight_management_system/static/description/assets/screenshots/freight_10.png new file mode 100644 index 000000000..2648e7d7b Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_10.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_11.png b/freight_management_system/static/description/assets/screenshots/freight_11.png new file mode 100644 index 000000000..b4debf585 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_11.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_12.png b/freight_management_system/static/description/assets/screenshots/freight_12.png new file mode 100644 index 000000000..c232bbdda Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_12.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_13.png b/freight_management_system/static/description/assets/screenshots/freight_13.png new file mode 100644 index 000000000..04fe0fb6b Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_13.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_14.png b/freight_management_system/static/description/assets/screenshots/freight_14.png new file mode 100644 index 000000000..bc823016d Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_14.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_15.png b/freight_management_system/static/description/assets/screenshots/freight_15.png new file mode 100644 index 000000000..f8679c0c5 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_15.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_2.png b/freight_management_system/static/description/assets/screenshots/freight_2.png new file mode 100644 index 000000000..8ca55bc5d Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_2.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_3.png b/freight_management_system/static/description/assets/screenshots/freight_3.png new file mode 100644 index 000000000..5d1a14678 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_3.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_4.png b/freight_management_system/static/description/assets/screenshots/freight_4.png new file mode 100644 index 000000000..8133d071d Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_4.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_5.png b/freight_management_system/static/description/assets/screenshots/freight_5.png new file mode 100644 index 000000000..577351af1 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_5.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_6.png b/freight_management_system/static/description/assets/screenshots/freight_6.png new file mode 100644 index 000000000..40e221950 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_6.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_7.png b/freight_management_system/static/description/assets/screenshots/freight_7.png new file mode 100644 index 000000000..5a14f1f61 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_7.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_8.png b/freight_management_system/static/description/assets/screenshots/freight_8.png new file mode 100644 index 000000000..c98ad037e Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_8.png differ diff --git a/freight_management_system/static/description/assets/screenshots/freight_9.png b/freight_management_system/static/description/assets/screenshots/freight_9.png new file mode 100644 index 000000000..690c43f6b Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/freight_9.png differ diff --git a/freight_management_system/static/description/assets/screenshots/hero.gif b/freight_management_system/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..736c67016 Binary files /dev/null and b/freight_management_system/static/description/assets/screenshots/hero.gif differ diff --git a/freight_management_system/static/description/banner.png b/freight_management_system/static/description/banner.png new file mode 100644 index 000000000..be4435690 Binary files /dev/null and b/freight_management_system/static/description/banner.png differ diff --git a/freight_management_system/static/description/icon.png b/freight_management_system/static/description/icon.png new file mode 100644 index 000000000..c58325939 Binary files /dev/null and b/freight_management_system/static/description/icon.png differ diff --git a/freight_management_system/static/description/index.html b/freight_management_system/static/description/index.html new file mode 100644 index 000000000..91e548c16 --- /dev/null +++ b/freight_management_system/static/description/index.html @@ -0,0 +1,762 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Freight Management

+

+ A Module For Managing All freight operation +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This module helps you to manage all freight operations by Air + , Ocean, and Land.It is a used to manage all + aspects of your freight operations. +

+
+

+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Configure Freight Orders

+
+
+ +
+
+ +
+
+

+ Configure the Freight Operation Routes

+
+
+ +
+
+ +
+
+

+ Configure Freight Operation Services

+
+
+ +
+
+ +
+
+

+ Freight Operation Tracking

+
+
+ +
+
+ +
+
+

+ Custom Clearance And Custom Clearance Revision

+
+
+ +
+
+ +
+
+

+ Freight Order Reports

+
+
+ +
+
+ +
+
+

+ Freight Order Track Details

+
+
+ + +
+ +
+
+

+ Screenshots +

+
+
+

+ Freight Orders

+

+ After installation open freight management go to shipping, then create the fright orders.

+ +
+ +
+

+ Freight order lines

+

+ Add the fright order lines. Select the container, billing on and pricing suitable for the shipping. + Based on the Billing on and Pricing it will calculate the total price. + If we add more goods than container capacity it's show the warning message. +

+ +
+ +
+

+ Freight Operation Routes

+

+ Defining the routes for the shipping. Also we can add the operations for the routes. +

+ +
+ + +
+

+ Freight Operation Services

+

+ Defining the services for the shipping. Also we can add the Services. We can calculate the total sale amount based on tha vendor and the services provided by the vendor. +

+ +
+ + +
+

+ Custom Clearance

+

+ By clicking the custom clearance button we can create the custom clearance for the freight order. +
+ We can view the custom clearance in custom clearance menu under the custom.
+ After Conforming the custom clearance, we can confirm our fright order. +

+ +
+ + +
+

+ Custom Clearance Revision

+

+ We can create the revision for the custom clearance by clicking the revision button. +
+ We can view the custom clearance revision from the Revision smart button. +

+ +
+ +
+

+ Freight Order Invoice

+

+ We can create the invoice for the freight order by clicking the invoice button. +

+ +
+ + +
+

+ Freight Order Tracking

+

+ we can track our order by click the tracking button. +

+ +
+ +
+ +
+

+ Freight Order Reporting

+

+ from the action bar we can print the fright order report and order tracked report. +

+ +
+

+ Freight Order

+ + +

+ Freight Order Tracking

+ +
+ +
+

+ Configure Ports

+

+ Under configuration menu we can see a port menu, for configuring our ports. Here we can specify the port location, and available transport methods. +

+ +
+ +
+

+ Configure Pricing

+

+ Under configuration menu we can see a Pricing list menu, it is used to configuring the pricing. Here we can specify the pricing in both weight and volume. +

+ +
+ +
+

+ Configure Containers

+

+ Under configuration menu we can see a Containers menu, it is used to configuring the Container. Here we can specify + the weight and volume. If we add more goods than container capacity it's show the warning message. When once order + is confirmed for particular container then we can't be used it for another order. +

+ +
+ +
+

+ Configure Services

+

+ Under configuration menu we can see a Services menu, it is used to configuring the Services. Here we can set specific amount for particular vendor. +

+ +
+
+ +
+
+

Suggested Products

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

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/freight_management_system/views/custom_clearance.xml b/freight_management_system/views/custom_clearance.xml new file mode 100644 index 000000000..4681a7346 --- /dev/null +++ b/freight_management_system/views/custom_clearance.xml @@ -0,0 +1,75 @@ + + + + + Custom Clearance + custom.clearance + + + + + + + + + + Custom Clearance + custom.clearance + +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + Custom Clearance + ir.actions.act_window + custom.clearance + tree,form + +

+ Define a new custom clearance +

+
+
+ + + +
+
\ No newline at end of file diff --git a/freight_management_system/views/freight_container.xml b/freight_management_system/views/freight_container.xml new file mode 100644 index 000000000..fb2b82749 --- /dev/null +++ b/freight_management_system/views/freight_container.xml @@ -0,0 +1,122 @@ + + + + + + Container + freight.container + + + + + + + + + + Container + freight.container + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+
+
+ + freight.Container.search + freight.container + + + + + + + + + Freight Container + ir.actions.act_window + freight.container + tree,form + +

+ Define a new freight container +

+
+
+ + + Service + freight.service + + + + + + + + + + Service + freight.service + +
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ + + Freight Service + ir.actions.act_window + freight.service + tree,form + +

+ Define a new freight service +

+
+
+ + + + +
+
\ No newline at end of file diff --git a/freight_management_system/views/freight_order.xml b/freight_management_system/views/freight_order.xml new file mode 100644 index 000000000..b6e60dfe0 --- /dev/null +++ b/freight_management_system/views/freight_order.xml @@ -0,0 +1,181 @@ + + + + + Freight Order + freight.order + + + + + + + + + + + Freight Order + freight.order + +
+
+
+ +
+ + +
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+
+ +
+
+ + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + +
+
+
+
+
+ + + Freight Order + ir.actions.act_window + freight.order + tree,form + +

+ Define a new freight order +

+
+ +
+ + + + +
+
\ No newline at end of file diff --git a/freight_management_system/views/freight_port.xml b/freight_management_system/views/freight_port.xml new file mode 100644 index 000000000..73d746110 --- /dev/null +++ b/freight_management_system/views/freight_port.xml @@ -0,0 +1,159 @@ + + + + + + Port + freight.port + + + + + + + + + + Port + freight.port + +
+ + + + + + + + + + + + + + + + +
+
+
+ + + freight.port.search + freight.port + + + + + + + + + Freight Port + ir.actions.act_window + freight.port + tree,form + +

+ Define a new freight port +

+
+ +
+ + + Price + freight.price + + + + + + + + + + + Price + freight.price + +
+ + + + + + + + + + + + + +
+
+
+ + + Freight Price + ir.actions.act_window + freight.price + tree,form + +

+ Define a new freight price +

+
+
+ + + Routes + freight.routes + + + + + + + + + Routes + freight.routes + +
+ + + + + + + + + + + + +
+
+
+ + + Freight Routes + ir.actions.act_window + freight.routes + tree,form + +

+ Define a new freight routes +

+
+
+ + + + + + +
+
\ No newline at end of file diff --git a/freight_management_system/views/order_track.xml b/freight_management_system/views/order_track.xml new file mode 100644 index 000000000..4363d94ea --- /dev/null +++ b/freight_management_system/views/order_track.xml @@ -0,0 +1,50 @@ + + + + + Track + freight.order.track + +
+ + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + Track Order + ir.actions.act_window + freight.order.track + form + +

+ Define a new track order +

+
+
+ +
+
\ No newline at end of file diff --git a/freight_management_system/wizard/__init__.py b/freight_management_system/wizard/__init__.py new file mode 100644 index 000000000..50f2808b5 --- /dev/null +++ b/freight_management_system/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import custom_revision diff --git a/freight_management_system/wizard/custom_revision.py b/freight_management_system/wizard/custom_revision.py new file mode 100644 index 000000000..021c97554 --- /dev/null +++ b/freight_management_system/wizard/custom_revision.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Megha K () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from werkzeug import urls +from odoo import models, fields, _ + + +class CustomClearanceRevisionReason(models.TransientModel): + _name = 'custom.clearance.revision.wizard' + _description = 'Custom Clearance Revision' + + name = fields.Text('Reason', required=True) + custom_id = fields.Many2one('custom.clearance') + text = fields.Char() + + def create_revision(self): + """create revision""" + for rec in self.custom_id: + base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') + Urls = urls.url_join(base_url, + 'web#id=%(id)s&model=custom.clearance&view_type=form' % {'id': self.custom_id.id}) + Urls_ = urls.url_join(base_url, + 'web#id=%(id)s&model=freight.order&view_type=form' % {'id': self.custom_id.freight_id.id}) + + mail_content = _('Hi %s,
' + 'The Custom Clearance Revision with reason: %s' + '' + '' + ) % (rec.agent_id.name, self.name, Urls, + rec.name, Urls_, + self.custom_id.freight_id.name) + main_content = { + 'subject': _('Custom Clerance Revision For %s') % self.custom_id.freight_id.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': rec.agent_id.email, + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + + self.env['custom.clearance.revision'].create({ + 'clearance_id': self.custom_id.id, + 'reason': self.name, + 'name': 'RE: ' + self.custom_id.name + }) diff --git a/freight_management_system/wizard/custom_revision.xml b/freight_management_system/wizard/custom_revision.xml new file mode 100644 index 000000000..9c2988315 --- /dev/null +++ b/freight_management_system/wizard/custom_revision.xml @@ -0,0 +1,37 @@ + + + + + Custom Clearance Revision + custom.clearance.revision.wizard + +
+ + + + + + + +
+
+
+
+
+ + + Custom Clearance Revision + ir.actions.act_window + custom.clearance.revision.wizard + form + +

+ Define a new custom clearance revision +

+
+ +
+
+
\ No newline at end of file