Browse Source

May 03 : [ADD] Initial Commit 'index_and_follow'

dependabot/npm_and_yarn/odoo_website_helpdesk/static/src/cdn/minimist-1.2.8
Sayooj 2 years ago
parent
commit
4787fd3c9c
  1. 44
      index_and_follow/README.rst
  2. 23
      index_and_follow/__init__.py
  3. 47
      index_and_follow/__manifest__.py
  4. 22
      index_and_follow/controllers/__init__.py
  5. 54
      index_and_follow/controllers/website.py
  6. 7
      index_and_follow/doc/RELEASE_NOTES.md
  7. 22
      index_and_follow/models/__init__.py
  8. 30
      index_and_follow/models/product_template.py
  9. BIN
      index_and_follow/static/description/assets/cybro-icon.png
  10. BIN
      index_and_follow/static/description/assets/cybro-odoo.png
  11. BIN
      index_and_follow/static/description/assets/icons/1-icon.png
  12. BIN
      index_and_follow/static/description/assets/icons/2-icon.png
  13. BIN
      index_and_follow/static/description/assets/icons/3-icon.png
  14. BIN
      index_and_follow/static/description/assets/icons/4-icon.png
  15. BIN
      index_and_follow/static/description/assets/icons/5-icon.png
  16. BIN
      index_and_follow/static/description/assets/icons/6-icon.png
  17. BIN
      index_and_follow/static/description/assets/icons/Hospital Management-icon.png
  18. BIN
      index_and_follow/static/description/assets/icons/check.png
  19. BIN
      index_and_follow/static/description/assets/icons/chevron.png
  20. BIN
      index_and_follow/static/description/assets/icons/cogs.png
  21. BIN
      index_and_follow/static/description/assets/icons/consultation.png
  22. 1
      index_and_follow/static/description/assets/icons/down.svg
  23. BIN
      index_and_follow/static/description/assets/icons/ecom-black.png
  24. BIN
      index_and_follow/static/description/assets/icons/education-black.png
  25. BIN
      index_and_follow/static/description/assets/icons/hotel-black.png
  26. BIN
      index_and_follow/static/description/assets/icons/license.png
  27. BIN
      index_and_follow/static/description/assets/icons/lifebuoy.png
  28. BIN
      index_and_follow/static/description/assets/icons/manufacturing-black.png
  29. BIN
      index_and_follow/static/description/assets/icons/pos-black.png
  30. BIN
      index_and_follow/static/description/assets/icons/puzzle.png
  31. BIN
      index_and_follow/static/description/assets/icons/restaurant-black.png
  32. BIN
      index_and_follow/static/description/assets/icons/service-black.png
  33. BIN
      index_and_follow/static/description/assets/icons/support.png
  34. BIN
      index_and_follow/static/description/assets/icons/trading-black.png
  35. BIN
      index_and_follow/static/description/assets/icons/training.png
  36. BIN
      index_and_follow/static/description/assets/icons/update.png
  37. BIN
      index_and_follow/static/description/assets/icons/user.png
  38. BIN
      index_and_follow/static/description/assets/icons/whatsapp.png
  39. BIN
      index_and_follow/static/description/assets/icons/wrench.png
  40. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot1.png
  41. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot2.png
  42. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot3.png
  43. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot4.png
  44. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot5.png
  45. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot6.png
  46. BIN
      index_and_follow/static/description/assets/screenshots/Screenshot7.png
  47. BIN
      index_and_follow/static/description/assets/y18.jpg
  48. BIN
      index_and_follow/static/description/banner.png
  49. BIN
      index_and_follow/static/description/icon.png
  50. 1447
      index_and_follow/static/description/index.html
  51. 41
      index_and_follow/static/src/js/website.js
  52. 12
      index_and_follow/views/source_views.xml
  53. 14
      index_and_follow/views/website_views.xml

44
index_and_follow/README.rst

