Compare commits

...

2 commits

90 changed files with 1665 additions and 0 deletions

View file

@ -0,0 +1,50 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Default product image v16
===========================
You my have some issue to customize the default image of your products,
this module will helpe you to add default image (your logo or custom image) to your products.
Installation
============
* Just install the module.
Configuration
=============
* Go to Setting
* Choose your image in "default image" section
* Enjoy the module !
Company
-------
* `Imal-Tech <https://imal-tech.com/>`__
Credits
-------
* Developers:
Version 16: Imal-tech team @imaltech
Contacts
--------
* Mail Contact : contact@imal-tech.com
* Website : https://imal-tech.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://imal-tech.com/wp-content/uploads/2021/01/imal-tech-logo-.gif
:target: https://imal-tech.com
This module is maintained by Imal-tech.
For support and more information, please visit `Our Website <https://imal-tech.com/>`__
Further information
===================
HTML Description: `<static/description/index.html>`__

View file

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
{
'name': 'Default Product Image',
'description': """
This module will help you to add default image to products with no images.
""",
'summary': 'Module to help you add default image to products',
'author': 'Imal-Tech',
'website': 'https://www.imal-tech.com',
'maintainer': 'Imal-Tech',
'category': 'Sales',
'version': '16.0.1.0.0',
'depends': ['base', 'sale_management'],
'data': [
'views/res_config_views.xml',
],
'license': 'LGPL-3',
'images': ['static/description/banner.gif'],
'installable': True,
'application': False,
'auto_install': False,
}

View file

@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * default_product_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-15 15:43+0000\n"
"PO-Revision-Date: 2022-11-15 15:43+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: default_product_image
#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image
msgid ""
"<span class=\"fa fa-lg fa-image\" title=\"Values set here are website-"
"specific.\"/>"
msgstr ""
#. module: default_product_image
#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image
msgid "Add the default image to products."
msgstr "Ajoutez l'image par défaut aux produits."
#. module: default_product_image
#: model:ir.model,name:default_product_image.model_res_config_settings
msgid "Config Settings"
msgstr "Paramètres de config"
#. module: default_product_image
#: model:ir.model.fields,field_description:default_product_image.field_res_config_settings__product_default_image
#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image
msgid "Default Image"
msgstr "Image par défaut"
#. module: default_product_image
#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image
msgid "Default image"
msgstr "Image par défaut"
#. module: default_product_image
#: model:ir.model,name:default_product_image.model_product_template
msgid "Product"
msgstr "Article"

View file

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import res_config
from . import product_template

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, tools
class ProductTemplate(models.Model):
""" Inherit Product Template Settings to add default image product from setting """
_inherit = "product.template"
@api.model_create_multi
def create(self, vals_list):
for val_list in vals_list:
if not val_list['image_1920']:
product_default_image = self.env['ir.config_parameter'].sudo().get_param(
'res.config.settings.product_default_image')
if product_default_image:
val_list['image_1920'] = product_default_image
return super(ProductTemplate, self).create(vals_list)

View file

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, _, api
class ResConfig(models.TransientModel):
""" Inherit Res Config Settings to add default image product field """
_inherit = 'res.config.settings'
product_default_image = fields.Binary(string="Default Image")
@api.model
def get_values(self):
res = super(ResConfig, self).get_values()
res.update(
product_default_image=self.env['ir.config_parameter'].sudo().get_param(
'res.config.settings.product_default_image'),
)
return res
def set_values(self):
super(ResConfig, self).set_values()
param = self.env['ir.config_parameter'].sudo()
param.set_param('res.config.settings.product_default_image', self.product_default_image)

View file

@ -0,0 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

