This commit is contained in:
ivan deng
2023-07-26 22:20:07 +08:00
parent 2fd84c129a
commit cd1422e423
4 changed files with 22 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ def pre_init_hook(cr):
"""
数据初始化,只在安装时执行,更新时不执行
"""
# todo: 启用中文
pass

View File

@@ -25,3 +25,4 @@
from . import blog_tag_category
from . import blog_tag
from . import blog_blog
from . import blog_post

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from odoo import api, models, fields, _
from odoo.tools.safe_eval import safe_eval
class BlogPost(models.Model):
_inherit = 'blog.post'
def action_post_debug_view(self):
self.ensure_one()
action = self.env.ref('website_blog.action_blog_post').read()[0]
action['views'] = [(self.env.ref('website_blog.view_blog_post_form').id, 'form')]
action['res_id'] = self.id
return action

View File

@@ -10,6 +10,9 @@
</xpath>
<xpath expr="//field[@name='write_date']" position="after">
<field name="published_date" optional="hide"/>
</xpath>
<xpath expr="//field[@name='is_published']" position="after">
<button name="action_post_debug_view" type="object" title="Settings" icon="fa-bug fa-lg" groups="base.group_no_one"/>
</xpath>
</field>
</record>