odoo_dev 开发培训作业:图书管理系统
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

170 lines
7.1KB

  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. <record id="view_tree_checkout" model="ir.ui.view">
  11. <field name="name">Checkout Tree</field>
  12. <field name="model">library.checkout</field>
  13. <field name="arch" type="xml">
  14. <tree
  15. decoration-muted="state in ['done', 'cancel']"
  16. decoration-bf="state=='open'">
  17. <field name="state" invisible="True" />
  18. <field name="request_date" />
  19. <field name="member_id" />
  20. <field name="checkout_date" />
  21. <field name="stage_id" />
  22. <field name="num_books" sum="# Books" />
  23. </tree>
  24. </field>
  25. </record>
  26. <record id="view_form_checkout" model="ir.ui.view">
  27. <field name="model">library.checkout</field>
  28. <field name="arch" type="xml">
  29. <form>
  30. <header>
  31. <!--以下仅供查看效果使用-->
  32. <field name="state" invisible="True" />
  33. <button name="button_done"
  34. type="object"
  35. string="Returned"
  36. states="open,cancel"
  37. class="oe_highlight" />
  38. <field name="stage_id"
  39. widget="statusbar"
  40. options="{'clickable': '1', 'fold_field': 'fold'}"
  41. statusbar_visible="draft,open,done" />
  42. </header>
  43. <sheet>
  44. <!--智能按钮-->
  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"
  53. name="num_other_checkouts"
  54. widget="statinfo" />
  55. </button>
  56. </div>
  57. <!--看板,显示为几颗星星-->
  58. <field name="priority" widget="priority"/>
  59. <!--头像部份-->
  60. <field name="member_image" widget="image" class="oe_avatar" />
  61. <div class="oe_title">
  62. <label for="member_id" class="oe_edit_only" />
  63. <h1><field name="member_id" /></h1>
  64. <h3>
  65. <span class="oe_read_only">By </span>
  66. <label for="user_id" class="oe_edit_only" />
  67. <field name="user_id" class="oe_inline" />
  68. </h3>
  69. </div>
  70. <!-- 纸张分成两部份显示Group 1和Group 2 -->
  71. <group name="group_top">
  72. <group name="group_col1"
  73. col="4"
  74. colspan="2"
  75. string="Group 1">
  76. <field name="user_id" />
  77. <field name="state" />
  78. <field name="checkout_date" />
  79. <field name="closed_date" />
  80. </group>
  81. <group name="group_col2" string="Group2" />
  82. </group>
  83. <!-- More elements will be added from here... -->
  84. <notebook>
  85. <page string="Borrowed Books" name="page_lines">
  86. <field name="line_ids">
  87. <tree editable="top">
  88. <field name="book_id" />
  89. </tree>
  90. <!--form>
  91. <field name="book_id" />
  92. </form-->
  93. </field>
  94. </page>
  95. </notebook>
  96. </sheet>
  97. <!--message显示区域-->
  98. <div class="oe_chatter">
  99. <field name="message_follower_ids" widget="mail_followers"/>
  100. <field name="activity_ids" widget="mail_activity"/>
  101. <field name="message_ids" widget="mail_thread"/>
  102. </div>
  103. </form>
  104. </field>
  105. </record>
  106. <!--搜索栏设定-->
  107. <record id="view_filter_checkout" model="ir.ui.view">
  108. <field name="model">library.checkout</field>
  109. <field name="arch" type="xml">
  110. <search>
  111. <field name="member_id" />
  112. <field name="user_id" />
  113. <filter name="filter_not_done"
  114. string="To Return"
  115. domain="[('state','=','open')]" />
  116. <filter name="filter_my_checkouts"
  117. string="My Checkouts"
  118. domain="[('user_id', '=', uid)]" />
  119. <filter name="group_user"
  120. string="By Member"
  121. context="{'group_by': 'member_id'}" />
  122. </search>
  123. </field>
  124. </record>
  125. <!--日历视图-->
  126. <record id="view_calendar_checkout" model="ir.ui.view">
  127. <field name="model">library.checkout</field>
  128. <field name="arch" type="xml">
  129. <calendar date_start="request_date"
  130. color="user_id">
  131. <field name="member_id" />
  132. <field name="stage_id" />
  133. </calendar>
  134. </field>
  135. </record>
  136. <!--透视视表-->
  137. <record id="view_pivot_checkout" model="ir.ui.view">
  138. <field name="model">library.checkout</field>
  139. <field name="arch" type="xml">
  140. <pivot>
  141. <field name="stage_id" type="col" />
  142. <field name="member_id" />
  143. <field name="request_date" interval="week" />
  144. <field name="num_books" type="measure" />
  145. </pivot>
  146. </field>
  147. </record>
  148. <!--图表视图-->
  149. <record id="view_graph_checkout" model="ir.ui.view">
  150. <field name="model">library.checkout</field>
  151. <field name="arch" type="xml">
  152. <graph type="bar">
  153. <field name="stage_id" />
  154. <field name="num_books" type="measure" />
  155. </graph>
  156. </field>
  157. </record>
  158. <record id="view_tree_checkout_line" model="ir.ui.view">
  159. <field name="name">Checkout Tree Line</field>
  160. <field name="model">library.checkout.line</field>
  161. <field name="arch" type="xml">
  162. <tree editable="bottom">
  163. <field name="book_id" />
  164. </tree>
  165. </field>
  166. </record>
  167. </odoo>
上海开阖软件有限公司 沪ICP备12045867号-1