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.

111 line
5.9KB

  1. <?xml version="1.0"?>
  2. <odoo>
  3. <record id="library_checkout_kanban" model="ir.ui.view">
  4. <field name="model">library.checkout</field>
  5. <field name="arch" type="xml">
  6. <kanban default_group_by="stage_id" class="o_kanban_small_column">
  7. <!-- Fields -->
  8. <field name="stage_id" />
  9. <field name="id" />
  10. <field name="color" />
  11. <field name="kanban_state" />
  12. <field name="priority" />
  13. <field name="message_partner_ids" />
  14. <!-- Optional progress bar -->
  15. <progressbar
  16. field="kanban_state"
  17. colors='{"done": "success", "blocked": "danger"}' />
  18. <!-- Templates with HTML snippets to use -->
  19. <templates>
  20. <t t-name="kanban-box">
  21. <!-- Set the Kanban Card color -->
  22. <div t-attf-class="
  23. oe_kanban_color_#{kanban_getcolor(record.color.raw_value)}
  24. oe_kanban_global_click">
  25. <div class="o_dropdown_kanban dropdown">
  26. <!-- Top-right drop down menu here... -->
  27. <a class="dropdown-toggle btn"
  28. data-toggle="dropdown" role="button"
  29. aria-label="Dropdown menu"
  30. title="Dropdown menu"
  31. href="#">
  32. <span class="fa fa-ellipsis-v" />
  33. </a>
  34. <div class="dropdown-menu" role="menu">
  35. <!-- Edit and Delete actions, if available: -->
  36. <t t-if="widget.editable">
  37. <a role="menuitem" type="edit" class="dropdown-item">Edit</a>
  38. </t>
  39. <t t-if="widget.deletable">
  40. <a role="menuitem" type="delete" class="dropdown-item">Delete</a>
  41. </t>
  42. <!-- Color picker option -->
  43. <ul class="oe_kanban_colorpicker" data-field="color" />
  44. </div>
  45. </div>
  46. <div class="o_kanban_record_body">
  47. <!-- Content elements and fields go here... -->
  48. <div>
  49. <strong>
  50. <a type="open"><field name="member_id" /></a>
  51. </strong>
  52. </div>
  53. <ul>
  54. <!--
  55. <li t-attf-class="oe_kanban_text_{{
  56. record.priority.raw_value lt '2' ? 'black' : 'red'}}">
  57. <field name="user_id" />
  58. </li>
  59. -->
  60. <t t-set="red_or_black"
  61. t-value="record.priority.raw_value gte '2' ? 'oe_kanban_text_red' :''" />
  62. <li t-att-class="red_or_black">
  63. <field name="user_id" />
  64. </li>
  65. <li><field name="request_date" /></li>
  66. </ul>
  67. </div>
  68. <div class="o_kanban_record_bottom">
  69. <div class="oe_kanban_bottom_left">
  70. <!-- Left hand bottom... -->
  71. <field name="priority" widget="priority" />
  72. <field name="activity_ids" widget="kanban_activity" />
  73. </div>
  74. <div class="oe_kanban_bottom_right">
  75. <!-- Right hand bottom... -->
  76. <field name="kanban_state"
  77. widget="kanban_state_selection" />
  78. <img t-att-src="kanban_image(
  79. 'library.checkout',
  80. 'member_image',
  81. record.id.raw_value)"
  82. t-att-title="record.member_id.value"
  83. t-att-alt="record.member_id.value"
  84. width="24"
  85. height="24"
  86. class="oe_kanban_avatar"
  87. />
  88. <t t-call="follower_avatars">
  89. <t t-set="arg_max" t-value="3" />
  90. </t>
  91. </div>
  92. </div>
  93. <div class="oe_clear" />
  94. </div>
  95. </t>
  96. <t t-name="follower_avatars">
  97. <div>
  98. <t t-foreach="record.message_partner_ids.raw_value.slice(0, arg_max)"
  99. t-as="rec">
  100. <img t-att-src="kanban_image('res.partner', 'image_128', rec)"
  101. class="oe_avatar" width="24" height="24" alt="" />
  102. </t>
  103. </div>
  104. </t>
  105. </templates>
  106. </kanban>
  107. </field>
  108. </record>
  109. </odoo>
上海开阖软件有限公司 沪ICP备12045867号-1