From eb88335cf86ac25bb6e515c506c7bd2bd3ecc5d2 Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Wed, 20 Sep 2023 11:17:32 +0530 Subject: [PATCH] Sep 20 [FIX] : Bug Fixed 'website_seo_kit' --- website_seo_kit/__manifest__.py | 8 ++--- website_seo_kit/doc/RELEASE_NOTES.md | 6 +++- website_seo_kit/models/website_seo.py | 30 ++++++++----------- website_seo_kit/security/ir.model.access.csv | 4 +-- .../{security_rule.xml => ir_rule.xml} | 2 +- website_seo_kit/views/seo_categ_view.xml | 8 ++--- website_seo_kit/views/seo_generator_view.xml | 7 ++--- 7 files changed, 31 insertions(+), 34 deletions(-) rename website_seo_kit/security/{security_rule.xml => ir_rule.xml} (97%) diff --git a/website_seo_kit/__manifest__.py b/website_seo_kit/__manifest__.py index 19febd940..0e18d97a2 100644 --- a/website_seo_kit/__manifest__.py +++ b/website_seo_kit/__manifest__.py @@ -21,8 +21,8 @@ ############################################################################ { 'name': "Website SEO Kit", - 'version': '16.0.1.0.0', - 'summary': """website seo kit used for + 'version': '16.0.1.1.0', + 'summary': """Website seo kit used for automatically generate meta titles, descriptions, and keywords for each product and product category""", 'description': """This module help to generate seo content""", @@ -34,7 +34,7 @@ 'images': ['static/description/banner.png'], 'depends': ['base', 'website', 'website_sale'], 'data': [ - 'security/security_rule.xml', + 'security/ir_rule.xml', 'security/ir.model.access.csv', 'views/seo_categ_view.xml', 'views/seo_generator_view.xml', @@ -44,4 +44,4 @@ 'installable': True, 'auto_install': False, 'application': False, -} \ No newline at end of file +} diff --git a/website_seo_kit/doc/RELEASE_NOTES.md b/website_seo_kit/doc/RELEASE_NOTES.md index db1286837..771dde8f4 100644 --- a/website_seo_kit/doc/RELEASE_NOTES.md +++ b/website_seo_kit/doc/RELEASE_NOTES.md @@ -3,5 +3,9 @@ #### 17.02.2023 #### Version 16.0.1.0.0 #### ADD - - Initial commit for Website SEO Kit + +#### 18.09.2023 +#### Version 16.0.1.1.0 +##### FIX +- Bug Fixed \ No newline at end of file diff --git a/website_seo_kit/models/website_seo.py b/website_seo_kit/models/website_seo.py index fc7d3dbcc..6101b418c 100644 --- a/website_seo_kit/models/website_seo.py +++ b/website_seo_kit/models/website_seo.py @@ -23,7 +23,7 @@ from odoo import api, exceptions, fields, models class WebsiteSeoAttribute(models.Model): - """this module allows to user to give attributes""" + """This module allows to user to give attributes""" _name = 'website.seo.attributes' _description = 'Website SEO' @@ -33,19 +33,21 @@ class WebsiteSeoAttribute(models.Model): ('description_sale', 'Product Description'), ('default_code', 'Internal Reference'), ('company_id', 'Company Name')], - help='Select Product') + help='Select Product', string="Product") models = fields.Selection([('product', 'Product'), ('product_category', 'Product Category')], string='Model', help='Choose your model') - tech_name = fields.Char(string='Technical name') + tech_name = fields.Char(string='Technical name', help="Technical Name") category = fields.Selection([('name', 'Category Name'), ('parent_id', 'Category Parent Name'), ('category_description', 'Category Description')], - help='Select Product Category') + help='Select Product Category', + string="Select Product Category") @api.constrains('name') def _check_unique_name(self): + """Check for unique name""" for rec in self: domain = [('name', '=', rec.name.lower())] if self.search_count(domain) > 1: @@ -63,22 +65,18 @@ class GenerateSeo(models.Model): ('product_category', 'Product Category')], string='SEO Meta Configuration For', help='Select any these model', required=True) - meta_title_ids = fields.Many2many('website.seo.attributes', 'title', 'title_id', string='Meta Title', help='Choose meta tittle', required=True) - meta_description_ids = fields.Many2many('website.seo.attributes', 'description', 'description_id', string='Meta Description', help='Choose meta description', required=True) - attribute_separator = fields.Char(string="Multi Attribute Separator", default="|", required=True) company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company) - meta_ids = fields.Many2many('website.seo.attributes', 'meta', 'meta_id', string='Title !') state = fields.Selection([ @@ -100,7 +98,7 @@ class GenerateSeo(models.Model): [('models', '=', 'product_category')])] def action_save_seo_info(self): - """save the seo content""" + """Save the seo content""" for rec in self.search([]): if rec.id == self.id: self.write({'state': 'activated'}) @@ -127,7 +125,6 @@ class GenerateSeo(models.Model): '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')) @@ -158,7 +155,6 @@ class GenerateSeo(models.Model): 'sticky': False, } } - elif self.model_name == 'product_category': if self.meta_title_ids: products = self.env['product.public.category'].search_read( @@ -183,11 +179,10 @@ class GenerateSeo(models.Model): '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')) + fields=self.meta_description_ids.mapped('category')) meta_categ_description = [] for product in products: sep = self.attribute_separator @@ -199,12 +194,12 @@ class GenerateSeo(models.Model): 'string': string, 'id': product['id'] } - pro = self.env['product.public.category'].browse(values['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', @@ -220,12 +215,11 @@ class GenerateSeo(models.Model): class SeoPublicCategory(models.Model): - """here user can include category by enabling is_auto_seo field""" + """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) + help='Description For This Category') diff --git a/website_seo_kit/security/ir.model.access.csv b/website_seo_kit/security/ir.model.access.csv index 05a34e551..12bd0fc6a 100644 --- a/website_seo_kit/security/ir.model.access.csv +++ b/website_seo_kit/security/ir.model.access.csv @@ -1,3 +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 +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/ir_rule.xml similarity index 97% rename from website_seo_kit/security/security_rule.xml rename to website_seo_kit/security/ir_rule.xml index 0ad8e0c11..922685be3 100644 --- a/website_seo_kit/security/security_rule.xml +++ b/website_seo_kit/security/ir_rule.xml @@ -5,4 +5,4 @@ ['|',('company_id','=',False),('company_id', 'in', company_ids)] - \ No newline at end of file + diff --git a/website_seo_kit/views/seo_categ_view.xml b/website_seo_kit/views/seo_categ_view.xml index 1ccdd65ed..24ee9684d 100644 --- a/website_seo_kit/views/seo_categ_view.xml +++ b/website_seo_kit/views/seo_categ_view.xml @@ -1,7 +1,7 @@ - - + + product.public.category.view.form.inherit.website.seo.kit product.public.category + placeholder="Enter Category Description" required="True"/> - \ No newline at end of file + diff --git a/website_seo_kit/views/seo_generator_view.xml b/website_seo_kit/views/seo_generator_view.xml index 79f3dff67..d3e2377ed 100644 --- a/website_seo_kit/views/seo_generator_view.xml +++ b/website_seo_kit/views/seo_generator_view.xml @@ -1,6 +1,6 @@ - + seo.generate.view.form seo.generate @@ -41,7 +41,7 @@ - + seo.generate.view.tree seo.generate @@ -56,7 +56,6 @@ - Website SEO @@ -69,4 +68,4 @@ parent="website.menu_site" action="action_website_generate_seo" groups="website.group_website_designer"/> - \ No newline at end of file +