Browse Source

Nov 4 : [ADD] Initial Commit 'insta_feed_snippet'

pull/221/merge
AjmalCybro 3 years ago
parent
commit
3b59b93216
  1. 45
      insta_feed_snippet/README.rst
  2. 2
      insta_feed_snippet/__init__.py
  3. 51
      insta_feed_snippet/__manifest__.py
  4. 1
      insta_feed_snippet/controllers/__init__.py
  5. 29
      insta_feed_snippet/controllers/main.py
  6. 2
      insta_feed_snippet/models/__init__.py
  7. 27
      insta_feed_snippet/models/insta_post.py
  8. 81
      insta_feed_snippet/models/insta_profile.py
  9. 4
      insta_feed_snippet/security/ir.model.access.csv
  10. BIN
      insta_feed_snippet/static/description/assets/icons/insta_feed_snippet_icon.png
  11. BIN
      insta_feed_snippet/static/description/assets/misc/categories.png
  12. BIN
      insta_feed_snippet/static/description/assets/misc/check-box.png
  13. BIN
      insta_feed_snippet/static/description/assets/misc/compass.png
  14. BIN
      insta_feed_snippet/static/description/assets/misc/corporate.png
  15. BIN
      insta_feed_snippet/static/description/assets/misc/customer-support.png
  16. BIN
      insta_feed_snippet/static/description/assets/misc/cybrosys-logo.png
  17. BIN
      insta_feed_snippet/static/description/assets/misc/features.png
  18. BIN
      insta_feed_snippet/static/description/assets/misc/logo.png
  19. BIN
      insta_feed_snippet/static/description/assets/misc/pictures.png
  20. BIN
      insta_feed_snippet/static/description/assets/misc/pie-chart.png
  21. BIN
      insta_feed_snippet/static/description/assets/misc/right-arrow.png
  22. BIN
      insta_feed_snippet/static/description/assets/misc/star.png
  23. BIN
      insta_feed_snippet/static/description/assets/misc/support.png
  24. BIN
      insta_feed_snippet/static/description/assets/misc/whatsapp.png
  25. BIN
      insta_feed_snippet/static/description/assets/modules/1.png
  26. BIN
      insta_feed_snippet/static/description/assets/modules/2.png
  27. BIN
      insta_feed_snippet/static/description/assets/modules/3.png
  28. BIN
      insta_feed_snippet/static/description/assets/modules/4.png
  29. BIN
      insta_feed_snippet/static/description/assets/modules/5.gif
  30. BIN
      insta_feed_snippet/static/description/assets/modules/6.png
  31. BIN
      insta_feed_snippet/static/description/assets/screenshots/hero.gif
  32. BIN
      insta_feed_snippet/static/description/assets/screenshots/screenshot-1.png
  33. BIN
      insta_feed_snippet/static/description/assets/screenshots/screenshot-2.png
  34. BIN
      insta_feed_snippet/static/description/assets/screenshots/screenshot-3.png
  35. BIN
      insta_feed_snippet/static/description/assets/screenshots/screenshot-4.png
  36. BIN
      insta_feed_snippet/static/description/assets/screenshots/screenshot-5.png
  37. BIN
      insta_feed_snippet/static/description/banner.png
  38. BIN
      insta_feed_snippet/static/description/icon.png
  39. 574
      insta_feed_snippet/static/description/index.html
  40. 0
      insta_feed_snippet/static/src/css/owl.carousel.min.css
  41. 6
      insta_feed_snippet/static/src/css/owl.theme.default.min.css
  42. 0
      insta_feed_snippet/static/src/image/carousel.png
  43. 21
      insta_feed_snippet/static/src/js/caroursel.js
  44. 34
      insta_feed_snippet/static/src/js/custom.js
  45. 74
      insta_feed_snippet/views/insta_post.xml
  46. 49
      insta_feed_snippet/views/insta_profile.xml
  47. 84
      insta_feed_snippet/views/snippet_structure_inherit.xml
  48. 27
      insta_feed_snippet/views/website.xml

45
insta_feed_snippet/README.rst

