diff --git a/shipstation_odoo_connector/README.rst b/shipstation_odoo_connector/README.rst new file mode 100755 index 000000000..13957f388 --- /dev/null +++ b/shipstation_odoo_connector/README.rst @@ -0,0 +1,42 @@ +Shipstation Odoo connector +========================== +* Shipstation odoo connector module for Odoo 14 community editions + +Installation +============ + - www.odoo.com/documentation/14.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/14.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +(v14) Dino @ Cybrosys +(v15) Viswanth @ Cybrosys + +Contacts +-------- +* Mail Contact : odoo@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 +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ + diff --git a/shipstation_odoo_connector/__init__.py b/shipstation_odoo_connector/__init__.py new file mode 100644 index 000000000..2da687ff2 --- /dev/null +++ b/shipstation_odoo_connector/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from . import models diff --git a/shipstation_odoo_connector/__manifest__.py b/shipstation_odoo_connector/__manifest__.py new file mode 100644 index 000000000..331fc97c5 --- /dev/null +++ b/shipstation_odoo_connector/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +{ + 'name': 'ShipStation Odoo Connector', + 'version': '15.0.1.0.0', + 'summary': 'Integrate and Manage ShipStation Operations with Odoo', + 'description': 'Integrate and Manage ShipStation Operations with Odoo', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['sale', 'account', 'stock', 'delivery'], + 'data': [ + 'security/security.xml', + 'security/ir.model.access.csv', + 'views/api_credential.xml', + 'views/store.xml', + 'views/services.xml', + 'views/delivery_shipstation.xml', + 'views/packages_shipstation.xml', + 'views/delivery_carrier_view.xml', + 'views/sale_orders.xml', + 'views/shipstation_actions.xml', + 'views/stock_picking.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'OPL-1', + 'price': 49, + 'currency': 'EUR', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/shipstation_odoo_connector/doc/RELEASE_NOTES.md b/shipstation_odoo_connector/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..830dbcf29 --- /dev/null +++ b/shipstation_odoo_connector/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 04.11.2022 +#### Version 15.0.1.0.0 +##### ADD + +- Initial Commit for shipstation_odoo_connector diff --git a/shipstation_odoo_connector/models/__init__.py b/shipstation_odoo_connector/models/__init__.py new file mode 100644 index 000000000..d823b2c3d --- /dev/null +++ b/shipstation_odoo_connector/models/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from . import shipstation_api +from . import store +from . import services +from . import delivery_method +from . import packages_shipstation +from . import stock_picking diff --git a/shipstation_odoo_connector/models/delivery_method.py b/shipstation_odoo_connector/models/delivery_method.py new file mode 100644 index 000000000..ba4242e7e --- /dev/null +++ b/shipstation_odoo_connector/models/delivery_method.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from odoo import fields, models, api, _ + + +class DeliveryMethod(models.Model): + _name = 'shipstation.delivery' + _description = "Shipstation Delivery" + + name = fields.Char(string="Name") + code = fields.Char(string="Code") + account_number = fields.Char(string="Account Number") + requires_funded_account = fields.Boolean(string="Requires Funded Account") + balance = fields.Char(string="Balance") + nick_name = fields.Char(string="Nickname") + shipping_providerid = fields.Char(string="Shipping Provider") + primary = fields.Boolean(default=False, string="Primary") + company_id = fields.Many2one('res.company', required=True, default=lambda self: self.env.company,string="Company id") diff --git a/shipstation_odoo_connector/models/packages_shipstation.py b/shipstation_odoo_connector/models/packages_shipstation.py new file mode 100644 index 000000000..a691a5449 --- /dev/null +++ b/shipstation_odoo_connector/models/packages_shipstation.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from odoo import fields, models, api, _ + + +class ShipstationPackages(models.Model): + _name = 'shipstation.packages' + _description = "Shipstation Packages" + + carrier_code = fields.Char(string='Carrier Code') + code = fields.Char(string='Code') + name = fields.Char(string='Name') + domestic = fields.Boolean(string="Domestic", default=False) + international = fields.Boolean(string="International", default=False) diff --git a/shipstation_odoo_connector/models/services.py b/shipstation_odoo_connector/models/services.py new file mode 100644 index 000000000..8c46db214 --- /dev/null +++ b/shipstation_odoo_connector/models/services.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from odoo import fields, models, api, _ + +try: + from base64 import encodestring +except ImportError: + from base64 import encodebytes as encodestring + + +class ShipstationService(models.Model): + _name = 'shipstation.service' + _description = "Shipstation Service" + + carrier_code = fields.Char(string="CarrierCode") + code = fields.Char(string="Code") + name = fields.Char(string="Name") + domestic = fields.Boolean(default=False, string="Domestic") + international = fields.Boolean(default=False, string="International") diff --git a/shipstation_odoo_connector/models/shipstation_api.py b/shipstation_odoo_connector/models/shipstation_api.py new file mode 100644 index 000000000..7136b403b --- /dev/null +++ b/shipstation_odoo_connector/models/shipstation_api.py @@ -0,0 +1,439 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +import json +from odoo import fields, models, api, _ +from odoo.http import request +from odoo.exceptions import UserError +import requests +import base64 + +try: + from base64 import encodestring +except ImportError: + from base64 import encodebytes as encodestring + + +class DeliveryCarrier(models.Model): + _inherit = 'delivery.carrier' + + delivery_type = fields.Selection( + selection_add=[('shipstation', 'ShipStation')], + ondelete={'shipstation': 'set ' + 'default'}) + + @api.onchange('shipstation_carrier') + def _onchange_shipstaion_carrier(self): + service_object = self.env['shipstation.service'].search( + [('carrier_code', '=', self. + shipstation_carrier.code)]) + service_list = [] + for data in service_object: + service_list.append(data.id) + package_object = self.env['shipstation.packages'].search( + [('carrier_code', '=', self. + shipstation_carrier.code)]) + package_list = [] + for data in package_object: + package_list.append(data.id) + res = {} + res['domain'] = {'shipstation_service': [('id', 'in', service_list)], + 'shipstation_package': [('id', 'in', package_list)]} + return res + + store = fields.Many2one('shipstation.store', string='Store',) + shipstation_carrier = fields.Many2one('shipstation.delivery', + string='Shipstation Carrier') + shipstation_service = fields.Many2one('shipstation.service', + string='Shipstation Delivery ' + 'Carrier Service') + shipstation_package = fields.Many2one('shipstation.packages', + string='Shipstation Package') + + +class ShipStationApi(models.Model): + _name = 'shipstation.api' + _description = "Shipstation Api" + _rec_name = 'host' + + host = fields.Char(string="Host", help="Provide the api url",required=True) + username = fields.Char(string="Username", help="Provide the Shipstation API Key",required=True) + password = fields.Char(string="Password", help="Provide the Shipstation API Secret",required=True) + activate = fields.Boolean(string="Activate", default=False, + help="Make this credential active.Please activate only one credential ata time") + + def get_carriers_service(self): + """This function will create shipstation store,packages and other + information form shipstation""" + + base64string = base64.encodebytes(('%s:%s' % ( + self.username, self.password)).encode()).decode().replace('\n', '') + url = self.host + '/carriers' + headers = { + 'Authorization': "Basic " + base64string + } + carriers = requests.get(url, headers=headers) + for rec in carriers.json(): + # print (rec) + product = self.env['product.product'].search( + [('name', '=', 'ShipstationShipping')]) + if not product: + product = self.env['product.product'].create({ + 'name': 'ShipstationShipping', + 'type': 'service', + 'lst_price': 0.0, + }) + add_carriers = self.env['shipstation.delivery'].search([ + ('shipping_providerid', '=', rec.get('shippingProviderId'))]) + if not add_carriers: + add_carriers = self.env['shipstation.delivery'].create({ + 'name': rec.get('name'), + 'code': rec.get('code'), + 'account_number': rec.get('accountNumber') or False, + 'requires_funded_account': rec.get( + 'requiresFundedAccount') or False, + 'balance': rec.get('balance'), + 'nick_name': rec.get('nickname'), + 'shipping_providerid': rec.get('shippingProviderId'), + 'primary': rec.get('primary') + }) + + url = self.host + '/carriers/listservices?carrierCode=' \ + + add_carriers.code + headers = { + 'Authorization': "Basic " + base64string + } + services = requests.get(url, headers=headers) + for i in services.json(): + services = self.env['shipstation.service'].search \ + ([('carrier_code', '=', i.get('carrier_code')) + and ('code', '=', i.get('code'))]) + if not services: + services = self.env['shipstation.service'].create({ + 'carrier_code': i.get('carrierCode'), + 'code': i.get('code'), + 'name': i.get('name'), + 'domestic': i.get('domestic'), + 'international': i.get('international') + }) + url = self.host + '/carriers/listpackages?carrierCode=' \ + + add_carriers.code + headers = { + 'Authorization': "Basic " + base64string + } + packages = requests.get(url, headers=headers) + for p in packages.json(): + package = self.env['shipstation.packages'].search \ + ([('carrier_code', '=', p.get('carrierCode')) + and ('code', '=', p.get('code') + and ('name', '=', p.get('name')))]) + if not package: + package = self.env['shipstation.packages'].create({ + 'carrier_code': p.get('carrierCode'), + 'code': p.get('code'), + 'name': p.get('name'), + 'domestic': p.get('domestic'), + 'international': p.get('international') + }) + + url = self.host + '/stores' + headers = { + 'Authorization': "Basic " + base64string + } + stores = requests.get(url, headers=headers) + for rec in stores.json(): + store = self.env['shipstation.store'].search \ + ([('store_id', '=', rec.get('storeId')) and + ('store_name', '=', rec.get('storeName'))]) + if not store: + store = self.env['shipstation.store'].create({ + 'store_id': rec.get('storeId'), + 'store_name': rec.get('storeName'), + 'marketplace_name': rec.get('marketplaceName'), + 'account_number': rec.get('accountName'), + 'email': rec.get('email'), + 'company_name': rec.get('companyName'), + 'phone': rec.get('phone'), + 'website': rec.get('website'), + 'create_date': rec.get('createDate'), + 'modified_date': rec.get('modifyDate') + }) + + +class ChooseDeliveryCarrier(models.TransientModel): + _inherit = 'choose.delivery.carrier' + + def _get_shipment_rate(self): + """Calculating the shipping rate""" + vals = self.carrier_id.rate_shipment(self.order_id) + if vals.get('success'): + self.delivery_message = vals.get('warning_message', False) + self.delivery_price = vals['price'] + self.display_price = vals['price'] + return {} + return {'error_message': vals['error_message']} + + +class DeliveryCarrier(models.Model): + _inherit = ['delivery.carrier'] + _primary_email = ['email_from'] + + code = fields.Char(string="Code") + + def send_shipping(self, pickings): + self.ensure_one() + if hasattr(self, '%s_send_shipping' % self.delivery_type): + return getattr(self, '%s_send_shipping' % self.delivery_type)( + pickings) + + @api.model + def create_oredr(self, pickings): + """Creating order to shipstation""" + credential = self.env['shipstation.api'].search( + [('activate', '=', True)]) + for rec in credential: + + base64string = base64.encodebytes(('%s:%s' % ( + rec.username, rec.password)).encode()).decode().replace('\n', + '') + if not pickings.shipstation_order_id or pickings.shipstation_shipping_cancel: + + url = rec.host + '/orders/createorder' + else: + url = rec.host + '/orders/' + str(pickings.shipstation_order_id) + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + 'Content-Type': 'application/json' + } + oredrNumber = pickings.origin + sale_oredr = self.env['sale.order'].search( + [('name', '=', pickings.origin)]) + oredrDate = sale_oredr.date_order + paymentDate = sale_oredr.date_order + shipByDate = pickings.scheduled_date + if pickings.shipstation_shipping_cancel: + oredrStatus = 'cancelled' + + else: + oredrStatus = 'awaiting_shipment' + customer_id = sale_oredr.partner_id.id + customerUsername = sale_oredr.partner_id.name + billname = sale_oredr.partner_id.name + bill_street1 = sale_oredr.partner_invoice_id.street + bill_street2 = sale_oredr.partner_invoice_id.street2 or "" + bill_city = sale_oredr.partner_invoice_id.city + bill_state = sale_oredr.partner_invoice_id.state_id.name + bill_postal = sale_oredr.partner_invoice_id.zip + bil_contry = sale_oredr.partner_invoice_id.country_id.code + bill_phone = sale_oredr.partner_invoice_id.phone + shipTo_name = sale_oredr.partner_id.name + shipTo_street1 = sale_oredr.partner_invoice_id.street + shipTo_street2 = sale_oredr.partner_invoice_id.street2 or " " + shipTo_city = sale_oredr.partner_invoice_id.city + shipTo_state = sale_oredr.partner_invoice_id.state_id.name + shipTo_postal = sale_oredr.partner_invoice_id.zip + shipTo_contry = sale_oredr.partner_invoice_id.country_id.code + + shipTo_phone = sale_oredr.partner_invoice_id.phone + items = [] + for rec in sale_oredr.order_line: + each = {"sku": rec.product_id.default_code or "null", + "name": rec.product_id.name, + "imageUrl": f'{request.httprequest.host_url}' + f'web/image?model=product.template&id=' + f'{rec.product_id.id}&field=image_128', + "weight": { + "value": (rec.product_id.weight * 2.2046), + "units": "pounds" + }, + "quantity": int(rec.product_uom_qty), + "unitPrice": rec.price_unit, + "taxAmount": rec.tax_id.amount, + "shippingAmount": (rec.price_unit * int( + rec.product_uom_qty)) + rec.tax_id.amount, + "productId": rec.product_id.id + } + items.append(each) + items = str(items) + + amountPaid = sale_oredr.amount_untaxed + taxAmount = sale_oredr.amount_tax + shippingAmount = 0.0 + customerNotes = sale_oredr.note + internalNotes = " " + paymentMethod = "Credit Card" + dc = self.env['delivery.carrier'].search([('name', '=', + pickings.carrier_id.name)]) + requestedShippingService = dc.shipstation_service.name + carrierCode = dc.shipstation_carrier.code + serviceCode = dc.shipstation_service.code + packageCode = dc.shipstation_package.code + confirmation = "delivery" + shipDate = pickings.date_done + weight = "{\n\"value\": %s,\n\"units\":\"%s\"\n }" % ( + (pickings.shipping_weight * 2.2046), "pounds") + tag_ids = sale_oredr.tag_ids + if pickings.shipstation_shipping_cancel and pickings.shipstation_shipping_orderKey: + + payload = "{\n \"orderNumber\": \"%s\",\n \"orderKey\":\"%s\",\n \"orderDate\": \"%s\",\n \"paymentDate\": \"%s\",\n \"shipByDate\": \"%s\",\n \"orderStatus\": \"%s\",\n \"customerId\": \"%s\",\n \"customerUsername\": \"%s\",\n \"billTo\": {\n \"name\": \"%s\",\n \"street1\": \"%s\",\n \"street2\": \"%s\",\n \"city\": \"%s\",\n \"state\": \"%s\",\n \"postalCode\": \"%s\",\n \"country\": \"%s\",\n \"phone\": \"%s\" },\n \"shipTo\": {\n \"name\": \"%s\",\n \"street1\": \"%s\",\n \"street2\": \"%s\",\n \"city\": \"%s\",\n \"state\": \"%s\",\n \"postalCode\": \"%s\",\n \"country\":\"%s\",\n \"phone\": \"%s\" },\n \"items\":%s,\n \"amountPaid\": \"%s\",\n \"taxAmount\": \"%s\",\n \"shippingAmount\": \"%s\",\n \"customerNotes\": \"%s\",\n \"internalNotes\": \"%s\",\n \"paymentMethod\": \"%s\",\n \"requestedShippingService\": \"%s\",\n \"carrierCode\": \"%s\",\n \"serviceCode\":\"%s\",\n \"packageCode\": \"%s\",\n \"confirmation\": \"%s\",\n \"shipDate\": \"%s\",\n \"weight\":%s }" % ( + oredrNumber, pickings.shipstation_shipping_orderKey, + oredrDate, paymentDate, shipByDate, + oredrStatus, + customer_id, customerUsername, billname, bill_street1, + bill_street2, + bill_city, bill_state, bill_postal, bil_contry, bill_phone, + shipTo_name, + shipTo_street1, shipTo_street2, shipTo_city, shipTo_state, + shipTo_postal, shipTo_contry, shipTo_phone, items, + amountPaid, + taxAmount, + shippingAmount, customerNotes, internalNotes, paymentMethod, + requestedShippingService, carrierCode, serviceCode, + packageCode, + confirmation, shipDate, weight) + else: + payload = "{\n \"orderNumber\": \"%s\",\n \"orderDate\": \"%s\",\n \"paymentDate\": \"%s\",\n \"shipByDate\": \"%s\",\n \"orderStatus\": \"%s\",\n \"customerId\": \"%s\",\n \"customerUsername\": \"%s\",\n \"billTo\": {\n \"name\": \"%s\",\n \"street1\": \"%s\",\n \"street2\": \"%s\",\n \"city\": \"%s\",\n \"state\": \"%s\",\n \"postalCode\": \"%s\",\n \"country\": \"%s\",\n \"phone\": \"%s\" },\n \"shipTo\": {\n \"name\": \"%s\",\n \"street1\": \"%s\",\n \"street2\": \"%s\",\n \"city\": \"%s\",\n \"state\": \"%s\",\n \"postalCode\": \"%s\",\n \"country\":\"%s\",\n \"phone\": \"%s\" },\n \"items\":%s,\n \"amountPaid\": \"%s\",\n \"taxAmount\": \"%s\",\n \"shippingAmount\": \"%s\",\n \"customerNotes\": \"%s\",\n \"internalNotes\": \"%s\",\n \"paymentMethod\": \"%s\",\n \"requestedShippingService\": \"%s\",\n \"carrierCode\": \"%s\",\n \"serviceCode\":\"%s\",\n \"packageCode\": \"%s\",\n \"confirmation\": \"%s\",\n \"shipDate\": \"%s\",\n \"weight\":%s }" % ( + oredrNumber, oredrDate, paymentDate, shipByDate, + oredrStatus, + customer_id, customerUsername, billname, bill_street1, + bill_street2, + bill_city, bill_state, bill_postal, bil_contry, bill_phone, + shipTo_name, + shipTo_street1, shipTo_street2, shipTo_city, shipTo_state, + shipTo_postal, shipTo_contry, shipTo_phone, items, + amountPaid, + taxAmount, + shippingAmount, customerNotes, internalNotes, paymentMethod, + requestedShippingService, carrierCode, serviceCode, + packageCode, + confirmation, shipDate, weight) + + create_order = requests.request("POST", url, headers=headers, + data=payload) + result = create_order.json() + + if not pickings.shipstation_order_id and result.get('orderId'): + pickings.shipstation_order_id = result.get('orderId') + pickings.carrier_tracking_ref = result.get('orderId') + pickings.shipstation_shipping_orderKey = result.get('orderKey') + attachment_64 = pickings.get_label() + + so_attachment = self.env['ir.attachment'].sudo().create({ + 'name': 'Shipstation Shipping Label - %s.pdf' % attachment_64.get('trackingNumber'), + 'type': 'binary', + 'mimetype': 'application/pdf', + 'datas': attachment_64.get('data') + }) + pickings.message_post( + body=(_("Order created into Shipstation for %s
" % self.name)), + attachment_ids=[so_attachment.id] + ) + + def shipstation_cancel_shipment(self, pickings): + """Function to cancel shipstaion order""" + pickings.shipstation_shipping_cancel = True + pickings.send_to_shipper() + + def shipstation_send_shipping(self, pickings): + res = [] + self.create_oredr(pickings) + for p in pickings: + res = res + [{'exact_price': p.carrier_id.fixed_price, + 'tracking_number': False}] + return res + + def shipstation_rate_shipment(self, order): + """Calculating shipping rate""" + + shipstation = self.env['shipstation.api'].search( + [('activate', '=', True)], limit=1) + + base64string = base64.encodebytes(('%s:%s' % ( + shipstation.username, + shipstation.password)).encode()).decode().replace('\n', '') + + url = shipstation.host + "/shipments/getrates" + company_postal = order.company_id.zip + to_state = order.partner_shipping_id.state_id.name + to_country = order.partner_shipping_id.country_id.code + to_postal = order.partner_shipping_id.zip + to_city = order.partner_shipping_id.city + weight_value = 0 + for rec in order.order_line: + weight_value = weight_value + ( + rec.product_id.weight * rec.product_uom_qty) + payload = "{\n \"carrierCode\": \"%s\",\n \"serviceCode\": \"%s\",\n \"packageCode\": \"%s\",\n \"fromPostalCode\": \"%s\",\n \"toState\": \"%s\",\n \"toCountry\": \"%s\",\n \"toPostalCode\": \"%s\",\n \"toCity\": \"%s\",\n \"weight\": {\n \"value\": %s,\n \"units\": \"pounds\"\n }\n}" % ( + self.shipstation_carrier.code, self.shipstation_service.code, + self.shipstation_package.code, company_postal, to_state, to_country, + to_postal, to_city, (weight_value * 2.2046)) + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + 'Content-Type': 'application/json' + } + response = requests.request("POST", url, headers=headers, data=payload) + result = response.json() + # print("result", result) + if not result: + + final = {'success': True, + 'price': 0.0, + 'error_message': True, + 'warning_message': "Something went wrong"} + else: + if 'shipmentCost' in result[0]: + price = result[0].get('shipmentCost') + final = {'success': True, + 'price': price, + 'error_message': False, + 'warning_message': False} + else: + final = {'success': True, + 'price': 0, + 'error_message': True, + 'warning_message': result.get('ExceptionMessage')} + return final + + def rate_shipment(self, order): + self.ensure_one() + if hasattr(self, '%s_rate_shipment' % self.delivery_type): + res = getattr(self, '%s_rate_shipment' % self.delivery_type)(order) + # apply margin on computed price + res['price'] = float(res['price']) * ( + 1.0 + (float(self.margin) / 100.0)) + # free when order is large enough + if res['success'] and self.free_over and \ + order._compute_amount_total_without_delivery() >= self.amount: + res['warning_message'] = _( + 'Info:\nThe shipping is free because the order amount ' + 'exceeds %.2f.\n(The actual shipping cost is: %.2f)') % ( + self.amount, res['price']) + res['price'] = 0.0 + return res + + def cancel_shipment(self, pickings): + + self.ensure_one() + if hasattr(self, '%s_cancel_shipment' % self.delivery_type): + return getattr(self, '%s_cancel_shipment' % self.delivery_type)( + pickings) diff --git a/shipstation_odoo_connector/models/stock_picking.py b/shipstation_odoo_connector/models/stock_picking.py new file mode 100644 index 000000000..4d30af026 --- /dev/null +++ b/shipstation_odoo_connector/models/stock_picking.py @@ -0,0 +1,224 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from odoo import fields, models, api, _ +import requests +import base64 + +try: + from base64 import encodestring +except ImportError: + from base64 import encodebytes as encodestring + + +class StockPicking(models.Model): + _inherit = 'stock.picking' + + shipstation_order_id = fields.Integer(string="Shipstaion Order Id ", readonly=True) + shipstation_shipping_status = fields.Char(string="Shipping Status", + compute='_compute_shipstation_shipping_status') + shipstation_shipping_cancel = fields.Boolean(string="Is Cancel", default=False) + shipstation_shipping_orderKey = fields.Char(string="Order Key") + shipstation_shipping_hold_date = fields.Date(string="Hold Until") + + @api.depends('shipstation_order_id') + def _compute_shipstation_shipping_status(self): + + if self.shipstation_order_id: + + shipstation = self.env['shipstation.api'].search( + [('activate', '=', True)]) + + base64string = base64.encodebytes(('%s:%s' % ( + shipstation.username, + shipstation.password)).encode()).decode().replace('\n', '') + + url = shipstation.host + '/orders/' + str(self.shipstation_order_id) + payload = {} + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string + } + response = requests.request("GET", url, headers=headers, + data=payload) + # print("compute", response.json()) + + self.shipstation_shipping_status = response.json().get( + 'orderStatus') + else: + self.shipstation_shipping_status = "None" + + def get_label(self): + shipstation = self.env['shipstation.api'].search( + [('activate', '=', True)]) + dc = self.env['delivery.carrier'].search([('name', '=', + self.carrier_id.name)]) + sale_oredr = self.env['sale.order'].search( + [('name', '=', self.origin)]) + total_weight = self.shipping_weight + + self.get_shipping_info() + + base64string = base64.encodebytes(('%s:%s' % ( + shipstation.username, + shipstation.password)).encode()).decode().replace('\n', '') + + url = shipstation.host + '/orders/createlabelfororder' + # str(self.shipstation_order_id) + payload = "{\n \"orderId\": %s,\n \"carrierCode\": \"%s\",\n \"serviceCode\": \"%s\",\n \"packageCode\": \"%s\",\n \"shipDate\": \"%s\",\n \"weight\": {\n \"value\": %s,\n \"units\": \"pounds\"\n },\n \"internationalOptions\": null,\n \"advancedOptions\": null,\n \"testLabel\": false\n}" % ( + self.shipstation_order_id, dc.shipstation_carrier.code, + dc.shipstation_service.code, dc.shipstation_package.code, + sale_oredr.date_order, (total_weight * 2.2046)) + + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + 'Content-Type': 'application/json' + + } + + response = requests.request("POST", url, headers=headers, + data=str(payload)) + + value = {'trackingNumber': response.json().get('trackingNumber'), 'data': response.json().get('labelData')} + return value + + def send_to_shipper(self): + self.ensure_one() + + res = self.carrier_id.send_shipping(self)[0] + if self.carrier_id.free_over and self.sale_id and self.sale_id._compute_amount_total_without_delivery() >= self.carrier_id.amount: + res['exact_price'] = 0.0 + self.carrier_price = res['exact_price'] * ( + 1.0 + (self.carrier_id.margin / 100.0)) + if res['tracking_number']: + self.carrier_tracking_ref = res['tracking_number'] + order_currency = self.sale_id.currency_id or self.company_id.currency_id + msg = _( + "Shipment sent to carrier %(carrier_name)s for shipping with " + "tracking number %(ref)s
Cost: %(price).2f %(currency)s", + carrier_name=self.carrier_id.name, + ref=self.carrier_tracking_ref, + price=self.carrier_price, + currency=order_currency.name + ) + self.message_post(body=msg) + self._add_delivery_cost_to_so() + + def action_onhold_order(self): + shipstation = self.env['shipstation.api'].search( + [('activate', '=', True)]) + + base64string = base64.encodebytes(('%s:%s' % ( + shipstation.username, + shipstation.password)).encode()).decode().replace('\n', '') + + url = shipstation.host + '/orders/holduntil' + if self.shipstation_shipping_hold_date: + hold_date = self.shipstation_shipping_hold_date + else: + hold_date = fields.date.today() + payload = "{\n \"orderId\": %s,\n \"holdUntilDate\": \"%s\"\n}" % ( + self.shipstation_order_id, hold_date) + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + 'Content-Type': 'application/json' + } + response = requests.request("POST", url, headers=headers, data=payload) + + def action_shipped_order(self): + shipstation = self.env['shipstation.api'].search( + [('activate', '=', True)]) + + base64string = base64.encodebytes(('%s:%s' % ( + shipstation.username, + shipstation.password)).encode()).decode().replace('\n', '') + + carrier_code = self.env['delivery.carrier'].search( + [('id', '=', self.carrier_id.id)]) + + carier = carrier_code.shipstation_carrier.code + url = shipstation.host + 'orders/markasshipped' + payload = "{\n \"orderId\": %s,\n \"carrierCode\": \"%s\",\n \"trackingNumber\": \"%s\",\n \"notifyCustomer\": true}" % ( + int(self.shipstation_order_id), + carier, self.shipstation_order_id) + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + 'Content-Type': 'application/json' + } + response = requests.request("POST", url, headers=headers, data=payload) + + def action_restore_hold_order(self): + shipstation = self.env['shipstation.api'].search( + [('activate', '=', True)]) + + base64string = base64.encodebytes(('%s:%s' % ( + shipstation.username, + shipstation.password)).encode()).decode().replace('\n', '') + + url = shipstation.host + 'orders/restorefromhold' + if self.shipstation_shipping_hold_date: + hold_date = self.shipstation_shipping_hold_date + else: + hold_date = fields.date.today() + payload = "{\n \"orderId\": %s}" % ( + self.shipstation_order_id) + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + 'Content-Type': 'application/json' + } + response = requests.request("POST", url, headers=headers, data=payload) + + def open_website_url(self): + if self.shipstation_order_id: + if self.shipstation_shipping_status == 'awaiting_shipment': + url = 'https://ship13.shipstation.com/orders/awaiting-shipment' + elif self.shipstation_shipping_status == 'shipped': + url = 'https://ship13.shipstation.com/shipments/shipped?' + # url ='https://ship13.shipstation.com/orders/shipped' + elif self.shipstation_shipping_status == 'on_hold': + url = 'https://ship13.shipstation.com/orders/on-hold' + elif self.shipstation_shipping_status == 'cancelled': + url = 'https://ship13.shipstation.com/orders/cancelled' + return { + "type": "ir.actions.act_url", + "url": url + '/%s' % self.origin, + "target": "new" + } + + def get_shipping_info(self, ): + credential = self.env['shipstation.api'].search( + [('activate', '=', True)]) + base64string = base64.encodebytes(('%s:%s' % ( + credential.username, + credential.password)).encode()).decode().replace('\n', '') + + url = credential.host + 'shipments?orderNumber=%s&orderId=%s' % ( + self.origin, self.shipstation_order_id) + headers = { + 'Host': 'ssapi.shipstation.com', + 'Authorization': "Basic " + base64string, + } + ship = requests.get(url, headers=headers) diff --git a/shipstation_odoo_connector/models/store.py b/shipstation_odoo_connector/models/store.py new file mode 100644 index 000000000..46e6d6c0e --- /dev/null +++ b/shipstation_odoo_connector/models/store.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from odoo import fields, models, api + + +class ShipstationStore(models.Model): + _name = 'shipstation.store' + _description = "ShipStation Store" + _rec_name = 'store_name' + + store_id = fields.Integer(string="Store id", required=True) + store_name = fields.Char(string="Store Name", required=True) + marketplace_name = fields.Char(string="Marketplace Name", required=True) + account_number = fields.Char(string="Account Number") + email = fields.Char(string="Email") + company_name = fields.Char(string="Company Name") + phone = fields.Char(string="Phone") + website = fields.Char(string="Website") + create_date = fields.Date(string="Create Date") + modified_date = fields.Date(string="Modified Date") diff --git a/shipstation_odoo_connector/security/ir.model.access.csv b/shipstation_odoo_connector/security/ir.model.access.csv new file mode 100755 index 000000000..d2d81824c --- /dev/null +++ b/shipstation_odoo_connector/security/ir.model.access.csv @@ -0,0 +1,14 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + +access_shipstation_api_user,access.shipstation.api.user,model_shipstation_api,shipstation_odoo_connector.group_shipstation_manager,1,1,1,1 +acess_shipstation_store_details,access.shipstation.store.detais,model_shipstation_store,shipstation_odoo_connector.group_shipstation_manager,1,1,1,1 +access_shipstation_service_details,access.shipstation.service,model_shipstation_service,shipstation_odoo_connector.group_shipstation_manager,1,1,1,1 +access_shipstation_delivery_details,access.shipstation.delivery,model_shipstation_delivery,shipstation_odoo_connector.group_shipstation_manager,1,1,1,1 +access_shipstation_packages_details,access.shipstation.packages.details,model_shipstation_packages,shipstation_odoo_connector.group_shipstation_manager,1,1,1,1 + +access_shipstation_api_user,access.shipstation.api.user,model_shipstation_api,base.group_user,1,1,1,0 +acess_shipstation_store_details,access.shipstation.store.detais,model_shipstation_store,base.group_user,1,1,1,0 +access_shipstation_service_details,access.shipstation.service,model_shipstation_service,base.group_user,1,1,1,0 +access_shipstation_delivery_details,access.shipstation.delivery,model_shipstation_delivery,base.group_user,1,1,1,0 +access_shipstation_packages_details,access.shipstation.packages.details,model_shipstation_packages,base.group_user,1,1,1,0 + diff --git a/shipstation_odoo_connector/security/security.xml b/shipstation_odoo_connector/security/security.xml new file mode 100644 index 000000000..db9faf13a --- /dev/null +++ b/shipstation_odoo_connector/security/security.xml @@ -0,0 +1,12 @@ + + + + Shipstaion + Category for Shipstation + + + Manager + + + + \ No newline at end of file diff --git a/shipstation_odoo_connector/static/description/assets/icons/check.png b/shipstation_odoo_connector/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/check.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/chevron.png b/shipstation_odoo_connector/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/chevron.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/cogs.png b/shipstation_odoo_connector/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/cogs.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/consultation.png b/shipstation_odoo_connector/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/consultation.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/ecom-black.png b/shipstation_odoo_connector/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/ecom-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/education-black.png b/shipstation_odoo_connector/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/education-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/hotel-black.png b/shipstation_odoo_connector/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/hotel-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/license.png b/shipstation_odoo_connector/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/license.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/lifebuoy.png b/shipstation_odoo_connector/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/lifebuoy.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/manufacturing-black.png b/shipstation_odoo_connector/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/manufacturing-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/pos-black.png b/shipstation_odoo_connector/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/pos-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/puzzle.png b/shipstation_odoo_connector/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/puzzle.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/restaurant-black.png b/shipstation_odoo_connector/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/restaurant-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/service-black.png b/shipstation_odoo_connector/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/service-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/trading-black.png b/shipstation_odoo_connector/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/trading-black.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/training.png b/shipstation_odoo_connector/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/training.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/update.png b/shipstation_odoo_connector/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/update.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/user.png b/shipstation_odoo_connector/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/user.png differ diff --git a/shipstation_odoo_connector/static/description/assets/icons/wrench.png b/shipstation_odoo_connector/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/icons/wrench.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/categories.png b/shipstation_odoo_connector/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/categories.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/check-box.png b/shipstation_odoo_connector/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/check-box.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/compass.png b/shipstation_odoo_connector/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/compass.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/corporate.png b/shipstation_odoo_connector/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/corporate.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/customer-support.png b/shipstation_odoo_connector/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/customer-support.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/cybrosys-logo.png b/shipstation_odoo_connector/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/cybrosys-logo.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/features.png b/shipstation_odoo_connector/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/features.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/logo.png b/shipstation_odoo_connector/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/logo.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/pictures.png b/shipstation_odoo_connector/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/pictures.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/pie-chart.png b/shipstation_odoo_connector/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/pie-chart.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/right-arrow.png b/shipstation_odoo_connector/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/right-arrow.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/star.png b/shipstation_odoo_connector/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/star.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/support.png b/shipstation_odoo_connector/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/support.png differ diff --git a/shipstation_odoo_connector/static/description/assets/misc/whatsapp.png b/shipstation_odoo_connector/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/misc/whatsapp.png differ diff --git a/shipstation_odoo_connector/static/description/assets/modules/1.png b/shipstation_odoo_connector/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/modules/1.png differ diff --git a/shipstation_odoo_connector/static/description/assets/modules/2.png b/shipstation_odoo_connector/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/modules/2.png differ diff --git a/shipstation_odoo_connector/static/description/assets/modules/3.png b/shipstation_odoo_connector/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/modules/3.png differ diff --git a/shipstation_odoo_connector/static/description/assets/modules/4.png b/shipstation_odoo_connector/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/modules/4.png differ diff --git a/shipstation_odoo_connector/static/description/assets/modules/5.gif b/shipstation_odoo_connector/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/modules/5.gif differ diff --git a/shipstation_odoo_connector/static/description/assets/modules/6.png b/shipstation_odoo_connector/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/modules/6.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/brands.png b/shipstation_odoo_connector/static/description/assets/screenshots/brands.png new file mode 100644 index 000000000..680746d68 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/brands.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/grid.png b/shipstation_odoo_connector/static/description/assets/screenshots/grid.png new file mode 100644 index 000000000..508124f5f Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/grid.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/hero.gif b/shipstation_odoo_connector/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..8c5e67cb9 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/hero.gif differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipping_number&_shipping_status.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipping_number&_shipping_status.png new file mode 100644 index 000000000..1bebabc7a Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipping_number&_shipping_status.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_1.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_1.png new file mode 100644 index 000000000..f40e82096 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_1.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_2.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_2.png new file mode 100644 index 000000000..2a177287f Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_2.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_3.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_3.png new file mode 100644 index 000000000..8f65257d0 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_3.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_4.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_4.png new file mode 100644 index 000000000..9ed9a105a Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_4.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_5.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_5.png new file mode 100644 index 000000000..8d55059ef Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_5.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_6.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_6.png new file mode 100644 index 000000000..5d3afe7ac Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_6.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_7.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_7.png new file mode 100644 index 000000000..2c6d02c67 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_7.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_8.png b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_8.png new file mode 100644 index 000000000..eb128622c Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/shipstation_8.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_1.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_1.png new file mode 100644 index 000000000..bb17b880c Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_1.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_2.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_2.png new file mode 100644 index 000000000..d0c2e03c6 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_2.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_3.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_3.png new file mode 100644 index 000000000..7a5043676 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_3.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_4.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_4.png new file mode 100644 index 000000000..53409d152 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_4.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_5.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_5.png new file mode 100644 index 000000000..2fda53f65 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_5.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_6.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_6.png new file mode 100644 index 000000000..a0031b925 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_6.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_7.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_7.png new file mode 100644 index 000000000..a4f060c10 Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_7.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_8.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_8.png new file mode 100644 index 000000000..46ac8d24a Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_8.png differ diff --git a/shipstation_odoo_connector/static/description/assets/screenshots/support_9.png b/shipstation_odoo_connector/static/description/assets/screenshots/support_9.png new file mode 100644 index 000000000..67e28a38b Binary files /dev/null and b/shipstation_odoo_connector/static/description/assets/screenshots/support_9.png differ diff --git a/shipstation_odoo_connector/static/description/banner.png b/shipstation_odoo_connector/static/description/banner.png new file mode 100644 index 000000000..2efa25d93 Binary files /dev/null and b/shipstation_odoo_connector/static/description/banner.png differ diff --git a/shipstation_odoo_connector/static/description/icon.png b/shipstation_odoo_connector/static/description/icon.png new file mode 100644 index 000000000..2b73d2e9e Binary files /dev/null and b/shipstation_odoo_connector/static/description/icon.png differ diff --git a/shipstation_odoo_connector/static/description/index.html b/shipstation_odoo_connector/static/description/index.html new file mode 100644 index 000000000..0a6e21ec3 --- /dev/null +++ b/shipstation_odoo_connector/static/description/index.html @@ -0,0 +1,669 @@ +
+ +
+ +
+
+ Community +
+
+
+ + + +

ShipStation Odoo Connector

+

Integrate and Manage ShipStation Operations with Odoo

+ + + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This connector will help to integrate and manage your shipstation orders with Odoo. + Furthermore, It Synchronizes Orders, Products, and Customers. + You can easily integrate with various shipping companies. + In addition, the connector will automatically transfer order details such as Order Tracking number and Shipping Cost from Odoo to shipstation +
+
+ + +
+
+

+ Configuration +

+
+
+ +
+
+ +

Steps to setup account in Shipstation

+

1. Open Shipstation website and click on the Try Shipstation Now option

+
+

2. Provide the details and agree to the terms and condition and click on Get started

+
+

3. In the shipstation dashboard click on the settings icon

+
+

4. Expand the Account section and click on ApiSettings

+
+

5. Here we can see the API KEY(username) and API Secret(Password)

+
+

6. We need to set up a shipping carrier, for that click on the Add a Carrier Account

+
+

7. Finally, click on the carrier and set up the account

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

+ Features +

+
+
+
+
+ + Easily integrate more than 25 shipping companies with Shipstation. +
+
+ + One platform for all carriers +
+
+ + You can also import Packages +
+
+ + Get Tracking number and obtain Tracking status.
+
+
+ + One Click integrates shipping rate with sale order.
+
+
+ + Option to import Carriers
+
+
+ + +You can import Services
+
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

Easily integrate more than 25 shipping companies with Shipstation.

+ +
+ +
+

Get Tracking number and obtain Tracking status.

+

Automatically fetch tracking number and tracking status from shipstation when you open the record

+ +
+ +
+

Option to import records from shipstation

+

You can simply import carrier, service, store and packages with one click

+ +
+ + +
+

Steps to setup account in Shipstation

+

1. Synchronize Store, Services, Delivery and Package operations.

+ +
+
+ +

2. After the installation, you can configure the shipstation by adding the details such as name, URL, API and many more.

+ +
+
+ +

3. Separate shipstation Services menu

+ +
+
+ +

4. Dedicated shipstation Packages menu

+ +
+
+ +

5. Get Shipping cost based on the shipping method

+ +
+
+ +

6. Automatically shipstation status and Tracking Reference

+ +
+
+ +

7. Get Shipping label.

+ +
+
+ +

8. Purchase Product From Website.

+ +
+
+ +

9. Get Rate of shipping From Shipstation.

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

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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/shipstation_odoo_connector/views/api_credential.xml b/shipstation_odoo_connector/views/api_credential.xml new file mode 100644 index 000000000..b5aa5237f --- /dev/null +++ b/shipstation_odoo_connector/views/api_credential.xml @@ -0,0 +1,56 @@ + + + + + + shipstation.api.form + shipstation.api + + +
+
+
+ + + + + + + + + + +
+
+
+ + + shipstation.api.credential + shipstation.api + + + + + + + + + + + + Shipstation Credential + shipstation.api + tree,form + +

+ Create Api credential +

+
+
+
+
diff --git a/shipstation_odoo_connector/views/delivery_carrier_view.xml b/shipstation_odoo_connector/views/delivery_carrier_view.xml new file mode 100644 index 000000000..602a7cc1f --- /dev/null +++ b/shipstation_odoo_connector/views/delivery_carrier_view.xml @@ -0,0 +1,31 @@ + + + + + delivery.carrier.form.provider.shipstaion + delivery.carrier + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shipstation_odoo_connector/views/delivery_shipstation.xml b/shipstation_odoo_connector/views/delivery_shipstation.xml new file mode 100644 index 000000000..06725eee3 --- /dev/null +++ b/shipstation_odoo_connector/views/delivery_shipstation.xml @@ -0,0 +1,55 @@ + + + + + + shipstation.delivery.form + shipstation.delivery + + +
+ + + + + + + + + + + + + + + +
+
+
+ + + shipstation.delivery + shipstation.delivery + + + + + + + + + + + + Shipstation Delivery + shipstation.delivery + tree,form + +

+ Create Shipstation delivery +

+
+
+
+
diff --git a/shipstation_odoo_connector/views/packages_shipstation.xml b/shipstation_odoo_connector/views/packages_shipstation.xml new file mode 100644 index 000000000..601f5e3fd --- /dev/null +++ b/shipstation_odoo_connector/views/packages_shipstation.xml @@ -0,0 +1,52 @@ + + + + + + shipstation.packages.form + shipstation.packages + + +
+ + + + + + + + + + + +
+
+
+ + + shipstation.packages.details + shipstation.packages + + + + + + + + + + + + + Shipstation Packages + shipstation.packages + tree,form + +

+ Create Shipstation packages +

+
+
+
+
diff --git a/shipstation_odoo_connector/views/sale_orders.xml b/shipstation_odoo_connector/views/sale_orders.xml new file mode 100644 index 000000000..c8b297d7c --- /dev/null +++ b/shipstation_odoo_connector/views/sale_orders.xml @@ -0,0 +1,19 @@ + + + + + + + Shipstation Orders + sale.order + [('carrier_id.delivery_type', '=', 'shipstation')] + tree,form + +

+ Create Shipstation Orders +

+
+
+
+
\ No newline at end of file diff --git a/shipstation_odoo_connector/views/services.xml b/shipstation_odoo_connector/views/services.xml new file mode 100644 index 000000000..139a2a39f --- /dev/null +++ b/shipstation_odoo_connector/views/services.xml @@ -0,0 +1,51 @@ + + + + + + shipstation.service.form + shipstation.service + +
+ + + + + + + + + + + +
+
+
+ + + shipstation.service.tree + shipstation.service + + + + + + + + + + + + + Shipstation Services + shipstation.service + tree,form + +

+ Create Shipstation Store +

+
+
+
+
\ No newline at end of file diff --git a/shipstation_odoo_connector/views/shipstation_actions.xml b/shipstation_odoo_connector/views/shipstation_actions.xml new file mode 100644 index 000000000..daef217c7 --- /dev/null +++ b/shipstation_odoo_connector/views/shipstation_actions.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/shipstation_odoo_connector/views/stock_picking.xml b/shipstation_odoo_connector/views/stock_picking.xml new file mode 100644 index 000000000..8b20a3d53 --- /dev/null +++ b/shipstation_odoo_connector/views/stock_picking.xml @@ -0,0 +1,62 @@ + + + + + + Add.stock.picking.form + stock.picking + + + + + +