mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt page editor
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': "Website Blogs Editor in Backend",
|
'name': "Website Blogs Editor in Backend",
|
||||||
'version': '16.23.04.11',
|
'version': '16.23.08.03',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
|
|||||||
@@ -15,3 +15,11 @@ class BlogPost(models.Model):
|
|||||||
action['res_id'] = self.id
|
action['res_id'] = self.id
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
def action_post_code_view(self):
|
||||||
|
self.ensure_one()
|
||||||
|
action = self.env.ref('website_blog.action_blog_post').read()[0]
|
||||||
|
|
||||||
|
action['views'] = [(self.env.ref('app_website_blog_editor.app_blog_post_form_view_code').id, 'form')]
|
||||||
|
action['res_id'] = self.id
|
||||||
|
return action
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<record id="app_view_blog_post_list" model="ir.ui.view">
|
<record id="app_view_blog_post_list" model="ir.ui.view">
|
||||||
<field name="name">app.blog.post.list</field>
|
<field name="name">app.blog.post.list</field>
|
||||||
<field name="model">blog.post</field>
|
<field name="model">blog.post</field>
|
||||||
<field name="inherit_id" ref="website_blog.view_blog_post_list" />
|
<field name="inherit_id" ref="website_blog.view_blog_post_list"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='author_id']" position="before">
|
<xpath expr="//field[@name='author_id']" position="before">
|
||||||
<field name="visits" optional="show"/>
|
<field name="visits" optional="show"/>
|
||||||
@@ -11,8 +11,9 @@
|
|||||||
<xpath expr="//field[@name='write_date']" position="after">
|
<xpath expr="//field[@name='write_date']" position="after">
|
||||||
<field name="published_date" optional="hide"/>
|
<field name="published_date" optional="hide"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='is_published']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
<button name="action_post_debug_view" type="object" title="Settings" icon="fa-bug fa-lg" groups="base.group_no_one"/>
|
<button name="action_post_debug_view" type="object" title="Settings" icon="fa-bug fa-lg" groups="base.group_no_one"/>
|
||||||
|
<button name="action_post_code_view" type="object" title="Source Code" icon="fa-code fa-lg" groups="base.group_no_one"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
<record id="app_view_blog_post_form" model="ir.ui.view">
|
<record id="app_view_blog_post_form" model="ir.ui.view">
|
||||||
<field name="name">app.blog.post.form</field>
|
<field name="name">app.blog.post.form</field>
|
||||||
<field name="model">blog.post</field>
|
<field name="model">blog.post</field>
|
||||||
<field name="inherit_id" ref="website_blog.view_blog_post_form" />
|
<field name="inherit_id" ref="website_blog.view_blog_post_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//page[@name='seo']" position="before">
|
<xpath expr="//page[@name='seo']" position="before">
|
||||||
<page name="post_content" string="Content">
|
<page name="post_content" string="Content">
|
||||||
@@ -30,6 +31,38 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="app_blog_post_form_view_code" model="ir.ui.view">
|
||||||
|
<field name="name">app.blog.post.code</field>
|
||||||
|
<field name="model">blog.post</field>
|
||||||
|
<field name="priority">99</field>
|
||||||
|
<field name="mode">primary</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Blog Contet">
|
||||||
|
<sheet name="blog_content">
|
||||||
|
<field name="id" invisible="True"/>
|
||||||
|
<div class="oe_title">
|
||||||
|
<label for="name" string="Blog Name"/>
|
||||||
|
<h1>
|
||||||
|
<div class="d-flex">
|
||||||
|
<field class="text-break" name="name"/>
|
||||||
|
</div>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="is_published" widget="website_redirect_button"></field>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<notebook>
|
||||||
|
<page name="shop_desc" string="Website Description">
|
||||||
|
<field name="content" nolabel="1" widget="ace"/>
|
||||||
|
</page>
|
||||||
|
</notebook>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': "Website Product Editor in Backend",
|
'name': "Website Product Editor in Backend",
|
||||||
'version': '16.23.04.11',
|
'version': '16.23.08.03',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
|
|||||||
@@ -7,12 +7,20 @@ from odoo.tools.safe_eval import safe_eval
|
|||||||
class ProductTemplate(models.Model):
|
class ProductTemplate(models.Model):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
|
|
||||||
|
def action_product_debug_view(self):
|
||||||
|
self.ensure_one()
|
||||||
|
action = self.env.ref('website_sale.product_template_action_website').read()[0]
|
||||||
|
|
||||||
|
action['views'] = [(self.env.ref('app_website_sale_editor.app_product_template_form_view_debug').id, 'form')]
|
||||||
|
action['res_id'] = self.id
|
||||||
|
return action
|
||||||
|
|
||||||
def action_product_code_view(self):
|
def action_product_code_view(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
|
||||||
action = self.env.ref('website_sale.action_product_pages_list').read()[0]
|
action = self.env.ref('website_sale.action_product_pages_list').read()[0]
|
||||||
|
|
||||||
action['views'] = [(self.env.ref('app_website_sale_editor.product_template_form_view_src').id, 'form')]
|
action['views'] = [(self.env.ref('app_website_sale_editor.app_product_template_form_view_code').id, 'form')]
|
||||||
action['res_id'] = self.id
|
action['res_id'] = self.id
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<field name="type">tree</field>
|
<field name="type">tree</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='name']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
|
<button name="action_product_debug_view" type="object" title="Content Set" icon="fa-bug fa-lg" groups="base.group_no_one"/>
|
||||||
<button name="action_product_code_view" type="object" title="Source Code" icon="fa-code fa-lg" groups="base.group_no_one"/>
|
<button name="action_product_code_view" type="object" title="Source Code" icon="fa-code fa-lg" groups="base.group_no_one"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='website_url']" position="attributes">
|
<xpath expr="//field[@name='website_url']" position="attributes">
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="app_product_template_form_view" model="ir.ui.view">
|
<record id="app_product_template_form_view" model="ir.ui.view">
|
||||||
<field name="name">app.product.template.common.form</field>
|
<field name="name">app.product.template.common.form</field>
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
@@ -29,8 +31,8 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="product_template_form_view_src" model="ir.ui.view">
|
<record id="app_product_template_form_view_code" model="ir.ui.view">
|
||||||
<field name="name">app.product.template.website.src</field>
|
<field name="name">app.product.template.website.code</field>
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="priority">99</field>
|
<field name="priority">99</field>
|
||||||
<field name="mode">primary</field>
|
<field name="mode">primary</field>
|
||||||
@@ -63,5 +65,20 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="app_product_template_form_view_debug" model="ir.ui.view">
|
||||||
|
<field name="name">app.product.template.website.debug</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="priority">99</field>
|
||||||
|
<field name="mode">primary</field>
|
||||||
|
<field name="inherit_id" ref="app_product_template_form_view_code"/>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='website_description']" position="attributes">
|
||||||
|
<attribute name="widget">html</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|||||||
Reference in New Issue
Block a user