odoo_dev 开发培训作业:图书管理系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

179 行
7.8KB

  1. <?xml version="1.0" ?>
  2. <odoo>
  3. <act_window id="action_other_checkouts_button"
  4. name="Open Other Checkouts"
  5. res_model="library.checkout"
  6. view_mode="tree,form"
  7. domain="[('member_id', '=', default_member_id),
  8. ('state', 'in', ['open']),
  9. ('id', '!=', active_id)]"/>
  10. <!-- Tree视图 -->
  11. <record id="view_tree_checkout" model="ir.ui.view">
  12. <field name="name">Checkout Tree</field>
  13. <field name="model">library.checkout</field>
  14. <field name="arch" type="xml">
  15. <tree decoration-muted="state in ['done', 'cancel']" decoration-bf="state=='open'">
  16. <field name="state" invisible="True"/>
  17. <field name="request_date"/>
  18. <field name="member_id"/>
  19. <field name="checkout_date"/>
  20. <field name="stage_id"/>
  21. <!--<field name="num_books" sum="# Books" />-->
  22. <!--<field name="num_books" sum="number of Books" />-->
  23. </tree>
  24. </field>
  25. </record>
  26. <!-- Form视图 -->
  27. <record id="view_form_checkout" model="ir.ui.view">
  28. <field name="name">Checkout Form</field>
  29. <field name="model">library.checkout</field>
  30. <field name="arch" type="xml">
  31. <form>
  32. <header>
  33. <field name="state" invisible="True"/>
  34. <button name="button_done" type="object" string="Return Books"
  35. attrs="{'invisible':[('state', 'in', ['new', 'done'])]}" class="oe_highlight"/>
  36. <!--另外一种方法
  37. <button name="button_done" type="object" string="Returned" states="open,cancel" class="oe_highlight" />-->
  38. <field name="stage_id" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}"/>
  39. <!--另一种方法状态代替管道
  40. <field name="state" widget="statusbar" clickable="True" statusbar_visible="draft,open,done" />-->
  41. <!--下仅供查看效果使用-->
  42. <!--<field name="state" widget="statusbar" clickable="True"/>-->
  43. </header>
  44. <sheet>
  45. <div name="button_box" class="oe_button_box">
  46. <button class="oe_stat_button"
  47. icon="fa-tasks"
  48. help="Other checkouts pending return."
  49. type="action"
  50. name="%(action_other_checkouts_button)d"
  51. context="{'default_member_id': member_id}">
  52. <field string="To Return" name="num_other_checkouts" widget="statinfo"/>
  53. </button>
  54. </div>
  55. <field name="member_image" widget="image" class="oe_avatar"/>
  56. <div class="oe_title">
  57. <label for="member_id" class="oe_edit_only"/>
  58. <h1>
  59. <field name="member_id"/>
  60. </h1>
  61. <h3>
  62. <span class="oe_read_only">By</span>
  63. <label for="user_id" class="oe_edit_only"/>
  64. <field name="user_id" class="oe_inline"/>
  65. </h3>
  66. <label for="login" class="oe_edit_only"/>
  67. <field name="login" class="oe_inline"/>
  68. </div>
  69. <group name="group_top"> <!-- col=4个字段,solspan=2列显示 -->
  70. <group name="group_col1"
  71. col="4"
  72. colspan="2"
  73. string="Group 1">
  74. <field name="user_id"/>
  75. <field name="checkout_date"/>
  76. <field name="state"/>
  77. <field name="closed_date"/>
  78. </group>
  79. <group name="group_col2" string="Hello World!">
  80. <field name="state"/>
  81. <field name="closed_date"/>
  82. <field name="num_books"/>
  83. </group>
  84. </group>
  85. <group>
  86. <field name="member_id"/>
  87. <field name="request_date"/>
  88. <field name="user_id"/>
  89. <field name="line_ids"/>
  90. </group>
  91. <notebook>
  92. <page string="Borrowed Books" name="page_lines">
  93. <field name="note" accesskey="a"/>
  94. </page>
  95. <page string="管理">
  96. <group>
  97. <field name="login"/>
  98. <field name="pwd" password="True"/>
  99. </group>
  100. </page>
  101. <page string="Borrowed Books" name="page_lines">
  102. <field name="line_ids">
  103. <tree>
  104. <field name="book_id"/>
  105. </tree>
  106. <!--form>
  107. <field name="book_id" />
  108. </form-->
  109. </field>
  110. </page>
  111. </notebook>
  112. </sheet>
  113. <div class="oe_chatter">
  114. <field name="message_follower_ids" widget="mail_followers"/>
  115. <field name="activity_ids" widget="mail_activity"/>
  116. <field name="message_ids" widget="mail_thread"/>
  117. </div>
  118. </form>
  119. </field>
  120. </record>
  121. <!-- 搜索视图 -->
  122. <record id="view_filter_checkout" model="ir.ui.view">
  123. <field name="model">library.checkout</field>
  124. <field name="arch" type="xml">
  125. <search>
  126. <field name="member_id"/>
  127. <field name="user_id"/>
  128. <filter name="filter_not_done" string="To Return" domain="[('state','=','open')]"/>
  129. <filter name="filter_my_checkouts" string="My Checkouts" domain="['user_id', '=', uid]"/>
  130. <filter name="group_user" string="By Member" context="{'group_by': 'member_id'}"/>
  131. </search>
  132. </field>
  133. </record>
  134. <!-- 日历视图 date_start是开始日期字段(必填) -->
  135. <record id="view_calendar_checkout" model="ir.ui.view">
  136. <field name="model">library.checkout</field>
  137. <field name="arch" type="xml">
  138. <calendar date_start="request_date"
  139. color="user_id">
  140. <field name="member_id"/>
  141. <field name="stage_id"/>
  142. </calendar>
  143. </field>
  144. </record>
  145. <!-- 透视表视图 -->
  146. <record id="view_pivot_checkout" model="ir.ui.view">
  147. <field name="name">view_pivot_checkout</field>
  148. <field name="model">library.checkout</field>
  149. <field name="arch" type="xml">
  150. <pivot>
  151. <field name="stage_id" type="col"/>
  152. <field name="member_id"/>
  153. <field name="request_date" interval="week"/>
  154. <!--<field name="num_books" type="measure"/>-->
  155. </pivot>
  156. </field>
  157. </record>
  158. <!-- 图表视图 -->
  159. <record id="view_graph_checkout" model="ir.ui.view">
  160. <field name="name">view_graph_checkout</field>
  161. <field name="model">library.checkout</field>
  162. <field name="arch" type="xml">
  163. <graph type="bar">
  164. <field name="stage_id"/>
  165. <!--<field name="num_books" type="measure"/>-->
  166. </graph>
  167. </field>
  168. </record>
  169. </odoo>
上海开阖软件有限公司 沪ICP备12045867号-1