mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix misc
This commit is contained in:
@@ -22,6 +22,7 @@ def pre_init_hook(cr):
|
||||
"""
|
||||
数据初始化,只在安装时执行,更新时不执行
|
||||
"""
|
||||
# todo: 启用中文
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -25,3 +25,4 @@
|
||||
from . import blog_tag_category
|
||||
from . import blog_tag
|
||||
from . import blog_blog
|
||||
from . import blog_post
|
||||
|
||||
17
app_website_blog_editor/models/blog_post.py
Normal file
17
app_website_blog_editor/models/blog_post.py
Normal 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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user