website_blog_views.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data>
  4. <menuitem name="Knowledge" id="knowledge.menu_document"/>
  5. <menuitem name="Blog Posts" id="menu_wiki" parent="knowledge.menu_document" sequence="20" />
  6. <!-- Blog views -->
  7. <record model="ir.ui.view" id="view_blog_blog_list">
  8. <field name="name">blog.blog.list</field>
  9. <field name="model">blog.blog</field>
  10. <field name="arch" type="xml">
  11. <tree string="Blogs">
  12. <field name="name"/>
  13. </tree>
  14. </field>
  15. </record>
  16. <record model="ir.ui.view" id="view_blog_blog_form">
  17. <field name="name">blog.blog.form</field>
  18. <field name="model">blog.blog</field>
  19. <field name="arch" type="xml">
  20. <form string="Blog">
  21. <sheet>
  22. <group>
  23. <field name="name"/>
  24. <field name="description"/>
  25. </group>
  26. </sheet>
  27. <div class="oe_chatter">
  28. <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
  29. <field name="message_ids" widget="mail_thread" options='{"thread_level": 1}' placeholder="Send a message to the group"/>
  30. </div>
  31. </form>
  32. </field>
  33. </record>
  34. <!-- page list view -->
  35. <record model="ir.ui.view" id="view_blog_post_list">
  36. <field name="name">blog.post.list</field>
  37. <field name="model">blog.post</field>
  38. <field name="arch" type="xml">
  39. <tree string="Blog Posts">
  40. <field name="name"/>
  41. <field name="blog_id"/>
  42. <field name="create_uid" invisible="1"/>
  43. <field name="write_uid"/>
  44. <field name="write_date"/>
  45. </tree>
  46. </field>
  47. </record>
  48. <!-- page form view -->
  49. <record model="ir.ui.view" id="view_blog_post_form">
  50. <field name="name">blog.post.form</field>
  51. <field name="model">blog.post</field>
  52. <field name="arch" type="xml">
  53. <form string="Blog Post">
  54. <sheet>
  55. <group>
  56. <field name="name" placeholder="Name"/>
  57. <field name="tag_ids" widget="many2many_tags"/>
  58. <field name="subtitle" placeholder="Blog Subtitle"/>
  59. </group>
  60. <group>
  61. <field name="blog_id"/>
  62. </group>
  63. <group>
  64. <field name="visits"/>
  65. <field name="ranking" invisible="1"/>
  66. </group>
  67. <group string="Technical" groups="base.group_no_one">
  68. <field name="write_uid" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_document_user']}"/>
  69. <field name="write_date"/>
  70. </group>
  71. </sheet>
  72. <div class="oe_chatter">
  73. <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
  74. <field name="message_ids" widget="mail_thread" options='{"thread_level": 1}' placeholder="Send a message to the group"/>
  75. </div>
  76. </form>
  77. </field>
  78. </record>
  79. <!-- page search view -->
  80. <record model="ir.ui.view" id="view_blog_post_search">
  81. <field name="name">blog.post.search</field>
  82. <field name="model">blog.post</field>
  83. <field name="arch" type="xml">
  84. <search string="Blog Post">
  85. <field name="name" string="Content" filter_domain="['|', ('name','ilike',self), ('content','ilike',self)]"/>
  86. <field name="write_uid"/>
  87. <field name="blog_id"/>
  88. <group expand="0" string="Group By">
  89. <filter string="Blog" domain="[]" context="{'group_by': 'blog_id'}"/>
  90. <filter string="Author" domain="[]" context="{'group_by': 'create_uid'}"/>
  91. <filter string="Last Contributor" domain="[]" context="{'group_by': 'write_uid'}"/>
  92. </group>
  93. </search>
  94. </field>
  95. </record>
  96. <!-- page action -->
  97. <record model="ir.actions.act_window" id="action_blog_post">
  98. <field name="name">Blog Posts</field>
  99. <field name="res_model">blog.post</field>
  100. <field name="view_type">form</field>
  101. <field name="view_mode">tree,form</field>
  102. <field name="view_id" ref="view_blog_post_list"/>
  103. <field name="search_view_id" ref="view_blog_post_search"/>
  104. <field name="help" type="html">
  105. <p class="oe_view_nocontent_create">
  106. Click to create a new blog post.
  107. </p>
  108. </field>
  109. </record>
  110. <menuitem id="menu_page" parent="menu_wiki" name="Blog Posts" action="action_blog_post" sequence="10"/>
  111. <record model="ir.actions.act_window" id="action_blog_blog">
  112. <field name="name">Blogs</field>
  113. <field name="res_model">blog.blog</field>
  114. <field name="view_type">form</field>
  115. <field name="view_mode">tree,form</field>
  116. </record>
  117. <menuitem id="menu_blog" parent="menu_wiki" name="Blogs" action="action_blog_blog" sequence="20"/>
  118. <!-- History Tree view -->
  119. <record model="ir.ui.view" id="view_blog_history_tree">
  120. <field name="name">blog.post.history.tree</field>
  121. <field name="model">blog.post.history</field>
  122. <field name="arch" type="xml">
  123. <tree string="Document History">
  124. <field name="create_date"/>
  125. <field name="create_uid"/>
  126. <field name="post_id"/>
  127. </tree>
  128. </field>
  129. </record>
  130. <!-- History Form view -->
  131. <record model="ir.ui.view" id="view_blog_history_form">
  132. <field name="name">blog.post.history.form</field>
  133. <field name="model">blog.post.history</field>
  134. <field name="arch" type="xml">
  135. <form string="Blog Post History">
  136. <label for="post_id" class="oe_edit_only"/>
  137. <h1><field name="post_id" select="1" /></h1>
  138. <label for="create_date" class="oe_edit_only"/>
  139. <field name="create_date" readonly="1"/>
  140. </form>
  141. </field>
  142. </record>
  143. <!-- History Action -->
  144. <record model="ir.actions.act_window" id="action_history">
  145. <field name="name">Page history</field>
  146. <field name="res_model">blog.post.history</field>
  147. <field name="view_type">form</field>
  148. <field name="view_mode">tree,form</field>
  149. </record>
  150. <menuitem id="menu_page_history" parent="menu_wiki" name="Pages history" action="action_history" sequence="30" groups="base.group_no_one"/>
  151. <act_window
  152. id="action_related_page_history"
  153. context="{'search_default_post_id': [active_id], 'default_post_id': active_id}"
  154. domain="[('post_id','=',active_id)]"
  155. name="Page History"
  156. res_model="blog.post.history"
  157. src_model="blog.post"/>
  158. <record model="ir.ui.view" id="blog_tag_tree">
  159. <field name="name">blog_tag_tree</field>
  160. <field name="model">blog.tag</field>
  161. <field name="arch" type="xml">
  162. <tree string="Tag List" create="false">
  163. <field name="name"/>
  164. <field name="post_ids"/>
  165. </tree>
  166. </field>
  167. </record>
  168. <record model="ir.ui.view" id="blog_tag_form">
  169. <field name="name">blog_tag_form</field>
  170. <field name="model">blog.tag</field>
  171. <field name="arch" type="xml">
  172. <form string="Tag Form">
  173. <sheet>
  174. <group>
  175. <field name="name"/>
  176. </group>
  177. <label for="post_ids" string="Used in: "/>
  178. <field name="post_ids"/>
  179. </sheet>
  180. </form>
  181. </field>
  182. </record>
  183. <record model="ir.actions.act_window" id="action_tags">
  184. <field name="name">Blog Tags</field>
  185. <field name="res_model">blog.tag</field>
  186. <field name="view_type">form</field>
  187. <field name="view_mode">tree,form,graph</field>
  188. <field name="view_id" ref="blog_tag_tree"/>
  189. </record>
  190. <menuitem id="menu_blog_tag" parent="menu_wiki" name="Blog Tags" action="action_tags" sequence="40" />
  191. </data>
  192. </openerp>