@ -0,0 +1,432 @@
<div class="container" style="padding:1rem !important; margin-bottom:1rem !important">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom:1px solid #d5d5d5">
<div class="my-3">
<a href="https://www.imal-tech.com/" target="_blank"><img
src="https://imal-tech.com/wp-content/uploads/2021/01/imal-tech-logo-.gif"
style="width:auto !important; height:40px !important"></a>
</div>
<div class="my-3 d-flex align-items-center">
<div style="background-color:#5f5e97 !important; color:#fff !important; font-weight:600 !important; padding:5px 15px 8px !important; margin:0 5px !important">
<i class="fa fa-check mr-1"></i>Community
</div>
<div style="background-color:#875A7B !important; color:#fff !important; font-weight:600 !important; padding:5px 15px 8px !important; margin:0 5px !important">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
</div>
</div>
</div>
</div>
<!-- Explore this module -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="font-weight: 600;text-align: center;width: 100%; color:#283374;"><i class="fa fa-compass mr-2"></i>Key
Explore this module</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;"/>
</div>
<div class="col-md-6">
<a href="#overview" style="text-decoration:none !important">
<div class="row"
style="background-color:#f5f2f5 !important; border-radius:10px !important; margin:1rem !important; padding:1.5em !important; height:100px !important">
<div class="col-8">
<h3 style="font-family:'Montserrat', sans-serif !important; font-weight:600 !important; color:#283374 !important; font-size:1.2rem !important">
Overview</h3>
<p style="font-family:'Roboto', sans-serif !important; font-weight:400 !important; color:#283374 !important; font-size:0.9rem !important">
Learn more about this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color:#283374 !important"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#features" style="text-decoration:none !important">
<div class="row"
style="background-color:#f5f2f5 !important; border-radius:10px !important; margin:1rem !important; padding:1.5em !important; height:100px !important">
<div class="col-8">
<h3 style="font-family:'Montserrat', sans-serif !important; font-weight:600 !important; color:#283374 !important; font-size:1.2rem !important">
Features</h3>
<p style="font-family:'Roboto', sans-serif !important; font-weight:400 !important; color:#283374 !important; font-size:0.9rem !important">
View features of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color:#283374 !important"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#screenshots" style="text-decoration:none !important">
<div class="row"
style="background-color:#f5f2f5 !important; border-radius:10px !important; margin:1rem !important; padding:1.5em !important; height:100px !important">
<div class="col-8">
<h3 style="font-family:'Montserrat', sans-serif !important; font-weight:600 !important; color:#283374 !important; font-size:1.2rem !important">
Screenshots</h3>
<p style="font-family:'Roboto', sans-serif !important; font-weight:400 !important; color:#283374 !important; font-size:0.9rem !important">
See key screenshots of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color:#283374 !important"></i>
</div>
</div>
</a>
</div>
</div>
<!-- Overview -->
<div class="row" id="overview">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="font-weight: 600;text-align: center;width: 100%; color:#283374;"><i class="fa fa-pie-chart mr-2"></i>Key
Overview</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;"/>
</div>
<div class="col-mg-12 pl-3">
<h3 style="font-size: 18px; margin-top: 8px; position: relative;"> This module will help you to add default image to products with no images.
</h3>
</div>
</div>
<!-- Features -->
<div class="row" id="features">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="font-weight: 600;text-align: center;width: 100%; color:#283374;"><i class="fa fa-star mr-2"></i>Key
Features</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;"/>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<i class="fa fa-check-circle-o fa-2x" style="width:40px; color:#9D3E8F"></i>
</div>
<div>
<h4 style="font-family:'Roboto', sans-serif !important; font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
Community &amp; Enterprise Support</h4>
<p style="font-family:'Roboto', sans-serif !important; font-weight:400 !important; color:#282F33 !important; font-size:1rem !important">
Available in Odoo 16.0 Community and Enterprise.</p>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<i class="fa fa-check-circle-o fa-2x" style="width:40px; color:#9D3E8F"></i>
</div>
<div>
<h4 style="font-family:'Roboto', sans-serif !important; font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
Config default product</h4>
<p style="font-family:'Roboto', sans-serif !important; font-weight:400 !important; color:#282F33 !important; font-size:1rem !important">
Product images will automatically change when you change Default Product Image in the sale configuration page.</p>
</div>
</div>
</div>
<!-- Screenshots -->
<div class="row" id="screenshots">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="font-weight: 600;text-align: center;width: 100%; color:#283374;"><i class="fa fa-image mr-2"></i>Key
Screenshots</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;"/>
</div>
<div class="col-lg-12 my-2">
<h4 class="mt-2"
style="font-family:'Roboto', sans-serif !important; font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
Setting</h4>
<img src="images/Imal-Tech_default_product_setting.png"
class="img-responsive img-thumbnail border" width="100%" height="auto">
</div>
</div>
<!-- Our Services -->
<section class="row" style="padding: 2rem 3rem 1rem;margin:0px">
<h2 style="font-weight: 600;margin-bottom: 20px;text-align: center;width: 100%; color:#283374;"><i
class="fa fa-tasks mr-2"></i>Our
Services </h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;">
<div class="row" style=" display: flex; justify-content: center; flex-wrap: wrap;width: 100%; ">
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;"><a
href="#" target="_blank"> <img
src="images/odoo_customization.png"
style="width: 120%;border-radius: 100%;"/> </a></div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Customization </a></h3>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;"><a
href="#" target="_blank"> <img
src="images/odoo_implementation.png"
style="width: 120%;border-radius: 100%;"/> </a></div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Implementation </a></h3>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;"><a
href="#" target="_blank"> <img
src="images/odoo_support.png"
style="width: 120%;border-radius: 100%;"/> </a></div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Support </a></h3>
</div>
</div>
</section>
<!-- Our Industries -->
<section class="row" style="padding: 2rem 3rem 1rem;margin:0px">
<div class="row" style="margin: 0">
<h2 style="font-weight: 600;margin-bottom: 20px;text-align: center;width: 100%; color:#283374;"><i
class="fa fa-cogs mr-2"></i>Our
Industries</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;">
<!-- <div style="display:flex;justify-content: space-between;flex-wrap:wrap;"> -->
<div class="row" style="width: 100%">
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank"> <img
src="images/service_managment.png"
alt="Service Management"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Service Management </a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
Keep track of services and invoice accordingly. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#"
target="_blank"> <img
src="images/hotel.png"
alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;" style=" margin-bottom: 10px; ">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#"
target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Hotel Management</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;font-family: 'Montserrat',sans-serif;">
An all-inclusive hotel management application. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank">
<img src="images/manufacturing.png"
alt="Odoo Manufacturing"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Manufacturing</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;font-family: 'Montserrat',sans-serif;">
Plan, track and schedule your operations. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank"> <img
src="images/restaurant.png"
alt="Odoo Restaurant"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Restaurant</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;font-family: 'Montserrat',sans-serif;">
Run your bar or restaurant methodical. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank"> <img
src="images/pos.png"
alt="Odoo POS"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 0px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
POS</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
Mobile friendly, awe-inspiring product pages. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank">
<img src="images/e-commerce.png"
alt="Odoo E-commerce"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
E-commerce & Website</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
An all-inclusive hotel management application. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank">
<img src="images/agriculture.png"
alt="Odoo Agriculture"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Agriculture management</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
Run efficiently your agriculture's products & farms </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12" style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#9D3E8F; border-radius:100%;float: left;text-align: left;">
<a href="#" target="_blank"> <img
src="images/e-learning.png"
alt="Odoo Education"
style=" border-radius: 100%;width:100%;"/> </a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="#" target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Education</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
A Collaborative platform for educational management. </h3>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container">
<center>
<div class="col-md-12" style="margin: auto !important;
width: 70%;
padding: 30px;">
<h2 style="font-weight: 600;text-align: center;width: 100%; color:#283374; color:#283374;"><i
class="fa fa-headphones mr-2"></i>Need Any
Help? </h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #9D3E8F;width: 5%;">
<h4 style="font-size:16px;"> If you have anything to share with us based on your use of this module, please
let us know. We are ready to offer our support. </h4>
</div>
</center>
</section>
</div>
<!-- Contact us -->
<div class="row d-flex justify-content-center align-items-center" style="max-width:1540px; margin:0 auto">
<div class="col-lg-3 shadow mt-2"
style="padding:5rem 2rem 2rem; border-radius:10px; margin-right:3rem; border-top:7px solid #9D3E8F; height:300px">
<h5 class="font-weight-bold" style="font-family:Roboto, 'sans-serif'">Visit us</h5>
<p class="mb-4" style="color:#808e9b; font-size:0.9rem">Visit our website for more
information.</p>
<a href="https://www.imal-tech.com/" target="_blank">
<span href="https://imal-tech.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration:none; background-color:#9D3E8F; color:#FFF; border-radius:4px">www.imal-tech.com</span>
</a>
</div>
<div class="col-lg-3 shadow mt-2"
style="padding:5rem 2rem 2rem; border-radius:10px; margin-right:3rem; border-top:7px solid #283374; height:330px">
<h5 class="font-weight-bold" style="font-family:Roboto, 'sans-serif'">Write to us</h5>
<p class="mb-4" style="color:#808e9b; font-size:0.9rem">Do you have any queries regarding our
products &amp; services? Let us know.</p>
<a href="mailto:contact@imal-tech.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration:none; background-color:#283374; color:#FFF; border-radius:4px">contact@imal-tech.com</a>
</div>
<div class="col-lg-3 shadow mt-2"
style="padding:5rem 2rem 2rem; border-radius:10px; margin-right:3rem; border-top:7px solid #9D3E8F; height:300px">
<h5 class="font-weight-bold" style="font-family:Roboto, 'sans-serif'">Follow Us</h5>
<p class="mb-4" style="color:#808e9b; font-size:0.9rem">Follow us on social media for latest
updates.</p>
<section class="oe_container" style="padding: 0% 0% 6% 0%;">
<div class="oe_slogan" style="margin-bottom: 0px;">
<div style=" display: flex; justify-content: center; flex-wrap: wrap; ">
</div>
<br>
<div style=" display: flex; justify-content: center; flex-wrap: wrap; ">
<a href="https://www.linkedin.com/company/imal-tech" target="_blank"><i class="fa fa-2x fa-linkedin"
style="color:white;background: #0a66c2;width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
</td>
<a href="https://www.facebook.com/IMAL-TECH-111415158048241" target="_blank"><i
class="fa fa-2x fa-facebook"
style="color:white;background: #3b5998;width:35px; height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
</td>
<a href="https://www.youtube.com/channel/UC6CVulVEhO32fh5Jf-jHlFg" target="_blank"><i
class="fa fa-2x fa-youtube"
style="color:white;background: #ac0f18;width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
</td>
<a href="https://www.instagram.com/imal_tech" target="_blank"><i
class="fa fa-2x fa-instagram"
style="color:white;background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
</td>
</div>
</div>
</section>
</div>
<br/>
<br/>
<a href="https://www.imal-tech.com/" target="_blank"><img
src="https://imal-tech.com/wp-content/uploads/2021/01/imal-tech-logo-.gif"
style="width: 190px; margin-bottom: 25px;margin-top: 30px;" class="center-block"></a>
<!-- End of Contact Cards -->
</div>
<br/>
<br/>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Res Config settings form inherit -->
<record id="res_config_settings_view_form_default_image" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.sale.frequent</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="sale.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-key='sale_management']" position="inside">
<h2>Default image</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box" id="variant_options">
<label string="Default Image" for="product_default_image"/>
<span class="fa fa-lg fa-image" title="Values set here are website-specific."/>
<div class="text-muted">
Add the default image to products.
</div>
<field name="product_default_image" type="base64" widget="image" class="oe_avatar"/>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>

