odoo_dev 开发培训作业:图书管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
6.5KB

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