(),'
"}) + 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, + } + } + + 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, + } + } + + +class SeoPublicCategory(models.Model): + """here user can include category by enabling is_auto_seo field""" + _inherit = 'product.public.category' + + is_auto_seo = fields.Boolean(string="Auto Update SEO", + help='enable for generate seo content ' + 'automatically for this category') + category_description = fields.Text(string='Description For This Category', + help='Description For This Category', + required=True) diff --git a/website_seo_kit/security/ir.model.access.csv b/website_seo_kit/security/ir.model.access.csv new file mode 100644 index 000000000..05a34e551 --- /dev/null +++ b/website_seo_kit/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_website_seo_attributes,model_website_seo_attributes,model_website_seo_attributes,website.group_website_designer,1,1,1,1 +access_seo_generate,model_seo_generate,model_seo_generate,website.group_website_designer,1,1,1,1 diff --git a/website_seo_kit/security/security_rule.xml b/website_seo_kit/security/security_rule.xml new file mode 100644 index 000000000..0ad8e0c11 --- /dev/null +++ b/website_seo_kit/security/security_rule.xml @@ -0,0 +1,8 @@ + +Using the module, you may automatically generate meta titles, descriptions, and keywords for each product and product group.
+ +Go to Website -> Site -> SEO Attribute + -> Here you can Create SEO attribute +
+Here you can generate seo content
For the help of the statusbar user can easily identify the active SEO.
here the result +
+ ++ Easily procure + and + sell your products
++ Easy + configuration + and convivial experience
++ A platform for + educational management
++ Plan, track and + schedule your operations
++ Mobile + friendly, + awe-inspiring product pages
++ Keep track of + services and invoice
++ Run your bar or + restaurant methodically
++ An + all-inclusive + hotel management application
+