@ -0,0 +1,49 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
|
||||
|
Odoo Icecat Connector |
||||
|
======================= |
||||
|
* Retrieve product information from Icecat and display it on the website shop. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No configuration |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Lesser General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
Developers: (V17) Gokul P I, |
||||
|
(V18) Sreeshanth V S, |
||||
|
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 <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,58 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Odoo Icecat Connector', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'eCommerce', |
||||
|
'summary': 'With the Odoo Icecat Connector, businesses can unleash the ' |
||||
|
'full potential of their Odoo e-commerce platform. By ' |
||||
|
'integrating the Icecat database with Odoo, businesses can ' |
||||
|
'import accurate product details', |
||||
|
'description': 'The Odoo Icecat Connector is a specialized module designed' |
||||
|
' to integrate the Icecat database with an Odoo e-commerce' |
||||
|
' website. Icecat is a leading global provider of product ' |
||||
|
'content, offering a vast repository of rich product data ' |
||||
|
'including descriptions, images, specifications, and more.', |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'depends': ['website_sale', 'stock'], |
||||
|
'data': [ |
||||
|
'views/shop_templates.xml', |
||||
|
'views/product_template_views.xml', |
||||
|
'views/res_config_settings_views.xml', |
||||
|
], |
||||
|
'assets': { |
||||
|
'web.assets_frontend': [ |
||||
|
'odoo_icecat_connector/static/src/js/icecat.js', |
||||
|
'https://live.icecat.biz/js/live-current-2.js' |
||||
|
], |
||||
|
}, |
||||
|
'images': [ |
||||
|
'static/description/banner.jpg', |
||||
|
], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'application': False, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import odoo_icecat_connector |
||||
|
from . import website_sales |
@ -0,0 +1,51 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import requests |
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
class IcecatConnector(http.Controller): |
||||
|
|
||||
|
|
||||
|
@http.route('/get_icecat_product_details', type='json', |
||||
|
auth="public") |
||||
|
def get_icecat_product_details(self, product_id): |
||||
|
"""Returns the details of a product""" |
||||
|
if product_id: |
||||
|
products = request.env['product.product'].sudo().browse( |
||||
|
int(product_id)) |
||||
|
response = requests.get( |
||||
|
"https://live.icecat.biz/api?UserName=%s&Language=en&Content" |
||||
|
"=&Brand=%s&ProductCode=%s" % ( |
||||
|
str(request.env.company.sudo().user_id_icecat), |
||||
|
products.brand, products.default_code)) |
||||
|
if 'data' in response.json(): |
||||
|
status = True |
||||
|
else: |
||||
|
status = False |
||||
|
return { |
||||
|
'brand': products.brand, |
||||
|
'product_code': products.default_code, |
||||
|
'username': str(request.env.company.sudo().user_id_icecat), |
||||
|
'status': status |
||||
|
} |
@ -0,0 +1,100 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import requests |
||||
|
from odoo.addons.website_sale.controllers.main import WebsiteSale |
||||
|
from odoo.addons.website.controllers.main import QueryURL |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
class Icecat(WebsiteSale): |
||||
|
|
||||
|
def _prepare_product_values(self, product, category, search, **kwargs): |
||||
|
"""Override method to pass the product details from the icecat to |
||||
|
odoo website""" |
||||
|
product_category = request.env['product.public.category'].sudo() |
||||
|
if category: |
||||
|
category = product_category.sudo().browse(int(category)).exists() |
||||
|
attrib_list = request.httprequest.args.getlist('attrib') |
||||
|
attrib_values = [[int(attr) for attr in attribute.split("-")] for |
||||
|
attribute in attrib_list if |
||||
|
attribute] |
||||
|
attrib_set = {attribute[1] for attribute in attrib_values} |
||||
|
keep = QueryURL( |
||||
|
'/shop', |
||||
|
**self._product_get_query_url_kwargs( |
||||
|
category=category and category.id, search=search, |
||||
|
**kwargs, ), ) |
||||
|
# Needed to trigger the recently viewed product rpc |
||||
|
view_track = request.website.viewref("website_sale.product").track |
||||
|
username = request.env.company.sudo().user_id_icecat |
||||
|
if username: |
||||
|
response = requests.get( |
||||
|
"https://live.icecat.biz/api?UserName=%s&Language=en&Content" |
||||
|
"=&Brand=%s&ProductCode=%s" % ( |
||||
|
str(username), product.brand, product.default_code)) |
||||
|
icecat = response.json() |
||||
|
if 'data' in icecat: |
||||
|
return { |
||||
|
'search': search, |
||||
|
'category': category, |
||||
|
'pricelist': request.website.pricelist_id, |
||||
|
'attrib_values': attrib_values, |
||||
|
'attrib_set': attrib_set, |
||||
|
'keep': keep, |
||||
|
'categories': product_category.sudo().search( |
||||
|
[('parent_id', '=', False)]), |
||||
|
'main_object': product, |
||||
|
'product': product, |
||||
|
'add_qty': 1, |
||||
|
'view_track': view_track, |
||||
|
'icecat': icecat['data'] |
||||
|
} |
||||
|
else: |
||||
|
return { |
||||
|
'search': search, |
||||
|
'category': category, |
||||
|
'pricelist': request.website.pricelist_id, |
||||
|
'attrib_values': attrib_values, |
||||
|
'attrib_set': attrib_set, |
||||
|
'keep': keep, |
||||
|
'categories': product_category.sudo().search( |
||||
|
[('parent_id', '=', False)]), |
||||
|
'main_object': product, |
||||
|
'product': product, |
||||
|
'add_qty': 1, |
||||
|
'view_track': view_track, |
||||
|
} |
||||
|
else: |
||||
|
return { |
||||
|
'search': search, |
||||
|
'category': category, |
||||
|
'pricelist': request.website.pricelist_id, |
||||
|
'attrib_values': attrib_values, |
||||
|
'attrib_set': attrib_set, |
||||
|
'keep': keep, |
||||
|
'categories': product_category.sudo().search( |
||||
|
[('parent_id', '=', False)]), |
||||
|
'main_object': product, |
||||
|
'product': product, |
||||
|
'add_qty': 1, |
||||
|
'view_track': view_track, |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
## Module <odoo_icecat_connector> |
||||
|
|
||||
|
#### 19.06.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Odoo Icecat Connector |
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import product_template |
||||
|
from . import res_company |
||||
|
from . import res_config_settings |
@ -0,0 +1,31 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ProductTemplate(models.Model): |
||||
|
"""Inheriting the product template for adding the field for icecat |
||||
|
product brand""" |
||||
|
_inherit = 'product.template' |
||||
|
|
||||
|
brand = fields.Char(string="Brand", |
||||
|
help="The brand name of product in the icecat") |
@ -0,0 +1,31 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResCompany(models.Model): |
||||
|
"""Inheriting this class to add the icecat credential need in config |
||||
|
settings and use the multi company feature""" |
||||
|
_inherit = 'res.company' |
||||
|
|
||||
|
user_id_icecat = fields.Char(string='Icecat User Id', |
||||
|
help='User id of the icecat') |
@ -0,0 +1,33 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
"""Inheriting the config settings for adding the field for icecat user |
||||
|
id""" |
||||
|
_inherit = 'res.config.settings' |
||||
|
|
||||
|
user_id_icecat = fields.Char(string='Icecat User Id', |
||||
|
help='User id of the icecat', |
||||
|
related='company_id.user_id_icecat', |
||||
|
readonly=False) |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 179 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 436 KiB |
After Width: | Height: | Size: 173 KiB |
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 816 KiB |
After Width: | Height: | Size: 126 KiB |
@ -0,0 +1,40 @@ |
|||||
|
/** @odoo-module **/ |
||||
|
import { rpc } from "@web/core/network/rpc"; |
||||
|
/** |
||||
|
* Fetches Icecat product details based on the provided product ID. |
||||
|
*/ |
||||
|
function fetchIcecatProductDetails() { |
||||
|
// Get the product ID from the element with the class 'product_id'
|
||||
|
var productElement = document.querySelector('.product_id'); |
||||
|
var product_id = productElement ? productElement.value : undefined; |
||||
|
// Check if the product ID is defined
|
||||
|
if (typeof $('.product_id').val() !== "undefined") { |
||||
|
// Make a RPC call to retrieve Icecat product details
|
||||
|
rpc('/get_icecat_product_details', { |
||||
|
'product_id': product_id, |
||||
|
}).then((data) => { |
||||
|
if (data.status) { |
||||
|
IcecatLive.getDatasheet({ |
||||
|
'title': '#icecat_title', |
||||
|
'essentialinfo': '#icecat_essentialinfo', |
||||
|
'marketingtext': '#icecat_marketingtext', |
||||
|
'manuals': '#icecat_manuals', |
||||
|
'reasonstobuy': '#icecat_reasonstobuy', |
||||
|
'reviews': '#icecat_reviews', |
||||
|
'featuregroups': '#icecat_featuregroups', |
||||
|
'gallery': '#icecat_gallery', |
||||
|
'featurelogos': '#icecat_featurelogos', |
||||
|
'tours3d': '#icecat_tours3d', |
||||
|
'videos': '#icecat_videos', |
||||
|
'productstory': '#icecat_productstory' |
||||
|
}, { |
||||
|
Brand: data.brand, |
||||
|
PartCode: data.product_code, |
||||
|
UserName: data.username, |
||||
|
}, 'en'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
// Call the function to fetch Icecat product details
|
||||
|
fetchIcecatProductDetails(); |
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting the product template to add the new field --> |
||||
|
<record id="product_template_only_form_view" model="ir.ui.view"> |
||||
|
<field name="name">product.template.view.form.inherit.odoo.icecat.connector</field> |
||||
|
<field name="model">product.template</field> |
||||
|
<field name="inherit_id" |
||||
|
ref="product.product_template_only_form_view"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='default_code']" position="after"> |
||||
|
<field name="brand"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<!-- Inheriting the res config to add the new field --> |
||||
|
<record id="res_config_settings_view_form" model="ir.ui.view"> |
||||
|
<field name="name">res.config.settings.view.form.inherit.odoo.icecat.connector</field> |
||||
|
<field name="model">res.config.settings</field> |
||||
|
<field name="priority" eval="15"/> |
||||
|
<field name="inherit_id" |
||||
|
ref="website.res_config_settings_view_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='favicon']" position="after"> |
||||
|
<div class=""> |
||||
|
<div> |
||||
|
<div> |
||||
|
<label for="user_id_icecat"/> |
||||
|
</div> |
||||
|
<div class="text-muted"> |
||||
|
Select your Icecat username here |
||||
|
</div> |
||||
|
<div> |
||||
|
<field name="user_id_icecat"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,60 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting the shop page to add the product details from icecat db--> |
||||
|
<template id="icecat_shop_product" inherit_id="website_sale.product" |
||||
|
name="Products"> |
||||
|
<xpath expr="//section[@id='product_detail']" position="after"> |
||||
|
<div class="container"> |
||||
|
<t t-if="icecat"> |
||||
|
<h2> |
||||
|
<t t-esc="icecat['GeneralInfo']['Title']"/> |
||||
|
</h2> |
||||
|
<div class="IcecatLive -icecat-tabs_body for-essentialinfo"> |
||||
|
<div class="IcecatLive for-essentialinfo"> |
||||
|
<div class="-essential-container"> |
||||
|
<div class="-icecat-info_product"> |
||||
|
<span class="-title">Brand:</span> |
||||
|
<span class="-text"> |
||||
|
<t t-esc="icecat['GeneralInfo']['Brand']"/> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div class="-icecat-info_product"> |
||||
|
<span class="-title">Product name: |
||||
|
</span> |
||||
|
<span class="-text"> |
||||
|
<t t-esc="icecat['GeneralInfo']['Title']"/> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div class="-icecat-info_product"> |
||||
|
<span class="-title">Product code: |
||||
|
</span> |
||||
|
<span class="-text"> |
||||
|
<t t-esc="icecat['GeneralInfo']['BrandPartCode']"/> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div id="liveMainImage" |
||||
|
class="-icecat-product_img"> |
||||
|
<img style="width:350px" |
||||
|
id="img-medium-2290933-13754032" |
||||
|
class="-icecat-ajaxImg" |
||||
|
t-att-src="icecat['Image']['HighPic']" |
||||
|
data-loaded="true"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
<div id="icecat_marketingtext"/> |
||||
|
<div id="icecat_manuals"/> |
||||
|
<div id="icecat_reasonstobuy"/> |
||||
|
<div id="icecat_reviews"/> |
||||
|
<div id="icecat_featuregroups"/> |
||||
|
<div id="icecat_gallery"/> |
||||
|
<div id="icecat_featurelogos"/> |
||||
|
<div id="icecat_tours3d"/> |
||||
|
<div id="icecat_videos"/> |
||||
|
<div id="icecat_productstory"/> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |