diff --git a/odoo_3pl_connector/README.rst b/odoo_3pl_connector/README.rst new file mode 100755 index 000000000..fa6159a07 --- /dev/null +++ b/odoo_3pl_connector/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Odoo 3pl Connector +================= +Facilitates seamless integration between Odoo and 3pl for efficient supply chain management. + +Configuration +============= +* Install openpyxl (pip install openpyxl) + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Unnimaya C O, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/odoo_3pl_connector/__init__.py b/odoo_3pl_connector/__init__.py new file mode 100755 index 000000000..d6d5dd87c --- /dev/null +++ b/odoo_3pl_connector/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import controllers +from . import models +from . import wizard diff --git a/odoo_3pl_connector/__manifest__.py b/odoo_3pl_connector/__manifest__.py new file mode 100755 index 000000000..4b8a3ed63 --- /dev/null +++ b/odoo_3pl_connector/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': "Odoo 3pl Connector", + 'version': '16.0.1.0.0', + 'category': 'Productivity', + 'summary': """Facilitates seamless integration between Odoo and 3pl + for efficient supply chain management.""", + 'description': """Enabling a smooth integration between Odoo and 3pl + streamlines supply chain management for enhanced efficiency. This + integration facilitates seamless coordination, optimizing processes + across the entire supply chain. """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['stock'], + 'data': [ + 'security/ir.model.access.csv', + 'views/ftp_server_views.xml', + 'views/stock_warehouse_views.xml', + 'views/stock_picking_views.xml', + 'wizard/tpl_operation_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'odoo_3pl_connector/static/src/js/action_manager.js', + ], + }, + 'external_dependencies': { + 'python': ['openpyxl'] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/odoo_3pl_connector/controllers/__init__.py b/odoo_3pl_connector/controllers/__init__.py new file mode 100755 index 000000000..bca8fad22 --- /dev/null +++ b/odoo_3pl_connector/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import odoo_3pl_connector diff --git a/odoo_3pl_connector/controllers/odoo_3pl_connector.py b/odoo_3pl_connector/controllers/odoo_3pl_connector.py new file mode 100755 index 000000000..90fe5cf4b --- /dev/null +++ b/odoo_3pl_connector/controllers/odoo_3pl_connector.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +from odoo import http +from odoo.http import content_disposition, request +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """Controller for XlsX report""" + + @http.route('/xlsx_reports', type='http', auth='public', + methods=['POST']) + def get_report_xlsx(self, model, options, output_format, report_name): + """Function for generating xlsx report""" + try: + if output_format == 'xlsx': + response = request.make_response( + None, + headers=[('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', + content_disposition(report_name + '.xlsx'))] + ) + request.env[model].sudo().get_xlsx_report(options, response) + response.set_cookie('fileToken', 'dummy token') + return response + except Exception as e: + s_error = http.serialize_exception(e) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': s_error + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/odoo_3pl_connector/demo/.~lock.imported_report.xlsx# b/odoo_3pl_connector/demo/.~lock.imported_report.xlsx# new file mode 100644 index 000000000..f4d0a6383 --- /dev/null +++ b/odoo_3pl_connector/demo/.~lock.imported_report.xlsx# @@ -0,0 +1 @@ +,cybrounnimaya,cybrounnimaya,25.06.2024 09:24,file:///home/cybrounnimaya/.config/libreoffice/4; \ No newline at end of file diff --git a/odoo_3pl_connector/demo/imported_report.xlsx b/odoo_3pl_connector/demo/imported_report.xlsx new file mode 100755 index 000000000..afaec9946 Binary files /dev/null and b/odoo_3pl_connector/demo/imported_report.xlsx differ diff --git a/odoo_3pl_connector/doc/RELEASE_NOTES.md b/odoo_3pl_connector/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..09b03b2c6 --- /dev/null +++ b/odoo_3pl_connector/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 19.09.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Odoo 3pl Connector diff --git a/odoo_3pl_connector/models/__init__.py b/odoo_3pl_connector/models/__init__.py new file mode 100755 index 000000000..766e71b7c --- /dev/null +++ b/odoo_3pl_connector/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import ftp_server +from . import stock_picking +from . import stock_warehouse diff --git a/odoo_3pl_connector/models/ftp_server.py b/odoo_3pl_connector/models/ftp_server.py new file mode 100755 index 000000000..b47bd698f --- /dev/null +++ b/odoo_3pl_connector/models/ftp_server.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from ftplib import FTP +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class FtpServer(models.Model): + """Model to connect with FTP""" + _name = 'ftp.server' + _description = 'FTP Server' + + name = fields.Char(string='Name', + help='Name for FTP Server') + host = fields.Char(string="Host", + help="Host of FTP server") + username = fields.Char(string="Username", + help="Username of FTP server") + password = fields.Char(string="Password", + help="Password of FTP server") + + @api.model_create_multi + def create(self, vals_list): + """Inherited to create directories in FTP""" + for vals in vals_list: + try: + ftp = FTP(vals['host'], vals['username'], + vals['password']) + ftp.encoding = "utf-8" + for item in ['Export_Sales', 'Export_Sales_Return', + 'Export_Purchase', 'Import_Sales', + 'Import_Sales_Return', + 'Import_Purchase']: + ftp.mkd(item.replace(' ', '_')) + except Exception as e: + raise ValidationError(f"FTP Connection Error: {str(e)}") + return super().create(vals_list) + + def unlink(self): + """Inherited to removing directories from FTP""" + for rec in self: + try: + ftp = FTP(rec.host, + rec.username, + rec.password) + ftp.encoding = "utf-8" + for item in ['Export_Sales', 'Export_Sales_Return', + 'Export_Purchase', 'Import_Sales', + 'Import_Sales_Return', + 'Import_Purchase']: + ftp.rmd(item) + except Exception as e: + raise ValidationError(f"FTP Error: {str(e)}") + return super().unlink() diff --git a/odoo_3pl_connector/models/stock_picking.py b/odoo_3pl_connector/models/stock_picking.py new file mode 100755 index 000000000..dca3d3458 --- /dev/null +++ b/odoo_3pl_connector/models/stock_picking.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import fields, models + + +class StockPicking(models.Model): + """Inherited stock. picking to add 3pl fields""" + _inherit = 'stock.picking' + + is_exported = fields.Boolean(string='Exported', readonly=True, + help="True for exported pickings") + is_delivered = fields.Boolean(string='Delivered', readonly=True, + help="True for delivered pickings") diff --git a/odoo_3pl_connector/models/stock_warehouse.py b/odoo_3pl_connector/models/stock_warehouse.py new file mode 100755 index 000000000..6a103f322 --- /dev/null +++ b/odoo_3pl_connector/models/stock_warehouse.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import fields, models + + +class StockWarehouse(models.Model): + """Inherited stock. warehouse to add 3pl fields""" + _inherit = 'stock.warehouse' + + server_id = fields.Many2one('ftp.server', string='FTP Server', + help='Choose the FTP Server') diff --git a/odoo_3pl_connector/security/ir.model.access.csv b/odoo_3pl_connector/security/ir.model.access.csv new file mode 100755 index 000000000..93ca61263 --- /dev/null +++ b/odoo_3pl_connector/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_ftp_server_user,access.ftp.server.user,model_ftp_server,base.group_user,1,1,1,1 +access_tpl_operation_user,access.tpl.operation.user,model_tpl_operation,base.group_user,1,1,1,1 diff --git a/odoo_3pl_connector/static/description/assets/icons/check.png b/odoo_3pl_connector/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/check.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/chevron.png b/odoo_3pl_connector/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/chevron.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/cogs.png b/odoo_3pl_connector/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/cogs.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/consultation.png b/odoo_3pl_connector/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/consultation.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/ecom-black.png b/odoo_3pl_connector/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/ecom-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/education-black.png b/odoo_3pl_connector/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/education-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/hotel-black.png b/odoo_3pl_connector/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/hotel-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/license.png b/odoo_3pl_connector/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/license.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/lifebuoy.png b/odoo_3pl_connector/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/lifebuoy.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/manufacturing-black.png b/odoo_3pl_connector/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/manufacturing-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/pos-black.png b/odoo_3pl_connector/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/pos-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/puzzle.png b/odoo_3pl_connector/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/puzzle.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/restaurant-black.png b/odoo_3pl_connector/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/restaurant-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/service-black.png b/odoo_3pl_connector/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/service-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/trading-black.png b/odoo_3pl_connector/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/trading-black.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/training.png b/odoo_3pl_connector/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/training.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/update.png b/odoo_3pl_connector/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/update.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/user.png b/odoo_3pl_connector/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/user.png differ diff --git a/odoo_3pl_connector/static/description/assets/icons/wrench.png b/odoo_3pl_connector/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/icons/wrench.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/categories.png b/odoo_3pl_connector/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/categories.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/check-box.png b/odoo_3pl_connector/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/check-box.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/compass.png b/odoo_3pl_connector/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/compass.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/corporate.png b/odoo_3pl_connector/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/corporate.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/customer-support.png b/odoo_3pl_connector/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/customer-support.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/cybrosys-logo.png b/odoo_3pl_connector/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/cybrosys-logo.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/features.png b/odoo_3pl_connector/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/features.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/logo.png b/odoo_3pl_connector/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/logo.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/pictures.png b/odoo_3pl_connector/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/pictures.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/pie-chart.png b/odoo_3pl_connector/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/pie-chart.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/right-arrow.png b/odoo_3pl_connector/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/right-arrow.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/star.png b/odoo_3pl_connector/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/star.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/support.png b/odoo_3pl_connector/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/support.png differ diff --git a/odoo_3pl_connector/static/description/assets/misc/whatsapp.png b/odoo_3pl_connector/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/misc/whatsapp.png differ diff --git a/odoo_3pl_connector/static/description/assets/modules/l1.png b/odoo_3pl_connector/static/description/assets/modules/l1.png new file mode 100755 index 000000000..09cd699f7 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/modules/l1.png differ diff --git a/odoo_3pl_connector/static/description/assets/modules/l2.png b/odoo_3pl_connector/static/description/assets/modules/l2.png new file mode 100755 index 000000000..ccf610b16 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/modules/l2.png differ diff --git a/odoo_3pl_connector/static/description/assets/modules/l3.png b/odoo_3pl_connector/static/description/assets/modules/l3.png new file mode 100755 index 000000000..28650b28c Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/modules/l3.png differ diff --git a/odoo_3pl_connector/static/description/assets/modules/l4.png b/odoo_3pl_connector/static/description/assets/modules/l4.png new file mode 100755 index 000000000..1ff8b5bff Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/modules/l4.png differ diff --git a/odoo_3pl_connector/static/description/assets/modules/l5.png b/odoo_3pl_connector/static/description/assets/modules/l5.png new file mode 100755 index 000000000..9ab92420a Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/modules/l5.png differ diff --git a/odoo_3pl_connector/static/description/assets/modules/l6.png b/odoo_3pl_connector/static/description/assets/modules/l6.png new file mode 100755 index 000000000..bc2528b4f Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/modules/l6.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot1.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot1.png new file mode 100755 index 000000000..fa2e265a2 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot1.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot10.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot10.png new file mode 100755 index 000000000..a9051fe1c Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot10.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot11.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot11.png new file mode 100755 index 000000000..1129b52e6 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot11.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot12.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot12.png new file mode 100755 index 000000000..6eafbe031 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot12.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot2.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot2.png new file mode 100755 index 000000000..2f2fce192 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot2.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot3.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot3.png new file mode 100755 index 000000000..d857ff67b Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot3.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot4.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot4.png new file mode 100755 index 000000000..6cb6a8aaa Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot4.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot5.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot5.png new file mode 100755 index 000000000..8edab7cad Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot5.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot6.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot6.png new file mode 100755 index 000000000..e37dc2c60 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot6.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot8.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot8.png new file mode 100755 index 000000000..031cb7655 Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot8.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/Screenshot9.png b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot9.png new file mode 100755 index 000000000..dc765640f Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/Screenshot9.png differ diff --git a/odoo_3pl_connector/static/description/assets/screenshots/hero.gif b/odoo_3pl_connector/static/description/assets/screenshots/hero.gif new file mode 100755 index 000000000..171f1f66b Binary files /dev/null and b/odoo_3pl_connector/static/description/assets/screenshots/hero.gif differ diff --git a/odoo_3pl_connector/static/description/banner.jpg b/odoo_3pl_connector/static/description/banner.jpg new file mode 100755 index 000000000..eb0959639 Binary files /dev/null and b/odoo_3pl_connector/static/description/banner.jpg differ diff --git a/odoo_3pl_connector/static/description/icon.png b/odoo_3pl_connector/static/description/icon.png new file mode 100755 index 000000000..02d601804 Binary files /dev/null and b/odoo_3pl_connector/static/description/icon.png differ diff --git a/odoo_3pl_connector/static/description/index.html b/odoo_3pl_connector/static/description/index.html new file mode 100755 index 000000000..d84fa0f3f --- /dev/null +++ b/odoo_3pl_connector/static/description/index.html @@ -0,0 +1,665 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Odoo 3pl Connector

+

+ Facilitates seamless integration between Odoo and 3PL for efficient supply chain management. +

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

+ Explore This + Module

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ Enabling a smooth integration between Odoo and 3pl + streamlines supply chain management for enhanced efficiency. This + integration facilitates seamless coordination, optimizing processes + across the entire supply chain. +
+
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + Export Sales, Purchase and Sales Return Transfers +
+
+ + Import Sales, Purchase and Sales Return Transfers +
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Navigate to FTP Server menu under 3pl Connector in Inventory + module.

+ +
+
+

+ Create an FTP Server. +

+

+ For testing purpose you can use the credentials provided by the + DLP Test. +

+ +
+
+

+ Navigate to Warehouses menu under Configuration and open any + Warehouse.

+ +
+
+

+ Choose the FTP Server. +

+ +
+
+

+ Navigate to Operations menu under 3pl Connector. +

+ +
+
+

+ Execute the Operation. +

+

+ Select the Warehouse. Choose the operation as Export and Choose + the Items to Export/ Import. Then click EXECUTE. +

+ +
+
+

+ Connect to FTP Server using any external software. Here we are + using Filezilla. +

+ +
+
+

+ Open Export_Sales directory and right-click on the file and + click download. +

+ +
+
+

+ Upload the file. +

+

+ The specifics of the delivered product can be transferred to the + Import Folders. In this instance, I transferred the Excel file + from my local system to the Import_Sales folder by + right-clicking on the file on the left side and selecting the + Upload button. +

+ +
+
+

+ Import Operation. +

+

+ Access the Operations menu and choose the Warehouse option. Opt for the Import Operation and then select the Items to Import/ Export. +

+ +
+
+

+ Open any imported Transfer. It will be marked as Delivered. +

+ +
+
+
+ + +
+
+ +
+

+ Related + 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

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/odoo_3pl_connector/static/src/js/action_manager.js b/odoo_3pl_connector/static/src/js/action_manager.js new file mode 100755 index 000000000..6a6771c40 --- /dev/null +++ b/odoo_3pl_connector/static/src/js/action_manager.js @@ -0,0 +1,19 @@ +/* @odoo-module */ +import { registry } from "@web/core/registry"; +import { download } from "@web/core/network/download"; +import framework from 'web.framework'; +import session from 'web.session'; +registry.category("ir.actions.report handlers").add("xlsx", async (action) => { + if (action.report_type === 'xlsx') { + framework.blockUI(); + var def = $.Deferred(); + //Revoke controller for generating Excel report. + session.get_file({ + url: '/xlsx_reports', + data: action.data, + success: def.resolve.bind(def), + complete: framework.unblockUI, + }); + return def; + } +}); diff --git a/odoo_3pl_connector/views/ftp_server_views.xml b/odoo_3pl_connector/views/ftp_server_views.xml new file mode 100755 index 000000000..99fe529bd --- /dev/null +++ b/odoo_3pl_connector/views/ftp_server_views.xml @@ -0,0 +1,49 @@ + + + + + ftp.server.view.form + ftp.server + + +
+ + + + + + + + + + + + +
+
+
+ + + ftp.server.view.tree + ftp.server + + + + + + + + + + + FTP Server + ftp.server + tree,form + + + + + +
diff --git a/odoo_3pl_connector/views/stock_picking_views.xml b/odoo_3pl_connector/views/stock_picking_views.xml new file mode 100755 index 000000000..ce02675f5 --- /dev/null +++ b/odoo_3pl_connector/views/stock_picking_views.xml @@ -0,0 +1,30 @@ + + + + + stock.picking.view.form.inherit.odoo.3pl.connector + + stock.picking + + + + + + + + + + stock.picking.view.tree.inherit.odoo.3pl.connector + + stock.picking + + + + + + + + + diff --git a/odoo_3pl_connector/views/stock_warehouse_views.xml b/odoo_3pl_connector/views/stock_warehouse_views.xml new file mode 100755 index 000000000..8a5aa07ce --- /dev/null +++ b/odoo_3pl_connector/views/stock_warehouse_views.xml @@ -0,0 +1,16 @@ + + + + + stock.warehouse.view.form.inherit.odoo.3pl.connector + + stock.warehouse + + + + + + + + diff --git a/odoo_3pl_connector/wizard/__init__.py b/odoo_3pl_connector/wizard/__init__.py new file mode 100755 index 000000000..c8c934bf6 --- /dev/null +++ b/odoo_3pl_connector/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import tpl_operation diff --git a/odoo_3pl_connector/wizard/tpl_operation.py b/odoo_3pl_connector/wizard/tpl_operation.py new file mode 100755 index 000000000..ed0a5eb4d --- /dev/null +++ b/odoo_3pl_connector/wizard/tpl_operation.py @@ -0,0 +1,270 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import io +import json +import os +import openpyxl +import xlsxwriter +from ftplib import FTP +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError +from odoo.tools import date_utils + + +class TplOperation(models.TransientModel): + """Model for performing the tpl operations""" + _name = 'tpl.operation' + _description = 'Tpl Operation' + _rec_name = 'warehouse_id' + + export = fields.Selection([ + ('sales', 'Sales'), + ('return', 'Sales Return'), + ('purchase', 'Purchase')], + string='Items to Export/ Import', + default='sales', required=True, + help='Select the items to import/export') + warehouse_id = fields.Many2one('stock.warehouse', + string="Warehouse", + help="Select the warehouse for the " + "operations", required=1) + operation = fields.Selection([('export', 'Export'), + ('import', 'Import')], + default='import', + string='Operation', help='The operation which ' + 'you want to perform') + picking_ids = fields.Many2many('stock.picking', + string='Sales Picking', + help='All the sales pickings which are not ' + 'exported yet.') + + @api.onchange('export') + def _onchange_export(self): + """Method for calling bind_data() while changing the value of field + export""" + self.bind_data() + + def bind_data(self): + """Method for binding data to the one2many field""" + if self.operation == 'export': + if self.export == 'sales': + domain = 'WH-DELIVERY' + elif self.export == 'return': + domain = 'WH-RETURNS' + else: + domain = 'WH-RECEIPTS' + self.picking_ids = ( + self.env['stock.picking'].search([('state', '=', 'assigned'), + ('is_exported', '=', False)]). + filtered( + lambda x: x.picking_type_id.barcode == domain)) + + def action_execute(self): + """Execute button action""" + if self.operation == 'export' and self.picking_ids: + if not self.warehouse_id.server_id: + raise ValidationError(_('3PL not configured for selected ' + 'warehouse.')) + picking_list = self.env['stock.move.line'].search_read( + domain=[('picking_id', 'in', self.picking_ids.ids)], + fields=[ + 'picking_id', + 'product_id', + 'reserved_qty', + 'picking_partner_id', + ]) + for item in picking_list: + if item['picking_partner_id']: + partner = self.env['res.partner'].search_read( + domain=[('id', '=', item['picking_partner_id'][0])], + fields=[ + 'street', + 'street2', + 'zip', + 'city', + 'state_id', + 'country_id', + 'email', + 'phone', + 'mobile' + ]) + for rec in partner[0].keys(): + if rec != 'id': + item[rec] = partner[0][rec] + transfer_dict = {'sales': 'Export_Sales', + 'return': 'Export_Sales_Return', + 'purchase': 'Export_Purchase'} + return { + 'type': 'ir.actions.report', + 'data': { + 'model': 'tpl.operation', + 'output_format': 'xlsx', + 'report_name': 'Excel Report', + 'options': json.dumps({ + 'warehouse_id': self.warehouse_id.id, + 'picking_list': picking_list, + 'transfer': transfer_dict[self.export] + }, default=date_utils.json_default) + }, + 'report_type': 'xlsx', + } + if self.operation == 'import': + ftp = FTP(self.warehouse_id.server_id.host, + self.warehouse_id.server_id.username, + self.warehouse_id.server_id.password) + try: + ftp.encoding = "utf-8" + transfer_dict = {'sales': 'Import_Sales', + 'return': 'Import_Sales_Return', + 'purchase': 'Import_Purchase'} + local_filepath = os.path.normpath( + os.path.join(os.path.dirname(os.path.abspath(__file__)), + "..", "demo", + "imported_report.xlsx") + ) + ftp.cwd('/' + transfer_dict[self.export]) + for remote_file in ftp.nlst(): + with open(local_filepath, 'wb') as local_file: + ftp.retrbinary(f"RETR {remote_file}", + local_file.write) + workbook = openpyxl.load_workbook(local_filepath) + sheet = workbook['Sheet1'] + for row in sheet.iter_rows(min_row=2, values_only=True): + picking = self.env['stock.picking'].search( + [('name', '=', row[0])]) + if picking: + picking.action_confirm() + picking.action_assign() + picking.move_ids._set_quantities_to_reservation() + picking.button_validate() + picking.sudo().write({ + 'state':'done', + 'is_delivered': True + }) + ftp.delete(remote_file) + self.bind_data() + return {'type': 'ir.actions.act_window_close'} + except Exception as e: + raise ValidationError(f"An Error occurred: {str(e)}") + finally: + ftp.quit() + + def get_xlsx_report(self, data, response): + """Organizing xlsx report""" + data = json.loads(data) + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format( + {'font_size': '14', 'bold': True, 'align': 'center', + 'valign': 'center', 'border': True}) + body = workbook.add_format( + {'align': 'left', 'text_wrap': True, 'border': True}) + body_right = workbook.add_format( + {'align': 'right', 'text_wrap': True, 'border': True}) + sheet.set_column('A1:A2', 18) + sheet.set_column('B1:B2', 50) + sheet.set_column('C1:C2', 12) + sheet.set_column('D1:M1', 18) + sheet.set_row(0, 20) + sheet.set_row(1, 20) + sheet.merge_range('A1:A2', 'Reference', cell_format) + sheet.merge_range('B1:B2', 'Product', cell_format) + sheet.merge_range('C1:C2', 'Quantity', cell_format) + sheet.write('D2', 'Delivery Name', cell_format) + sheet.merge_range('D1:M1', 'Delivery', cell_format) + sheet.write('E2', 'Street', cell_format) + sheet.write('F2', 'Street2', cell_format) + sheet.write('G2', 'City', cell_format) + sheet.write('H2', 'State', cell_format) + sheet.write('I2', 'Country', cell_format) + sheet.write('J2', 'Zip', cell_format) + sheet.write('K2', 'Email', cell_format) + sheet.write('L2', 'Phone', cell_format) + sheet.write('M2', 'Mobile', cell_format) + row = 2 + column = 0 + for item in data['picking_list']: + sheet.write(row, column, item['picking_id'][1], body) + sheet.write(row, column + 1, item['product_id'][1], body) + sheet.write(row, column + 2, + "{:.2f}".format(int(item['reserved_qty'])), body_right) + sheet.write(row, column + 3, item['picking_partner_id'][1], + body) if item['picking_partner_id'] else ( + sheet.write(row, column + 3, " ", body)) + sheet.write(row, column + 4, item['street'], + body) if 'street' in item.keys() and item['street'] \ + else sheet.write(row, column + 4, " ", body) + sheet.write(row, column + 5, item['street2'], + body) if 'street2' in item.keys() and item['street2'] \ + else sheet.write(row, column + 5, " ", body) + sheet.write(row, column + 6, item['city'], + body) if 'city' in item.keys() and item['city'] else ( + sheet.write(row, column + 6, " ", body)) + sheet.write(row, column + 7, item['state_id'][1], + body) if ('state_id' in item.keys() and + item['state_id']) else ( + sheet.write(row, column + 7, " ", body)) + sheet.write(row, column + 8, item['country_id'][1], + body) if ('country_id' in item.keys() and + item['country_id']) else ( + sheet.write(row, column + 8, " ", body)) + sheet.write(row, column + 9, item['zip'], + body) if ('zip' in item.keys() and item['zip']) else ( + sheet.write(row, column + 9, " ", body)) + sheet.write(row, column + 10, item['email'], + body) if ('email' in item.keys() and item['email']) \ + else sheet.write(row, column + 10, " ", body) + sheet.write(row, column + 11, item['phone'], + body) if ('phone' in item.keys() and item['phone']) \ + else sheet.write(row, column + 11, " ", body) + sheet.write(row, column + 12, item['mobile'], + body) if ('mobile' in item.keys() and item['mobile']) \ + else sheet.write(row, column + 12, " ", body) + row = row + 1 + workbook.close() + remote_file = (data['transfer'] + '/exported_report_' + + fields.Datetime.now( + ).strftime("%Y_%m_%d_%H_%M_%S_%f")[:-3] + '.xlsx') + try: + server = self.env['stock.warehouse'].browse( + int(data['warehouse_id'])).server_id + if not server: + ValidationError(_('3PL not configured for the Warehouse')) + ftp = FTP(server.host, server.username, + server.password) + ftp.encoding = "utf-8" + local_filepath = os.path.normpath(os.path.join( + os.path.dirname(os.path.abspath(__file__)), "..", "demo", + "imported_report.xlsx")) + with open(local_filepath, 'wb') as temp_file: + temp_file.write(output.getvalue()) + with open(local_filepath, 'rb') as file: + ftp.storbinary(f'STOR {remote_file}', file) + output.seek(0) + response.stream.write(output.read()) + output.close() + for item in data['picking_list']: + self.env['stock.picking'].browse( + item['picking_id'][0]).write({'is_exported': True}) + except Exception as e: + raise ValidationError(f"An error occurred: {e}") diff --git a/odoo_3pl_connector/wizard/tpl_operation_views.xml b/odoo_3pl_connector/wizard/tpl_operation_views.xml new file mode 100755 index 000000000..6059650f1 --- /dev/null +++ b/odoo_3pl_connector/wizard/tpl_operation_views.xml @@ -0,0 +1,58 @@ + + + + + tpl.operation.view.form + tpl.operation + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + + Operations + ir.actions.act_window + tpl.operation + form + + new + + + +