mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix misc for ai
This commit is contained in:
@@ -16,3 +16,15 @@ class BlogBlog(models.Model):
|
||||
action = self.env.ref('website_blog.action_blog_post').read()[0]
|
||||
action['domain'] = [('blog_id', '=', self.id)]
|
||||
return action
|
||||
|
||||
# def unlink(self):
|
||||
# # active的先不删除,设置为 deactive
|
||||
# to_deactive = self.filtered(lambda r: r.active)
|
||||
# self = self - to_deactive
|
||||
# to_deactive.write({
|
||||
# 'active': False,
|
||||
# })
|
||||
# if self:
|
||||
# return super(BlogBlog, self).unlink()
|
||||
# else:
|
||||
# return False
|
||||
|
||||
@@ -7,7 +7,10 @@ from odoo.tools.safe_eval import safe_eval
|
||||
|
||||
class BlogPost(models.Model):
|
||||
_inherit = 'blog.post'
|
||||
|
||||
|
||||
# 不允许暴力删除
|
||||
blog_id = fields.Many2one('blog.blog', ondelete='restrict')
|
||||
|
||||
def write(self, vals):
|
||||
if vals.get('website_meta_og_img'):
|
||||
sync_blog_meta_background_img = self.env['ir.config_parameter'].sudo().get_param('app_website_blog_editor.sync_blog_meta_background_img')
|
||||
|
||||
Reference in New Issue
Block a user