diff --git a/sale_product_image/README.rst b/sale_product_image/README.rst new file mode 100644 index 000000000..5b25e806d --- /dev/null +++ b/sale_product_image/README.rst @@ -0,0 +1,44 @@ +Sale Order Line Images +====================== +Order Line Images In Sale + +Installation +============ + - www.odoo.com/documentation/13.0/setup/install.html + - Install our custom addon + +Configuration +============= + + - No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: Anusha @ Cybrosys + +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 `__ + +Further information +=================== +HTML Description: ``__ + diff --git a/sale_product_image/__init__.py b/sale_product_image/__init__.py new file mode 100644 index 000000000..9d876ea62 --- /dev/null +++ b/sale_product_image/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +from . import models diff --git a/sale_product_image/__manifest__.py b/sale_product_image/__manifest__.py new file mode 100644 index 000000000..d7a0bcec0 --- /dev/null +++ b/sale_product_image/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +{ + "name": "Sale Order Line Images", + "summary": "Order Line Images In Sale and Sale Report", + "version": "13.0.1.0.0", + "category": 'Sales', + "website": "https://www.cybrosys.com", + "description": """Order Line Images In Sale and Sale Report, odoo 13, order line images""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + "depends": [ + 'sale_management', + ], + "data": [ + 'views/sale_order_line_image.xml', + 'views/res_config_settings.xml', + 'report/sale_order_report.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/sale_product_image/doc/RELEASE_NOTES.md b/sale_product_image/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e01bc225c --- /dev/null +++ b/sale_product_image/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 04.01.2020 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for Sale Order Line Images diff --git a/sale_product_image/models/__init__.py b/sale_product_image/models/__init__.py new file mode 100644 index 000000000..ad5d2d650 --- /dev/null +++ b/sale_product_image/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +from . import sale_order_line_image +from . import res_config_settings diff --git a/sale_product_image/models/res_config_settings.py b/sale_product_image/models/res_config_settings.py new file mode 100644 index 000000000..f4eaef7bf --- /dev/null +++ b/sale_product_image/models/res_config_settings.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +from odoo import fields, models, api + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + show_product_image_in_sale_report = fields.Boolean(string="Show Product Image", default=False) + + @api.model + def set_values(self): + self.env['ir.config_parameter'].sudo().set_param('sale_product_image.show_product_image_in_sale_report', + self.show_product_image_in_sale_report) + res = super(ResConfigSettings, self).set_values() + return res + + def get_values(self): + res = super(ResConfigSettings, self).get_values() + param = self.env['ir.config_parameter'].sudo().get_param( + 'sale_product_image.show_product_image_in_sale_report', + self.show_product_image_in_sale_report) + res.update( + show_product_image_in_sale_report=param + ) + return res diff --git a/sale_product_image/models/sale_order_line_image.py b/sale_product_image/models/sale_order_line_image.py new file mode 100644 index 000000000..480f6f0e1 --- /dev/null +++ b/sale_product_image/models/sale_order_line_image.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +from odoo import fields, models + + +class SaleOrderLine(models.Model): + _inherit = 'sale.order.line' + + order_line_image = fields.Binary(string="Image", + related="product_id.image_1920") diff --git a/sale_product_image/report/sale_order_report.xml b/sale_product_image/report/sale_order_report.xml new file mode 100644 index 000000000..91cc4eba1 --- /dev/null +++ b/sale_product_image/report/sale_order_report.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sale_product_image/static/description/banner.png b/sale_product_image/static/description/banner.png new file mode 100644 index 000000000..e8ee71737 Binary files /dev/null and b/sale_product_image/static/description/banner.png differ diff --git a/sale_product_image/static/description/icon.png b/sale_product_image/static/description/icon.png new file mode 100644 index 000000000..efb108c16 Binary files /dev/null and b/sale_product_image/static/description/icon.png differ diff --git a/sale_product_image/static/description/images/banner_barcode_scanning.jpeg b/sale_product_image/static/description/images/banner_barcode_scanning.jpeg new file mode 100644 index 000000000..529143e4e Binary files /dev/null and b/sale_product_image/static/description/images/banner_barcode_scanning.jpeg differ diff --git a/sale_product_image/static/description/images/banner_currency_total.png b/sale_product_image/static/description/images/banner_currency_total.png new file mode 100644 index 000000000..6153ed719 Binary files /dev/null and b/sale_product_image/static/description/images/banner_currency_total.png differ diff --git a/sale_product_image/static/description/images/banner_customer_sequence.jpeg b/sale_product_image/static/description/images/banner_customer_sequence.jpeg new file mode 100644 index 000000000..7451342d6 Binary files /dev/null and b/sale_product_image/static/description/images/banner_customer_sequence.jpeg differ diff --git a/sale_product_image/static/description/images/banner_previous_rates.jpeg b/sale_product_image/static/description/images/banner_previous_rates.jpeg new file mode 100644 index 000000000..e10c28799 Binary files /dev/null and b/sale_product_image/static/description/images/banner_previous_rates.jpeg differ diff --git a/sale_product_image/static/description/images/banner_product_branding.png b/sale_product_image/static/description/images/banner_product_branding.png new file mode 100644 index 000000000..aa12beabb Binary files /dev/null and b/sale_product_image/static/description/images/banner_product_branding.png differ diff --git a/sale_product_image/static/description/images/banner_product_expiry.jpeg b/sale_product_image/static/description/images/banner_product_expiry.jpeg new file mode 100644 index 000000000..84a872d44 Binary files /dev/null and b/sale_product_image/static/description/images/banner_product_expiry.jpeg differ diff --git a/sale_product_image/static/description/images/checked.png b/sale_product_image/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/sale_product_image/static/description/images/checked.png differ diff --git a/sale_product_image/static/description/images/cybrosys.png b/sale_product_image/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/sale_product_image/static/description/images/cybrosys.png differ diff --git a/sale_product_image/static/description/images/sale_order_line_image.png b/sale_product_image/static/description/images/sale_order_line_image.png new file mode 100644 index 000000000..4efb6a009 Binary files /dev/null and b/sale_product_image/static/description/images/sale_order_line_image.png differ diff --git a/sale_product_image/static/description/images/sale_order_line_image1.png b/sale_product_image/static/description/images/sale_order_line_image1.png new file mode 100644 index 000000000..81f183a8e Binary files /dev/null and b/sale_product_image/static/description/images/sale_order_line_image1.png differ diff --git a/sale_product_image/static/description/images/sale_order_line_image2.png b/sale_product_image/static/description/images/sale_order_line_image2.png new file mode 100644 index 000000000..441ee0ad3 Binary files /dev/null and b/sale_product_image/static/description/images/sale_order_line_image2.png differ diff --git a/sale_product_image/static/description/images/sale_order_line_image_3.png b/sale_product_image/static/description/images/sale_order_line_image_3.png new file mode 100644 index 000000000..5ef1feb17 Binary files /dev/null and b/sale_product_image/static/description/images/sale_order_line_image_3.png differ diff --git a/sale_product_image/static/description/index.html b/sale_product_image/static/description/index.html new file mode 100644 index 000000000..7fde243c4 --- /dev/null +++ b/sale_product_image/static/description/index.html @@ -0,0 +1,508 @@ +
+ cybrosys-logo
+
+
+
+

Sale Order Line Images

+

Order Line Image In Sale Order.

+
+

Key Highlights

+
    +
  • check + Product images in order line. +
  • +
  • check + Print product images in report. +
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This app allows you see the product images in sale order line and also allow us + to print the product image in report. +

+
+
+ +

Features

+
+
    +
  • + checkOrder line product images. +
  • +
  • + checkPrint product images in report. +
  • +
  • + checkConfigure the Image printing Option. +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+
+ Odoo Industry
+
+
+

+ + Trading

+

+ Easily procure and sell your products.

+
+
+
+
+
+ Odoo Industry +
+
+
+

+ + Manufacturing

+

+ Plan, track and schedule your operations.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Restaurant

+

+ Run your bar or restaurant methodical.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + POS

+

+ Easy configuring and convivial selling.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + E-commerce & Website

+

+ Mobile friendly, awe-inspiring product pages.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Hotel Management

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Education

+

+ A Collaborative platform for educational management.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + Service Management

+

+ Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

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.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/sale_product_image/views/res_config_settings.xml b/sale_product_image/views/res_config_settings.xml new file mode 100644 index 000000000..4bce0e43f --- /dev/null +++ b/sale_product_image/views/res_config_settings.xml @@ -0,0 +1,23 @@ + + + + res.config.settings.view.form.inherit.sale + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/sale_product_image/views/sale_order_line_image.xml b/sale_product_image/views/sale_order_line_image.xml new file mode 100644 index 000000000..8cb061643 --- /dev/null +++ b/sale_product_image/views/sale_order_line_image.xml @@ -0,0 +1,16 @@ + + + + + sale.order.inherit.form.view + sale.order + + + + + + + + + \ No newline at end of file diff --git a/website_search_blog/README.rst b/website_search_blog/README.rst new file mode 100644 index 000000000..97cb3ea7b --- /dev/null +++ b/website_search_blog/README.rst @@ -0,0 +1,19 @@ +Website Search Blog +=================== +Blog Search Feature in Odoo 13 Website. + + +Features +======== +* Search field in Blog +* Auto Suggestion List +* Search Results from all categories + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Developer V13: Hajaj Roshan @ cybrosys + diff --git a/website_search_blog/__init__.py b/website_search_blog/__init__.py new file mode 100644 index 000000000..a51f607f9 --- /dev/null +++ b/website_search_blog/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import controllers diff --git a/website_search_blog/__manifest__.py b/website_search_blog/__manifest__.py new file mode 100644 index 000000000..50e775b64 --- /dev/null +++ b/website_search_blog/__manifest__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'Website Blog Search', + 'version': '13.0.1.0.0', + "category": "Website", + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'summary': """Blog Search Feature in Website""", + 'description': """Blog Search Feature in Odoo 13 Website""", + 'depends': ['website_blog'], + 'license': 'AGPL-3', + 'data': ['views/templates_blog.xml', + 'views/search_blog.xml', + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/website_search_blog/controllers/__init__.py b/website_search_blog/controllers/__init__.py new file mode 100644 index 000000000..4f92d8273 --- /dev/null +++ b/website_search_blog/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import main diff --git a/website_search_blog/controllers/main.py b/website_search_blog/controllers/main.py new file mode 100644 index 000000000..f0132277d --- /dev/null +++ b/website_search_blog/controllers/main.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +import json + +from odoo.addons.http_routing.models.ir_http import slug, unslug +from odoo.addons.website.controllers.main import QueryURL +from odoo.addons.website_blog.controllers.main import WebsiteBlog + +from odoo import http, fields, SUPERUSER_ID +from odoo.http import request + + +class BlogInherit(WebsiteBlog): + """Override class WebsiteBlog""" + @http.route(['/blog', + '''/blog/''', + '''/blog//page/''', + '''/blog//tag/''', + '''/blog//tag//page/''', + '''/blog/search_content''', + ], type='http', auth="public", website=True, csrf=False) + def blog(self, blog=None, tag=None, page=1, **opt): + """function related to blog display""" + date_begin, date_end, state = opt.get('date_begin'), opt.get('date_end'), opt.get('state') + published_count, unpublished_count = 0, 0 + + domain = request.website.website_domain() + blog_post = request.env['blog.post'] + blogs = request.env['blog.blog'].search(domain, order="create_date asc", limit=2) + # retrocompatibility to accept tag as slug + active_tag_ids = tag and [int(unslug(t)[1]) for t in tag.split(',')] if tag else [] + if active_tag_ids: + fixed_tag_slug = ",".join(slug(t) for t in request.env['blog.tag'].browse(active_tag_ids)) + if fixed_tag_slug != tag: + return request.redirect( + request.httprequest.full_path.replace("/tag/%s/" % tag, "/tag/%s/" % fixed_tag_slug, 1), 301) + domain += [('tag_ids', 'in', active_tag_ids)] + if blog: + domain += [('blog_id', '=', blog.id)] + if date_begin and date_end: + domain += [("post_date", ">=", date_begin), ("post_date", "<=", date_end)] + + if request.env.user.has_group('website.group_website_designer'): + count_domain = domain + [("website_published", "=", True), ("post_date", "<=", fields.Datetime.now())] + published_count = blog_post.search_count(count_domain) + unpublished_count = blog_post.search_count(domain) - published_count + + if state == "published": + domain += [("website_published", "=", True), ("post_date", "<=", fields.Datetime.now())] + elif state == "unpublished": + domain += ['|', ("website_published", "=", False), ("post_date", ">", fields.Datetime.now())] + else: + domain += [("post_date", "<=", fields.Datetime.now())] + + blog_url = QueryURL('', ['blog', 'tag'], blog=blog, tag=tag, date_begin=date_begin, date_end=date_end) + + search_string = opt.get('search', None) + + blog_posts = blog_post.search([('name', 'ilike', search_string)], + offset=(page - 1) * self._blog_post_per_page, + limit=self._blog_post_per_page) if search_string \ + else blog_post.search(domain, + order="post_date desc") + + pager = request.website.pager( + url=request.httprequest.path.partition('/page/')[0], + total=len(blog_posts), + page=page, + step=self._blog_post_per_page, + url_args=opt, + ) + pager_begin = (page - 1) * self._blog_post_per_page + pager_end = page * self._blog_post_per_page + blog_posts = blog_posts[pager_begin:pager_end] + + all_tags = request.env['blog.tag'].search([]) + use_cover = request.website.viewref('website_blog.opt_blog_cover_post').active + fullwidth_cover = request.website.viewref('website_blog.opt_blog_cover_post_fullwidth_design').active + offset = (page - 1) * self._blog_post_per_page + first_post = blog_posts + if not blog: + first_post = blog_posts.search(domain + [('website_published', '=', True)], order="post_date desc, id asc", + limit=1) + if use_cover and not fullwidth_cover: + offset += 1 + + # function to create the string list of tag ids, and toggle a given one. + # used in the 'Tags Cloud' template. + + def tags_list(tag_ids, current_tag): + tag_ids = list(tag_ids) # required to avoid using the same list + if current_tag in tag_ids: + tag_ids.remove(current_tag) + else: + tag_ids.append(current_tag) + tag_ids = request.env['blog.tag'].browse(tag_ids).exists() + return ','.join(slug(tags) for tags in tag_ids) + + tag_category = sorted(all_tags.mapped('category_id'), key=lambda category: category.name.upper()) + other_tags = sorted(all_tags.filtered(lambda x: not x.category_id), key=lambda tags: tags.name.upper()) + values = { + 'blog': blog, + 'blogs': blogs, + 'first_post': first_post.with_prefetch(blog_posts.ids) if not search_string else None, + 'other_tags': other_tags, + 'state_info': {"state": state, "published": published_count, "unpublished": unpublished_count}, + 'active_tag_ids': active_tag_ids, + 'tags_list': tags_list, + 'posts': blog_posts, + 'blog_posts_cover_properties': [json.loads(b.cover_properties) for b in blog_posts], + 'pager': pager, + 'nav_list': self.nav_list(blog), + 'blog_url': blog_url, + 'date': date_begin, + 'tag_category': tag_category, + } + response = request.render("website_blog.blog_post_short", values) + return response + + @http.route('/blog/search', csrf=False, type="http", methods=['POST', 'GET'], auth="public", website=True) + def search_contents(self, **kw): + """get search result for auto suggestions""" + strings = '%' + kw.get('name') + '%' + try: + domain = [('website_published', '=', True)] + blog = request.env['blog.post'].with_user(SUPERUSER_ID).search(domain) + sql = """select id as res_id, name as name, name as value from blog_post where name ILIKE '{}'""" + extra_query = '' + limit = " limit 15" + qry = sql + extra_query + limit + request.cr.execute(qry.format(strings, tuple(blog and blog.ids))) + name = request.cr.dictfetchall() + except: + name = {'name': 'None', 'value': 'None'} + return json.dumps(name) diff --git a/website_search_blog/doc/RELEASE_NOTES.md b/website_search_blog/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..67dec40ea --- /dev/null +++ b/website_search_blog/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 06.01.2020 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for website_search_blog + diff --git a/website_search_blog/static/description/banner.png b/website_search_blog/static/description/banner.png new file mode 100644 index 000000000..0138acf36 Binary files /dev/null and b/website_search_blog/static/description/banner.png differ diff --git a/website_search_blog/static/description/icon.png b/website_search_blog/static/description/icon.png new file mode 100644 index 000000000..7999a4be4 Binary files /dev/null and b/website_search_blog/static/description/icon.png differ diff --git a/website_search_blog/static/description/images/banner_barcode_scanning.jpeg b/website_search_blog/static/description/images/banner_barcode_scanning.jpeg new file mode 100644 index 000000000..529143e4e Binary files /dev/null and b/website_search_blog/static/description/images/banner_barcode_scanning.jpeg differ diff --git a/website_search_blog/static/description/images/banner_currency_total.png b/website_search_blog/static/description/images/banner_currency_total.png new file mode 100644 index 000000000..6153ed719 Binary files /dev/null and b/website_search_blog/static/description/images/banner_currency_total.png differ diff --git a/website_search_blog/static/description/images/banner_customer_sequence.jpeg b/website_search_blog/static/description/images/banner_customer_sequence.jpeg new file mode 100644 index 000000000..7451342d6 Binary files /dev/null and b/website_search_blog/static/description/images/banner_customer_sequence.jpeg differ diff --git a/website_search_blog/static/description/images/banner_previous_rates.jpeg b/website_search_blog/static/description/images/banner_previous_rates.jpeg new file mode 100644 index 000000000..e10c28799 Binary files /dev/null and b/website_search_blog/static/description/images/banner_previous_rates.jpeg differ diff --git a/website_search_blog/static/description/images/banner_product_branding.png b/website_search_blog/static/description/images/banner_product_branding.png new file mode 100644 index 000000000..aa12beabb Binary files /dev/null and b/website_search_blog/static/description/images/banner_product_branding.png differ diff --git a/website_search_blog/static/description/images/banner_product_expiry.jpeg b/website_search_blog/static/description/images/banner_product_expiry.jpeg new file mode 100644 index 000000000..84a872d44 Binary files /dev/null and b/website_search_blog/static/description/images/banner_product_expiry.jpeg differ diff --git a/website_search_blog/static/description/images/checked.png b/website_search_blog/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/website_search_blog/static/description/images/checked.png differ diff --git a/website_search_blog/static/description/images/cybrosys.png b/website_search_blog/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/website_search_blog/static/description/images/cybrosys.png differ diff --git a/website_search_blog/static/description/images/search_blog_1.png b/website_search_blog/static/description/images/search_blog_1.png new file mode 100644 index 000000000..c01d0abb8 Binary files /dev/null and b/website_search_blog/static/description/images/search_blog_1.png differ diff --git a/website_search_blog/static/description/images/search_blog_2.png b/website_search_blog/static/description/images/search_blog_2.png new file mode 100644 index 000000000..29710e102 Binary files /dev/null and b/website_search_blog/static/description/images/search_blog_2.png differ diff --git a/website_search_blog/static/description/images/search_blog_3.png b/website_search_blog/static/description/images/search_blog_3.png new file mode 100644 index 000000000..a561227f7 Binary files /dev/null and b/website_search_blog/static/description/images/search_blog_3.png differ diff --git a/website_search_blog/static/description/images/search_blog_4.png b/website_search_blog/static/description/images/search_blog_4.png new file mode 100644 index 000000000..b4217b7a7 Binary files /dev/null and b/website_search_blog/static/description/images/search_blog_4.png differ diff --git a/website_search_blog/static/description/images/website.gif b/website_search_blog/static/description/images/website.gif new file mode 100644 index 000000000..b0a9c79c5 Binary files /dev/null and b/website_search_blog/static/description/images/website.gif differ diff --git a/website_search_blog/static/description/index.html b/website_search_blog/static/description/index.html new file mode 100644 index 000000000..d683cac34 --- /dev/null +++ b/website_search_blog/static/description/index.html @@ -0,0 +1,310 @@ +
cybrosys-logo
+
+
+
+

Website Blog Search

+

Search Option in Blog.

+
+

Key Highlights

+
    +
  • checkSearch field in Blog.
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This app brings search option in the blog. A website visitor can easily find the needful blog. +

+
+
+ +

Search Blog

+
+
    +
  • + checkSearch Field in Blog +
  • + +
  • + checkAuto Suggestion List +
  • +
  • + checkSearch Results From All Categories +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

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.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/website_search_blog/static/src/js/search.js b/website_search_blog/static/src/js/search.js new file mode 100644 index 000000000..b4af7dfbc --- /dev/null +++ b/website_search_blog/static/src/js/search.js @@ -0,0 +1,34 @@ +odoo.define('website_sale_advanced_search.blog_search', function (require) { +"use strict"; +var ajax = require('web.ajax'); +$(function() { + $(".search_query").autocomplete({ + source: function(request, response) { + console.log("sadsad"); + $.ajax({ + url: "/blog/search", + method: "POST", + dataType: "json", + data: { name: request.term}, + success: function( data ) { + response( $.map( data, function( item ) { + return { + label: item.name, + value: item.name, + id: item.res_id, + } + })); + }, + error: function (error) { + alert('error: ' + error); + } + }); + }, + select:function(suggestion,term,item){ + window.location.href= "/blog/our-blog-1/post/"+term.item.id + }, + minLength: 1 + }); + +}); +}); \ No newline at end of file diff --git a/website_search_blog/views/search_blog.xml b/website_search_blog/views/search_blog.xml new file mode 100644 index 000000000..2a8abdbed --- /dev/null +++ b/website_search_blog/views/search_blog.xml @@ -0,0 +1,50 @@ + + + + + + + + diff --git a/website_search_blog/views/templates_blog.xml b/website_search_blog/views/templates_blog.xml new file mode 100644 index 000000000..4533b894c --- /dev/null +++ b/website_search_blog/views/templates_blog.xml @@ -0,0 +1,10 @@ + + + + + +