(),'
"}) + values = { + 'string': string, + 'id': product['id'] + } + pro = self.env['product.template'].browse(values['id']) + pro.write({ + 'website_meta_title': values['string'], + 'website_meta_keywords': pro.name + }) + meta_title.append(values) + if self.meta_description_ids: + products = self.env['product.template'].search_read( + [], fields=self.meta_description_ids.mapped('product')) + meta_description = [] + for product in products: + sep = self.attribute_separator + string = str(sep).join( + str(product[x]) for x in product.keys() if x != 'id') + string = string.translate( + {ord(i): None for i in "(),'
"}) + values = { + 'string': string, + 'id': product['id'] + } + pro = self.env['product.template'].browse(values['id']) + pro.write({ + 'website_meta_description': values['string'], + }) + meta_description.append(values) + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'target': 'new', + 'params': { + 'message': ("Successfully " + "generated the seo for all products"), + 'type': 'success', + 'sticky': False, + 'next': {'type': 'ir.actions.act_window_close'}, + + } + } + + elif self.model_name == 'product_category': + if self.meta_title_ids: + products = self.env['product.public.category'].search_read( + [('is_auto_seo', '=', True)], + fields=self.meta_title_ids.mapped('category')) + meta_categ_title = [] + for product in products: + sep = self.attribute_separator + string = str(sep).join( + str(product[x]) for x in product.keys() if x != 'id') + string = string.translate( + {ord(i): None for i in "(),'
"}) + values = { + 'string': string, + 'id': product['id'] + } + pro = self.env['product.public.category'].browse( + values['id']) + for rec in pro: + rec.write({ + 'website_meta_title': values['string'], + 'website_meta_keywords': pro.name + }) + meta_categ_title.append(values) + if self.meta_description_ids: + products = self.env['product.public.category'].search_read( + [('is_auto_seo', '=', True)], + fields=self.meta_description_ids.mapped('category')) + meta_categ_description = [] + for product in products: + sep = self.attribute_separator + string = str(sep).join( + str(product[x]) for x in product.keys() if x != 'id') + string = string.translate( + {ord(i): None for i in "(),'
"}) + values = { + 'string': string, + 'id': product['id'] + } + pro = self.env[ + 'product.public.category'].browse(values['id']) + pro.write({ + 'website_meta_description': values['string'], + }) + meta_categ_description.append(values) + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'target': 'new', + 'params': { + 'message': + ("Successfully created the SEO only for product" + " groups with auto SEO enabled."), + 'type': 'success', + 'sticky': False, + 'next': {'type': 'ir.actions.act_window_close'}, + } + } + + def action_deactivate_seo(self): + """function used to deactivate the SEO in Archive button click""" + self.state = 'deactivated' diff --git a/website_seo_kit/models/product_public_category.py b/website_seo_kit/models/product_public_category.py new file mode 100644 index 000000000..295aeab27 --- /dev/null +++ b/website_seo_kit/models/product_public_category.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(+ Can automatically generate meta titles, descriptions, and keywords for each product and product + group. +
++ Key Highlights +
++ Automatically generating meta titles, descriptions, and keywords
++ Create meta contents with only one click.
++ Easy website optimization
+Go to Website -> Site -> SEO Attribute + -> Here you can Create SEO attribute
+ + +Go to Website -> Site -> Generate SEO ->We can generate SEO content for Product ,Select the attributes for title and + descriptions +
+Go to Website -> Site -> Generate SEO ->We can generate SEO content for Product Category ,Select the attributes for title and + descriptions.
+With the help of Archive button you can deactivate the SEO.
+With the help of the statusbar user can easily identify the active SEO.
++ We can configure the SEO updates in product categories +
+Go to Website -> Site -> Optimize SEO
+Here is the result of optimized SEO for Product
+Here is the result of optimized SEO for Category
++ Initial Commit for Website SEO Kit
++ Related Products
++ Our Services
+ +Odoo + Customization
+Odoo + Implementation
+Odoo + Support
+Hire + Odoo Developer
+Odoo + Integration
+Odoo + Migration
+Odoo + Consultancy
+Odoo + Implementation
+Odoo + Licensing Consultancy
++ Our Industries
+ +Trading
+Easily procure and sell your products
+POS
+Easy configuration and convivial experience
++ Education
+A platform for educational management
++ Manufacturing
+Plan, track and schedule your operations
+E-commerce & + Website
+Mobile friendly, awe-inspiring product pages
+Service + Management
+Keep track of services and invoice
++ Restaurant
+Run your bar or restaurant methodically
+Hotel + Management
+An all-inclusive hotel management application
++ Support
+Got + questions or need help? Get in touch.
+Say hi to + us on WhatsApp!
+