|
- <?xml version="1.0"?>
- <odoo>
- <record id="library_checkout_kanban" model="ir.ui.view">
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <kanban default_group_by="stage_id" class="o_kanban_small_column">
- <!-- Fields -->
- <field name="stage_id" />
- <field name="id" />
- <field name="color" />
- <field name="kanban_state" />
- <field name="priority" />
- <field name="message_partner_ids" />
-
- <!-- Optional progress bar -->
- <progressbar
- field="kanban_state"
- colors='{"done": "success", "blocked": "danger"}' />
- <!-- Templates with HTML snippets to use -->
- <templates>
- <t t-name="kanban-box">
- <!-- Set the Kanban Card color -->
- <div t-attf-class="
- oe_kanban_color_#{kanban_getcolor(record.color.raw_value)}
- oe_kanban_global_click">
- <div class="o_dropdown_kanban dropdown">
- <!-- Top-right drop down menu here... -->
- <a class="dropdown-toggle btn"
- data-toggle="dropdown" role="button"
- aria-label="Dropdown menu"
- title="Dropdown menu"
- href="#">
- <span class="fa fa-ellipsis-v" />
- </a>
- <div class="dropdown-menu" role="menu">
- <!-- Edit and Delete actions, if available: -->
- <t t-if="widget.editable">
- <a role="menuitem" type="edit" class="dropdown-item">Edit</a>
- </t>
- <t t-if="widget.deletable">
- <a role="menuitem" type="delete" class="dropdown-item">Delete</a>
- </t>
- <!-- Color picker option -->
- <ul class="oe_kanban_colorpicker" data-field="color" />
- </div>
- </div>
- <div class="o_kanban_record_body">
- <!-- Content elements and fields go here... -->
- <div>
- <strong>
- <a type="open"><field name="member_id" /></a>
- </strong>
- </div>
- <ul>
- <!--
- <li t-attf-class="oe_kanban_text_{{
- record.priority.raw_value lt '2' ? 'black' : 'red'}}">
- <field name="user_id" />
- </li>
- -->
- <t t-set="red_or_black"
- t-value="record.priority.raw_value gte '2' ? 'oe_kanban_text_red' :''" />
- <li t-att-class="red_or_black">
- <field name="user_id" />
- </li>
- <li><field name="request_date" /></li>
- </ul>
- </div>
- <div class="o_kanban_record_bottom">
- <div class="oe_kanban_bottom_left">
- <!-- Left hand bottom... -->
- <field name="priority" widget="priority" />
- <field name="activity_ids" widget="kanban_activity" />
- </div>
- <div class="oe_kanban_bottom_right">
- <!-- Right hand bottom... -->
- <field name="kanban_state"
- widget="kanban_state_selection" />
- <img t-att-src="kanban_image(
- 'library.checkout',
- 'member_image',
- record.id.raw_value)"
- t-att-title="record.member_id.value"
- t-att-alt="record.member_id.value"
- width="24"
- height="24"
- class="oe_kanban_avatar"
- />
- <t t-call="follower_avatars">
- <t t-set="arg_max" t-value="3" />
- </t>
- </div>
- </div>
- <div class="oe_clear" />
- </div>
- </t>
-
- <t t-name="follower_avatars">
- <div>
- <t t-foreach="record.message_partner_ids.raw_value.slice(0, arg_max)"
- t-as="rec">
- <img t-att-src="kanban_image('res.partner', 'image_128', rec)"
- class="oe_avatar" width="24" height="24" alt="" />
- </t>
- </div>
- </t>
- </templates>
- </kanban>
- </field>
- </record>
- </odoo>
|