49
product_import/README.rst Normal file
View file

@ -0,0 +1,49 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Product Image from URL
======================
Product Image from URL and Path
Configuration
=============
* No additional configurations needed
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
License
-------
GNU AFFERO GENERAL PUBLIC LICENSE Version 3 (AGPL v3)
(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html)
Credits
-------
* Developers: Mohammed Shahil MP @cybrosys, Contact: odoo@cybrosys.com
(V14) Minhaj T @cybrosys, Contact: odoo@cybrosys.com
(V15) Minhaj T @cybrosys, Contact: odoo@cybrosys.com
(V16) Amaya Aravind EV @cybrosys, 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>`__

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import models
from . import wizard

View file

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'name': 'Product Image from URL',
'version': '16.0.1.1.1',
'category': 'Sales',
'summary': 'Product Images from Web URL and Path',
'description': 'users can effortlessly import images by providing a web '
'URL, ensuring swift retrieval from online sources. '
'Simultaneously, users can opt for a local import, simply '
'specifying the file path.',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['sale_management'],
'data': [
'security/ir.model.access.csv',
'views/product_product_views.xml',
'views/product_template_views.xml',
'wizard/product_import_views.xml',
],
'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -0,0 +1,4 @@
Product name,product type,Barcode,Price,Image
Laptop,consu,5465465554,25000,https://images-na.ssl-images-amazon.com/images/I/81xe3aoU6BL._AC_SL1500_.jpg
smart phone,product,7081234174,35000,/home/cybrosys/Desktop/phone.jpeg
bike,service,8720132165,2700,
1 Product name product type Barcode Price Image
2 Laptop consu 5465465554 25000 https://images-na.ssl-images-amazon.com/images/I/81xe3aoU6BL._AC_SL1500_.jpg
3 smart phone product 7081234174 35000 /home/cybrosys/Desktop/phone.jpeg
4 bike service 8720132165 2700

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 KiB

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import product_product
from . import product_template

View file

@ -0,0 +1,64 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import base64
import certifi
import urllib3
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class ProductProduct(models.Model):
"""Inherit the model to add fields and function"""
_inherit = 'product.product'
image_url = fields.Char(string='Image URL', help='Image URL or Path')
image_added = fields.Binary("Image (1920x1920)",
compute='_compute_image_added', store=True)
@api.depends('image_url')
def _compute_image_added(self):
""" Function to load an image from URL or local file path """
image = False
if self.image_url:
if self.image_url.startswith(('http://', 'https://')):
# Load image from URL
try:
http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where())
image_response = http.request('GET', self.image_url)
image = base64.b64encode(image_response.data)
except Exception as e:
# Handle URL loading errors
raise UserError(
_(f"Error loading image from URL: {str(e)}"))
else:
# Load image from local file path
try:
with open(self.image_url, 'rb') as image_file:
image = base64.b64encode(image_file.read())
except Exception as e:
# Handle local file loading errors
raise UserError(
_(f"Error loading image from local path: {str(e)}"))
image_added = image
if image_added:
self.image_1920 = image_added

View file

@ -0,0 +1,64 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import base64
import certifi
import urllib3
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class ProductTemplate(models.Model):
"""Inherit the model to add fields and function"""
_inherit = 'product.template'
image_url = fields.Char(string='Image URL', help='Image URL or Path')
image_added = fields.Binary("Image (1920x1920)",
compute='_compute_image_added', store=True)
@api.depends('image_url')
def _compute_image_added(self):
""" Function to load an image from URL or local file path """
image = False
if self.image_url:
if self.image_url.startswith(('http://', 'https://')):
# Load image from URL
try:
http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where())
image_response = http.request('GET', self.image_url)
image = base64.b64encode(image_response.data)
except Exception as e:
# Handle URL loading errors
raise UserError(
_(f"Error loading image from URL: {str(e)}"))
else:
# Load image from local file path
try:
with open(self.image_url, 'rb') as image_file:
image = base64.b64encode(image_file.read())
except Exception as e:
# Handle local file loading errors
raise UserError(
_(f"Error loading image from local path: {str(e)}"))
image_added = image
if image_added:
self.image_1920 = image_added

View file

@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_product_import,access.product.import,model_product_import,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_product_import access.product.import model_product_import base.group_user 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -0,0 +1,543 @@
<div style="background-color: #714B67; min-height: 600px; width: 100%; padding: 15px; position: relative;">
<!-- TITLE BAR -->
<div
style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;">
<img src="assets/misc/cybrosys-logo.png" width="42" height="42" style="width: 42px; height: 42px;" />
<div>
<div style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Community
</div>
<div style="color: #875A7B; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
<div style="color: #017E84; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Odoo.sh
</div>
</div>
</div>
<!-- END OF TITLE BAR -->
<!-- APP HERO -->
<h1 style="color: #FFFFFF; font-weight: bolder; font-size: 50px; text-align: center; margin-top: 50px;">Product Image from URL</h1>
<p style="color:#FFFFFF; padding: 8px 15px; text-align: center; font-size: 24px;"> Product Image from URL and Path</p>
<!-- END OF APP HERO -->
<img src="assets/screenshots/hero.gif"
style="width: 75%; height: auto; position: absolute; margin-left: auto; margin-right: auto; top: 45%; left: 12%; right: auto;" />
</div>
<!-- NAVIGATION SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/compass.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Explore This
Module</h2>
</div>
<div class="row my-4" style="font-family: 'Montserrat', sans-serif;">
<div class="col-sm-12 col-md-6 my-3">
<a href="#overview">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Overview</span>
<span
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">Learn
more about this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36" />
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#features">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Features</span>
<span
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View
features of this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36" />
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#screenshots">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Screenshots</span>
<span
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View
screenshots for this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36" />
</div>
</a>
</div>
</div>
<!-- END OF NAVIGATION SECTION -->
<!-- OVERVIEW SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="overview">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pie-chart.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Overview
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 py-4">
With the help of this App you can easily load product image from URL and Path just by pasting url in the field.
You can also use image URL and Path in the time of importing product.
</div>
</div>
<!-- END OF OVERVIEW SECTION -->
<!-- FEATURES SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="features">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/features.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Features
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 40px; margin-bottom: 40px">
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Load image in product using URL in product view itself.</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Import Product image from path and URL.</span>
</div>
</div>
</div>
<!-- END OF FEATURES SECTION -->
<!-- SCREENSHOTS SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="screenshots">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pictures.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Screenshots
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Paste image URL in the view or Path.</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">The image will change when the record gets saved.</p>
<img src="assets/screenshots/1.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Choose the type of file to import products.</h3>
<img src="assets/screenshots/3.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Importing product from CSV file.</h3>
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">You can use both URL and path for importing image.</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">The fields in the file must need to be in the following format.</p>
<img src="assets/screenshots/4.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Importing product from xlsx file.</h3>
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">You can use both URL and path for importing image.</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">The fields in the file must need to be in the following format.</p>
<img src="assets/screenshots/6.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">The products details with image will be imported.</h3>
<img src="assets/screenshots/5.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">(The example format for csv and xlsx are added in the module.)</h3>
</div>
</div>
</div>
<!-- END OF SCREENSHOTS SECTION -->
<!-- RELATED PRODUCTS -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/categories.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Related
Products
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner" style="padding: 30px;">
<div class="carousel-item" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/dynamic_accounts_report/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/custom_gantt_view/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/project_custom_gantt/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/3.png">
</div>
</a>
</div>
</div>
<div class="carousel-item active" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/account_reports_xlsx/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/base_accounting_kit/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/5.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hr_payroll_community/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/6.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev" style="width:35px; color:#000"> <span
class="carousel-control-prev-icon"><i class="fa fa-chevron-left" style="font-size:24px"></i></span>
</a> <a class="carousel-control-next" href="#demo1" data-slide="next" style="width:35px; color:#000">
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF RELATED PRODUCTS -->
<!-- OUR SERVICES -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/star.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our Services
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire
Odoo
Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</div>
<!-- END OF END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/corporate.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our
Industries
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/trading-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/pos-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/education-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/ecom-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/service-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/restaurant-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/hotel-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</div>
<!-- END OF END OF OUR INDUSTRIES -->
<!-- SUPPORT -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/customer-support.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Support
</h2>
</div>
<div class="container mt-5">
<div class="row">
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4"
style="background-color: #714B67; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="assets/misc/support.png" height="48" width="48" style="width: 42px; height: 42px;" />
</div>
<div>
<h4>Need Help?</h4>
<p style="line-height: 100%;">Got questions or need help? Get in touch.</p>
<a href="mailto:odoo@cybrosys.com">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">
odoo@cybrosys.com</p>
</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4"
style="background-color: #2AC44D; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="assets/misc/whatsapp.png" height="52" width="52" style="width: 52px; height: 52px;" />
</div>
<div>
<h4>WhatsApp</h4>
<p style="line-height: 100%;">Say hi to us on WhatsApp!</p>
<a href="https://api.whatsapp.com/send?phone=918606827707">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">+91 86068
27707</p>
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center">
<img src="assets/misc/logo.png" width="144" height="31"
style="width:144px; height: 31px; margin-top: 40px;" />
</div>
</div>
</div>
<!-- END OF SUPPORT -->

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--Add image url field in product.product model-->
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.product.only.form.view.inherit.product.import</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_title')]" position="after">
<label for="image_url"/>
<field name="image_url" placeholder="Image URL/Path"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--Add image url field in product.template model-->
<record id="product_template_only_form_view" model="ir.ui.view">
<field name="name">product.template.only.form.view.inherit.product.import</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="//div[hasclass('oe_title')]" position="after">
<label for="image_url"/>
<field name="image_url" placeholder="Image URL/Path"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import product_import

View file

@ -0,0 +1,128 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Mohammed Shahil MP @cybrosys(odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import base64
import binascii
import tempfile
import certifi
import urllib3
import xlrd
from odoo.exceptions import ValidationError
from odoo import models, fields, _
class ProductImport(models.Model):
"""Model to import the product"""
_name = 'product.import'
_description = 'Product Import'
file = fields.Binary(string="Upload File")
file_name = fields.Char(string="File Name")
option = fields.Selection([('csv', 'CSV'), ('xlsx', 'XLSX')],
default='csv')
def import_file(self):
"""Function to import product details from csv and xlsx file """
if self.option == 'csv':
try:
product_temp_data = self.env['product.template'].search([])
file = base64.b64decode(self.file)
file_string = file.decode('utf-8')
file_string = file_string.split('\n')
http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where())
except Exception:
raise ValidationError(_("Please choose the correct file!"))
firstline = True
for file_item in file_string:
if firstline:
firstline = False
continue
product_temp = self.env['product.template'].search(
[('name', '=', file_item.split(",")[0])], limit=0)
if not product_temp.id:
file_parts = file_item.split(",")
if len(file_parts) >= 5:
name, detailed_type, barcode, list_price, file_path_or_url = file_parts[:5]
product_name = {
'name': name,
'detailed_type': detailed_type,
'barcode': barcode,
'list_price': list_price,
}
if (file_path_or_url.startswith("http://") or
file_path_or_url.startswith("https://")):
image_response = http.request('GET',
file_path_or_url)
image_thumbnail = base64.b64encode(
image_response.data)
product_name['image_1920'] = image_thumbnail
elif file_path_or_url.startswith('/home'):
with open(file_path_or_url, 'rb') as file:
data = base64.b64encode(file.read())
product_name['image_1920'] = data
product_temp_data.create(product_name)
else:
raise ValidationError(
_("Add the product which is not available in products")
)
elif self.option == 'xlsx':
try:
product_temp_data = self.env['product.template']
file_string = tempfile.NamedTemporaryFile(suffix=".xlsx")
file_string.write(binascii.a2b_base64(self.file))
book = xlrd.open_workbook(file_string.name)
sheet = book.sheet_by_index(0)
http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where())
except:
raise ValidationError(_("Please choose the correct file"))
startline = True
for i in range(sheet.nrows):
if startline:
startline = False
else:
line = list(sheet.row_values(i))
product_temp = self.env['product.template'].search(
[('name', '=', line[0])], limit=0)
if product_temp.id:
raise ValidationError(
_("Add the product which is not available in"
" products"))
if line[0]:
if "http://" in line[4] or "https://" in line[4]:
link = line[4]
image_response = http.request('GET', link)
image_thumbnail = base64.b64encode(
image_response.data)
elif "/home" in line[4]:
with open(line[4], 'rb') as file:
image_thumbnail = base64.b64encode(file.read())
else:
image_thumbnail = False # or None
product_name = {
'name': line[0],
'detailed_type': line[1],
'barcode': line[2],
'list_price': line[3],
'image_1920': image_thumbnail,
}
product_temp_data.create(product_name)

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Product import form view-->
<record id="product_import_view_form" model="ir.ui.view">
<field name="name">product.import.view.form</field>
<field name="model">product.import</field>
<field name="arch" type="xml">
<form string="Product Options">
<group col="4">
<field name="file"/>
<field name="option" widget="radio"/>
</group>
<footer>
<button name="import_file" string="Import" type="object" default_focus="1" class="oe_highlight"/>
<button string="Cancel" class="btn btn-default" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- Product import action to open a wizard-->
<record id="product_import_action" model="ir.actions.act_window">
<field name="name">Import Product</field>
<field name="res_model">product.import</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="product_import_view_form"/>
<field name="context">{}</field>
<field name="target">new</field>
</record>
<!-- Menu-item to import product through csv or xlsx-->
<menuitem id="menu_product_import"
name="Import Product"
action="product_import_action"
parent="sale.product_menu_catalog"/>
</odoo>