@ -0,0 +1,45 @@
.. 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
Insta Feed Snippet
===================================================
Insta Feed Snippet
Installation
============
- www.odoo.com/documentation/15.0/setup/install.html
- Install our custom addon
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer:
vishnu@cybrosys.info
Version 16.0.0.0.0:
Contacts
--------
* Mail Contact : odoo@cybrosys.com
Bug Tracker
-----------
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Maintainer
==========
.. 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>`__

2
insta_feed_snippet/__init__.py

@ -0,0 +1,2 @@
from . import models
from . import controllers

51
insta_feed_snippet/__manifest__.py

@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2022-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': 'Instagram Feed Snippet',
'version': '16.0.0.0.0',
'summary': 'Instagram Feed Snippet',
'description': """The Odoo Instagram Feed Snippet module provides a feature to add an Instagram feed in Odoo.""",
'category': 'Website',
'author': "Cybrosys Techno Solutions",
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'license': 'LGPL-3',
'depends': ['base', 'product', 'website', 'website_sale', 'sale'],
'data': ['security/ir.model.access.csv',
'views/insta_post.xml',
'views/insta_profile.xml',
'views/snippet_structure_inherit.xml',
'views/website.xml'
],
'demo': [],
'images': ['static/description/banner.png'],
'installable': True,
'application': True,
'auto_install': False,
'assets': {
'web.assets_frontend': [
'/insta_feed_snippet/static/src/image/carousel.jpg',
'insta_feed_snippet/static/src/js/caroursel.js',
],
},
}

1
insta_feed_snippet/controllers/__init__.py

@ -0,0 +1 @@
from . import main

29
insta_feed_snippet/controllers/main.py

@ -0,0 +1,29 @@
from odoo import http
from odoo.http import request
import time
class DashbaordCarousel(http.Controller):
@http.route('/get_dashbaord_carousel', auth="public", type='json')
def get_dashbaord_carousel(self):
events_per_slide = 3
records = request.env['insta.post'].sudo().search(
[])
records_grouped = []
record_list = []
for index, record in enumerate(records, 1):
record_list.append(record)
if index % events_per_slide == 0:
records_grouped.append(record_list)
record_list = []
if any(record_list):
records_grouped.append(record_list)
values = {
"objects": records_grouped,
"events_per_slide": events_per_slide,
"num_slides": len(records_grouped),
"uniqueId": "pc-%d" % int(time.time() * 1000),
}
response = http.Response(
template='insta_feed_snippet.s_carousel_template_items', qcontext=values)
return response.render()

2
insta_feed_snippet/models/__init__.py

@ -0,0 +1,2 @@
from . import insta_profile
from . import insta_post

27
insta_feed_snippet/models/insta_post.py

@ -0,0 +1,27 @@
from odoo import models, fields, api, _
import requests
from odoo.exceptions import UserError
class InstaPost(models.Model):
_name = 'insta.post'
name = fields.Char(string="Media ID")
caption = fields.Char("Caption")
post_image = fields.Binary(string='Post Image', attachment=True)
profile_id = fields.Many2one('insta.profile')
def action_update_post(self, access_token):
url = 'https://graph.facebook.com/v15.0/%s?fields=id,caption,comments_count,is_comment_enabled,like_count,media_product_type,media_type,media_url,owner,permalink,thumbnail_url,timestamp,username&access_token=%s' % (
self.name, access_token)
media_content = requests.get(url, timeout=5).json()
if not media_content.get('error'):
if media_content.get('caption'):
self.write({
'caption': media_content['caption'],
})
else:
raise UserError(_('%s', media_content['error']['message']))

81
insta_feed_snippet/models/insta_profile.py

@ -0,0 +1,81 @@
import base64
from odoo import models, fields, api, _
import requests
from odoo.exceptions import UserError
class InstaProfile(models.Model):
_name = 'insta.profile'
name = fields.Char(string="Name", readonly=True)
access_token = fields.Char("Access Token")
username = fields.Char('Username', readonly=True)
account_id = fields.Char('Account ID', readonly=True)
profile_image_url = fields.Binary(attachment=True)
def action_fetch(self):
url = 'https://graph.facebook.com/v15.0/me/accounts?access_token=%s' % self.access_token
page = requests.get(url)
page_content = page.json()
if not page_content.get('error'):
if page_content['data'][0]['id']:
url = 'https://graph.facebook.com/v14.0/%s?fields=instagram_business_account&access_token=%s' % (
page_content['data'][0]['id'], self.access_token)
business_account = requests.get(url)
instagram_business_account = business_account.json()['instagram_business_account']['id']
url = 'https://graph.facebook.com/v15.0/%s?fields=name,username,biography,website,followers_count,follows_count,media_count,profile_picture_url&access_token=%s' % (
instagram_business_account, self.access_token)
val = requests.get(url)
content = val.json()
if content.get('name'):
self.name = content['name']
if content.get('username'):
self.username = content['username']
if content.get('id'):
self.account_id = content['id']
if content.get('profile_picture_url'):
img = base64.b64encode(requests.get(content['profile_picture_url']).content)
self.profile_image_url = img
else:
raise UserError(_('%s', page_content['error']['message']))
def action_get_post(self):
url = 'https://graph.facebook.com/v15.0/%s/media?access_token=%s' % (self.account_id, self.access_token)
content = requests.get(url, timeout=5).json()
if not content.get('error'):
post_list = []
records = self.env['insta.post'].search([])
for post in records:
post_list.append(post.name)
if content.get('data'):
for vals in content['data']:
if vals['id'] not in post_list:
url = 'https://graph.facebook.com/v14.0/%s?fields=id,caption,comments_count,is_comment_enabled,like_count,media_product_type,media_type,media_url,owner,permalink,thumbnail_url,timestamp,username&access_token=%s' % (
vals['id'], self.access_token)
media_content = requests.get(url, timeout=5).json()
if media_content.get('media_type'):
if media_content['media_type'] == 'IMAGE':
res = self.env['insta.post'].create({
'name': media_content['id'],
'profile_id':self.id,
})
image_data = base64.b64encode(requests.get(media_content['media_url']).content)
res.write({
'post_image': image_data,
})
if media_content.get('caption'):
res.write({
'caption': media_content['caption'],
})
else:
record = self.env['insta.post'].search([('name', '=', vals['id'])])
record.action_update_post(self.access_token)
else:
raise UserError(_('%s', content['error']['message']))

4
insta_feed_snippet/security/ir.model.access.csv

@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
insta_profile_id,insta.profile.name,model_insta_profile,,1,1,1,1
insta_post_id,insta.post.name,model_insta_post,,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 insta_profile_id insta.profile.name model_insta_profile 1 1 1 1
3 insta_post_id insta.post.name model_insta_post 1 1 1 1

BIN
insta_feed_snippet/static/description/assets/icons/insta_feed_snippet_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
insta_feed_snippet/static/description/assets/misc/categories.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
insta_feed_snippet/static/description/assets/misc/check-box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
insta_feed_snippet/static/description/assets/misc/compass.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
insta_feed_snippet/static/description/assets/misc/corporate.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
insta_feed_snippet/static/description/assets/misc/customer-support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
insta_feed_snippet/static/description/assets/misc/cybrosys-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
insta_feed_snippet/static/description/assets/misc/features.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
insta_feed_snippet/static/description/assets/misc/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
insta_feed_snippet/static/description/assets/misc/pictures.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
insta_feed_snippet/static/description/assets/misc/pie-chart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
insta_feed_snippet/static/description/assets/misc/right-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

BIN
insta_feed_snippet/static/description/assets/misc/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
insta_feed_snippet/static/description/assets/misc/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
insta_feed_snippet/static/description/assets/misc/whatsapp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
insta_feed_snippet/static/description/assets/modules/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
insta_feed_snippet/static/description/assets/modules/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
insta_feed_snippet/static/description/assets/modules/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
insta_feed_snippet/static/description/assets/modules/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
insta_feed_snippet/static/description/assets/modules/5.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
insta_feed_snippet/static/description/assets/modules/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
insta_feed_snippet/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

BIN
insta_feed_snippet/static/description/assets/screenshots/screenshot-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
insta_feed_snippet/static/description/assets/screenshots/screenshot-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
insta_feed_snippet/static/description/assets/screenshots/screenshot-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
insta_feed_snippet/static/description/assets/screenshots/screenshot-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
insta_feed_snippet/static/description/assets/screenshots/screenshot-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

BIN
insta_feed_snippet/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
insta_feed_snippet/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

574
insta_feed_snippet/static/description/index.html

@ -0,0 +1,574 @@
<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;">Instagram
Odoo Snippet</h1>
<!-- 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">
As we all know, Instagram is one of the most used and popular social networking sites all over the world. With
approx. 1 billion monthly active users on Instagram, it is a perfect way to reach out to potential users easily.
Adding your Instagram profile option on your Odoo website enables you to promote your website products on
Instagram. The Odoo Instagram Feed Snippet module provides a feature to add an Instagram feed in Odoo.
</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-start" style="margin-top: 40px; margin-bottom: 40px">
<img src="/assets/misc/check-box.png" class="mr-2"/>
<div>
<span
style="display: block; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">The Odoo Instagram Feed Snippet module provides a feature to add an Instagram feed in Odoo.</span>
</div>
</div>
<div class="d-flex align-items-start" style="margin-top: 30px; margin-bottom: 30px">
<img src="/assets/misc/check-box.png" class="mr-2"/>
<div>
<span
style="display: block; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Provides easy and Simple configuration.</span>
</div>
</div>
<div class="d-flex align-items-start" style="margin-top: 30px; margin-bottom: 30px">
<img src="/assets/misc/check-box.png" class="mr-2"/>
<div>
<span
style="display: block; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">You can simply drag and drop Instagram snippets on any page of your website to show your Instagram feed.</span>
</div>
</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;">Website Backend</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Once the installation
is completed, visit the Odoo website app from the backend. Here, click on Configuration>>Instagram.You
can set up your instagram profile by adding access key and click fetch account button.Once the profile
is generated click the fetch post button to fetch instagram post into odoo</p>
<img src="./assets/screenshots/screenshot-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;"></h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Goto the Site menu of
website to see the instagram posts.</p>
<img src="./assets/screenshots/screenshot-2.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;"></h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">You can see the
instagram post here.</p>
<img src="./assets/screenshots/screenshot-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;">Website Frontend</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Visit the
Odoo websitefrontend and click on the Edit option.After that, select the Instagram widget and drag it
to the place where you want to showcase it on your Odoo website frontend, and click on the Save
button.</p>
<img src="./assets/screenshots/screenshot-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;">
goes here</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">After that, once you
save it, the Instagram widget will let you show your Instagram feed on your Odoo website as shown
below.</p>
<img src="./assets/screenshots/screenshot-5.png" class="img-thumbnail">
</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="//apps.odoocdn.com/apps/assets/15.0/account_day_book/assets/modules/dynamic_accounts_report.png?3e73b0c">
</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="//apps.odoocdn.com/apps/assets/15.0/account_day_book/assets/modules/custom_gantt_view.png?3e73b0c">
</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="//apps.odoocdn.com/apps/assets/15.0/account_day_book/assets/modules/project_custom_gantt.png?3e73b0c">
</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="//apps.odoocdn.com/apps/assets/15.0/account_day_book/assets/modules/account_reports_xlsx.png?3e73b0c">
</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="//apps.odoocdn.com/apps/assets/15.0/account_day_book/assets/modules/base_accounting_kit.gif?3e73b0c">
</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="//apps.odoocdn.com/apps/assets/15.0/account_day_book/assets/modules/hr_payroll_community.png?3e73b0c">
</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 -->

0
insta_feed_snippet/static/src/css/owl.carousel.min.css

6
insta_feed_snippet/static/src/css/owl.theme.default.min.css

@ -0,0 +1,6 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
.owl-theme .owl-dots,.owl-theme .owl-nav{text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-nav{margin-top:10px}.owl-theme .owl-nav [class*=owl-]{color:#FFF;font-size:14px;margin:5px;padding:4px 7px;background:#D6D6D6;display:inline-block;cursor:pointer;border-radius:3px}.owl-theme .owl-nav [class*=owl-]:hover{background:#869791;color:#FFF;text-decoration:none}.owl-theme .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-nav.disabled+.owl-dots{margin-top:10px}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#D6D6D6;display:block;-webkit-backface-visibility:visible;transition:opacity .2s ease;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#869791}

0
insta_feed_snippet/static/src/image/carousel.png

21
insta_feed_snippet/static/src/js/caroursel.js

@ -0,0 +1,21 @@
odoo.define('insta_feed_snippet.carousel_dashboard', function(require){
'use strict';
var Animation = require('website.content.snippets.animation');
var ajax = require('web.ajax');
Animation.registry.get_dashbaord_carousel = Animation.Class.extend({
selector : '.s_carousel_template',
init: function() {
this._super.apply(this, arguments);
},
start: function(){
console.log("Test");
var self = this;
ajax.jsonRpc('/get_dashbaord_carousel', 'call', {})
.then(function (data) {
if(data){
self.$target.empty().append(data);
}
});
}
});
});

34
insta_feed_snippet/static/src/js/custom.js

@ -0,0 +1,34 @@
<script>
$(document).ready(function () {
$(".owl-theme2").owlCarousel(
{
items: 3,
loop: true,
margin: 40,
stagePadding: 0,
smartSpeed: 450,
autoplay: false,
autoPlaySpeed: 3000,
autoPlayTimeout: 1000,
autoplayHoverPause: true,
dots: false,
nav: false,
responsive: {
0: {
items: 1,
nav: false
},
600: {
items: 2,
nav: false
},
1000: {
items: 3,
nav: true,
loop: false
}
}
}
);
});
</script>

74
insta_feed_snippet/views/insta_post.xml

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="instagram_post_view_kanban" model="ir.ui.view">
<field name="name">insta.post.kanban</field>
<field name="model">insta.post</field>
<field name="arch" type="xml">
<kanban sample="1" create="false">
<field name="caption"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_image mr-1">
<field name="post_image" widget="image" class="o_image_64_contain"/>
</div>
<div class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="caption"/>
</strong>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="instagram_post_view_form" model="ir.ui.view">
<field name="name">insta.post.form</field>
<field name="model">insta.post</field>
<field name="arch" type="xml">
<form create="false" edit="false">
<sheet clas="bg-primary">
<div class="row o_website_sale_image_modal" style="display:flex;justify-content: center;">
<div class="col-md-6 col-xl-5">
<h2>
<field name="name" invisible="1"/>
<field name="profile_id" invisible="1"/>
<field name="caption" style="word-break: break-all;"/>
<field name="post_image" widget="image"/>
</h2>
</div>
</div>
</sheet>
</form>
</field>
</record>
<record id="instagram_post_view_list" model="ir.ui.view">
<field name="name">insta.post.tree</field>
<field name="model">insta.post</field>
<field name="arch" type="xml">
<tree create="false" edit="false">
<field name="name"/>
</tree>
</field>
</record>
<record id="insta_post_search" model="ir.ui.view">
<field name="name">insta.post.search</field>
<field name="model">insta.post</field>
<field name="arch" type="xml">
<search>
<field name="caption"/>
</search>
</field>
</record>
</odoo>

49
insta_feed_snippet/views/insta_profile.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="instagram_profile_settings_form" model="ir.ui.view">
<field name="name">insta.profile.form</field>
<field name="model">insta.profile</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_fetch" string="Fetch Account" type="object" class="oe_stat_button"
icon="fa-instagram"/>
<button name="action_get_post" string="Fetch Posts" type="object" class="oe_stat_button"
attrs="{'invisible': [('username', '=', False)]}"
icon="fa-save"/>
</div>
<field name="profile_image_url" widget="image" class="oe_avatar"/>
<div class="oe_title">
<h1>
<field name="name" widget="text"/>
</h1>
</div>
<div>
<group>
<field name="access_token" password="True" style="width:600px;word-break: break-all;"/>
<field name="username"/>
<field name="account_id"/>
</group>
</div>
</sheet>
</form>
</field>
</record>
<record id="instagram_profile_settings_list" model="ir.ui.view">
<field name="name">insta.profile.form</field>
<field name="model">insta.profile</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="username"/>
</tree>
</field>
</record>
</odoo>

84
insta_feed_snippet/views/snippet_structure_inherit.xml

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="carousal_dashboard" inherit_id="website.snippets"
name="Caroudal Dashboard">
<xpath expr="//div[@id='snippet_effect']/div[hasclass('o_panel_body')]"
position="inside">
<t t-snippet="insta_feed_snippet.s_carousel_template"
t-thumbnail="/insta_feed_snippet/static/src/image/carousel.png"/>
</xpath>
</template>
<template id="s_carousel_template" name="Insta Feed">
<section class="s_carousel_template pt24 pb24">
<div class="container">
</div>
</section>
</template>
<template id="s_carousel_inner_items" name="Header Image Footer Card">
<div class="container">
<h3 class="text-center mb32">Follow Us On Instagram</h3>
<div class="row"
style="float: left; padding: 10px; height: 400px; width:100%;">
<t t-foreach="latest_products" t-as="product">
<div t-attf-class="d-flex col-12 col-sm-6 col-md-#{int(12 / events_per_slide)}">
<ul>
<a t-attf-href="https://www.instagram.com/{{product.profile_id.username}}/">
<div class="wrapper">
<div class="img_wrapper">
<div class="row align-items-start">
<div class="col"
style="height: 150px;">
<img class="img-fluid"
loading="lazy"
style="height: 304px; width:255px;max-width:none;"
t-attf-src="data:image/jpg;base64,{{ product.post_image }}"/>
</div>
</div>
</div>
</div>
</a>
</ul>
</div>
</t>
</div>
</div>
</template>
<template id="s_carousel_template_items">
<div class="container">
<div class="products_carousel_slider oe_website_events">
<input type="hidden" name="products_count" t-if="objects"
t-att-value="len(objects)"/>
<div t-att-id="uniqueId" class="carousel slide d-flex"
data-ride="carousel">
<a class="carousel-control-prev o_not_editable" contenteditable="false"
t-att-href="'#' + uniqueId" data-bs-slide="prev" role="button" aria-label="Previous"
title="Previous">
<span class="carousel-control-prev-icon"/>
<span class="visually-hidden">Previous</span>
</a>
<div class="carousel-inner">
<t t-foreach="objects" t-as="latest_products">
<div t-attf-class="carousel-item #{'' if latest_products_index else 'active'}">
<div>
<t t-call="insta_feed_snippet.s_carousel_inner_items"/>
</div>
</div>
</t>
</div>
<a class="carousel-control-next o_not_editable" contenteditable="false"
t-att-href="'#' + uniqueId" data-bs-slide="next" role="button" aria-label="Next" title="Next">
<span class="carousel-control-next-icon"/>
<span class="visually-hidden">Next</span>
</a>
</div>
</div>
</div>
</template>
</odoo>

27
insta_feed_snippet/views/website.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="action_insta_posts" model="ir.actions.act_window">
<field name="name">Instagram Posts</field>
<field name="res_model">insta.post</field>
<field name="view_mode">kanban,tree,form</field>
</record>
<menuitem id="insta_posts"
name="INSTAGRAM"
sequence="10"
action="action_insta_posts"
parent="website.menu_site"/>
<record id="action_website_insta_profile" model="ir.actions.act_window">
<field name="name">Insta profile</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">kanban,tree,form</field>
<field name="res_model">insta.profile</field>
</record>
<menuitem
id="web_insta_details"
name="Instagram"
sequence="30"
action="action_website_insta_profile"
parent="website.menu_website_global_configuration"
/>
</odoo>
Loading…
Cancel
Save