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.

154 lines
6.5KB

  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="name">Checkout Form</field>
  28. <field name="model">library.checkout</field>
  29. <field name="arch" type="xml">
  30. <form>
  31. <header>
  32. <field name="state" invisible="True" />
  33. <button name="button_done"
  34. string="Return Books"
  35. attrs="{'invisible':
  36. [('state', 'in', ['new', 'done'])]}"
  37. class="oe_highlight" />
  38. <field name="stage_id"
  39. widget="statusbar"
  40. options="{'clickable': '1', 'fold_field': 'fold'}" />
  41. </header>
  42. <sheet>
  43. <field name="member_image" widget="image" class="oe_avatar" />
  44. <!-- <field name=”kanban_state” widget=”state_selection” /> -->
  45. <div class="oe_title">
  46. <label for="member_id" class="oe_edit_only" />
  47. <h1>
  48. <field name="member_id" />
  49. </h1>
  50. <h3>
  51. <span class="oe_read_only">By </span>
  52. <label for="user_id" class="oe_edit_only" />
  53. <field name="user_id" class="oe_inline" />
  54. </h3>
  55. </div>
  56. <!-- More elements will be added from here... -->
  57. <div name="button_box" class="oe_button_box">
  58. <button class="oe_stat_button"
  59. icon="fa-tasks"
  60. help="Other checkouts pending return."
  61. type="action"
  62. name="%(action_other_checkouts_button)d"
  63. context="{'default_member_id': member_id}">
  64. <field string="To Return"
  65. name="num_other_checkouts"
  66. widget="statinfo" />
  67. </button>
  68. </div>
  69. <group name="group_top">
  70. <group name="group_col1"
  71. col="4"
  72. colspan="2"
  73. string="Group 1">
  74. <field name="user_id" />
  75. <field name="state" />
  76. <field name="checkout_date" />
  77. <field name="closed_date" />
  78. </group>
  79. <group name="group_col2" string="Group2" />
  80. </group>
  81. <notebook>
  82. <page string="Borrowed Books" name="page_lines">
  83. <field name="line_ids">
  84. <tree>
  85. <field name="book_id" style="pointer-events:none" />
  86. </tree>
  87. <form>
  88. <field name="book_id" />
  89. </form>
  90. </field>
  91. </page>
  92. </notebook>
  93. </sheet>
  94. <div class="oe_chatter">
  95. <field name="message_follower_ids" widget="mail_followers" />
  96. <field name="activity_ids" widget="mail_activity" />
  97. <field name="message_ids" widget="mail_thread" />
  98. </div>
  99. </form>
  100. </field>
  101. </record>
  102. <record id="view_filter_checkout" model="ir.ui.view">
  103. <field name="model">library.checkout</field>
  104. <field name="arch" type="xml">
  105. <search>
  106. <field name="member_id" />
  107. <field name="user_id" />
  108. <filter name="filter_not_done"
  109. string="To Return"
  110. domain="[('state','=','open')]" />
  111. <filter name="filter_my_checkouts"
  112. string="My Checkouts"
  113. domain="[('user_id', '=', uid)]" />
  114. <filter name="group_user"
  115. string="By Member"
  116. context="{'group_by': 'member_id'}" />
  117. </search>
  118. </field>
  119. </record>
  120. <record id="view_calendar_checkout" model="ir.ui.view">
  121. <field name="model">library.checkout</field>
  122. <field name="arch" type="xml">
  123. <calendar date_start="request_date"
  124. color="user_id">
  125. <field name="member_id" />
  126. <field name="stage_id" />
  127. </calendar>
  128. </field>
  129. </record>
  130. <record id="view_pivot_checkout" model="ir.ui.view">
  131. <field name="model">library.checkout</field>
  132. <field name="arch" type="xml">
  133. <pivot>
  134. <field name="stage_id" type="col" />
  135. <field name="member_id" />
  136. <field name="request_date" interval="week" />
  137. <field name="num_books" type="measure" />
  138. </pivot>
  139. </field>
  140. </record>
  141. <record id="view_graph_checkout" model="ir.ui.view">
  142. <field name="model">library.checkout</field>
  143. <field name="arch" type="xml">
  144. <graph type="bar">
  145. <field name="stage_id" />
  146. <field name="num_books" type="measure" />
  147. </graph>
  148. </field>
  149. </record>
  150. </odoo>
上海开阖软件有限公司 沪ICP备12045867号-1