@ -0,0 +1,44 @@
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
Website Index and Follow
=======================
This module lets you specify whether or not a particular page should be indexed.
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
Developer: Ayisha Sumayya K @cybrosys, Contact: odoo@cybrosys.com
License
-------
General Public License, Version 3 (LGPL v3).
(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html)
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>`__

23
index_and_follow/__init__.py

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

47
index_and_follow/__manifest__.py

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Ayisha Sumayya K (odoo@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': 'Website Index and Follow',
'version': '16.0.1.0.0',
'category': 'Website/Website',
'summary': """Website Index and Follow Application for Odoo 16""",
'description': """The module helps you to specify product-level
indexing.""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['website_sale'],
'data': [
'views/source_views.xml',
'views/website_views.xml',
],
'assets': {
'web.assets_frontend': [
'index_and_follow/static/src/js/website.js', ],
},
'images': ['static/description/banner.png', ],
'license': 'LGPL-3',
'auto_install': False,
'installable': True,
'application': False
}

22
index_and_follow/controllers/__init__.py

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

54
index_and_follow/controllers/website.py

@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Ayisha Sumayya K (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import http
from odoo.http import request
from odoo.addons.website_sale.controllers.main import WebsiteSale
class WebIndexJson(http.Controller):
""" controller for website index and follow """
@http.route('/web_index', type='json', auth='user')
def web_index(self, index, product):
""" route for index """
product_rec = request.env['product.template'].browse(int(product))
if index:
product_rec.is_index = True
else:
product_rec.is_index = False
class WebIndex(WebsiteSale):
""" class for website_sale """
def _prepare_product_values(self, product, category, search, **kwargs):
""" function for access user along with product """
res = super(WebIndex, self)._prepare_product_values(product, category,
search)
res.update({
'page_index': product.is_index,
'product_rec': product,
'user': request.env.user.has_group('base.group_user')
})
return res

7
index_and_follow/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <index_and_follow>
#### 18.02.2023
#### Version 16.0.1.0.0
#### ADD
- Initial commit for Website Index and Follow

22
index_and_follow/models/__init__.py

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

30
index_and_follow/models/product_template.py

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Ayisha Sumayya K (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models
class ProductTemplate(models.Model):
""" class for adding a field in product """
_inherit = "product.template"
is_index = fields.Boolean(default=True)

BIN
index_and_follow/static/description/assets/cybro-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
index_and_follow/static/description/assets/cybro-odoo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
index_and_follow/static/description/assets/icons/1-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
index_and_follow/static/description/assets/icons/2-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
index_and_follow/static/description/assets/icons/3-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
index_and_follow/static/description/assets/icons/4-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
index_and_follow/static/description/assets/icons/5-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
index_and_follow/static/description/assets/icons/6-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
index_and_follow/static/description/assets/icons/Hospital Management-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
index_and_follow/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
index_and_follow/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
index_and_follow/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
index_and_follow/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

1
index_and_follow/static/description/assets/icons/down.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" width="512" height="512" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><g id="Layer_2" data-name="Layer 2"><path d="m12 1a11 11 0 1 0 11 11 11.013 11.013 0 0 0 -11-11zm5.707 9.707-5 5a1 1 0 0 1 -1.414 0l-5-5a1 1 0 0 1 1.414-1.414l4.293 4.293 4.293-4.293a1 1 0 0 1 1.414 1.414z" fill="#781d96" data-original="#000000" class=""></path></g></g></svg>

After

Width:  |  Height:  |  Size: 542 B

BIN
index_and_follow/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
index_and_follow/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
index_and_follow/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
index_and_follow/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
index_and_follow/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
index_and_follow/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
index_and_follow/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
index_and_follow/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
index_and_follow/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
index_and_follow/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
index_and_follow/static/description/assets/icons/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
index_and_follow/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
index_and_follow/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
index_and_follow/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
index_and_follow/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
index_and_follow/static/description/assets/icons/whatsapp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
index_and_follow/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 KiB

BIN
index_and_follow/static/description/assets/screenshots/Screenshot7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

BIN
index_and_follow/static/description/assets/y18.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 KiB

BIN
index_and_follow/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
index_and_follow/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

1447
index_and_follow/static/description/index.html

File diff suppressed because it is too large

41
index_and_follow/static/src/js/website.js

@ -0,0 +1,41 @@
odoo.define('index_and_follow.index', function (require) {
'use strict';
var ajax = require('web.ajax');
var publicWidget = require('web.public.widget');
publicWidget.registry.IndexAndFollow = publicWidget.Widget.extend({
selector: '#product_detail_main',
events: {
'change .is_index': '_setProductIndex',
},
_setProductIndex: function(event){
//function to set product index
var product = this.el.querySelector('.product').value;
if (event.target.checked == true){
/*check index input is checked, if input is checked, it sends an AJAX request
to the server to set the product's indexing status to true.*/
this.el.querySelector('.is_index').checked = true;
ajax.jsonRpc('/web_index', 'call',{
'index': true,
'product': product,
}).then(function(){
location.reload();
});
}
else{
//input is unchecked, it sends an AJAX request to set the status to false.
ajax.jsonRpc('/web_index', 'call',{
'index': false,
'product': product,
}).then(function(){
location.reload();
});
}
},
});
return publicWidget.registry.IndexAndFollow;
});

12
index_and_follow/views/source_views.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Inherited the portal front layout for meta-tag -->
<template id="index_follow" inherit_id="portal.frontend_layout" name="Index and Follow">
<xpath expr="//head/meta[last()]" position="after">
<meta t-if="page_index" name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'/>
<meta t-if="not page_index" name='robots' content="noindex, nofollow"/>
</xpath>
</template>
</odoo>

14
index_and_follow/views/website_views.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!--Inherited website_sales product template for adding the is_index check box -->
<template id="website_index" inherit_id="website_sale.product" name="Web Index" customize_show="True">
<xpath expr="//div[@id='o_wsale_cta_wrapper']" position="before">
<t t-if="user">
<input type="checkbox" t-att-checked="product.is_index" id="is_index" class="is_index"/>
<span><b>Is Indexed</b></span><br/>
<input type="hidden" class="product" t-att-value="product.id"/>
</t>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save