[IMP] Misc improvements to kanban views

bzr revid: fme@openerp.com-20111130171818-6i5l2a8vsl14683x
This commit is contained in:
Fabien Meghazi 2011-11-30 18:18:18 +01:00
parent d899b25f76
commit 58248effa2
3 changed files with 29 additions and 51 deletions

View File

@ -142,8 +142,8 @@
<t t-name="kanban-box">
<div t-attf-class="#{kanban_color(record.color.raw_value)}">
<div class="oe_kanban_box oe_kanban_color_border">
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle">
<div class="oe_kanban_title1" tooltip="employee_details"><field name="name"/></div>
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle oe_kanban_title3" tooltip="employee_details">
<field name="name"/>
</div>
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger oe_kanban_color_border">
<img t-att-src="kanban_image('hr.employee', 'photo', record.id.value)" width="48" style="float: left;"/>

View File

@ -201,46 +201,35 @@
<field name="model">product.product</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban default_group_by="type">
<kanban>
<field name="color"/>
<field name="type"/>
<field name="product_image"/>
<field name="list_price"/>
<templates>
<t t-name="kanban-box">
<t t-set="color" t-value="kanban_color(record.color.raw_value || record.type.raw_value)"/>
<div t-att-class="color + (record.color.raw_value == 1 ? ' oe_kanban_color_alert' : '')">
<t t-if="record.type.raw_value!='service' and record.qty_available.raw_value lte 0" t-set="border">oe_kanban_color_red</t>
<div t-attf-class="#{kanban_color(record.color.raw_value)} #{border || ''}">
<div class="oe_kanban_box oe_kanban_color_border">
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle oe_kanban_title1">
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle oe_kanban_title3">
<field name="name"/>
</div>
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
<table class="oe_kanban_table">
<tr>
<td valign="top" width="48">
<img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" width="48"/>
</td>
<td>
<div class="oe_kanban_title2">
<t t-if="record.type.raw_value=='service'">No Stock</t>
<t t-if="record.type.raw_value!='service'">
<div><field name="qty_available"/> On Hand , <field name="virtual_available"/> Available</div>
<div>
<t t-if="record.list_price.raw_value!=0">Public Price : <field name="lst_price"/> ,</t>
Cost : <field name="standard_price"/>
</div>
</t>
</div>
</td>
</tr>
</table>
<img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" width="48" style="float: left; padding: 0 4px 4px 0"/>
<div t-if="record.type.raw_value == 'service'">No Stock</div>
<t t-if="record.type.raw_value != 'service'">
<div>Stock: <field name="qty_available"/> on hand, <field name="virtual_available"/> available</div>
<div t-if="record.list_price.raw_value != 0">Public Price: <field name="lst_price"/></div>
<div>Cost : <field name="standard_price"/></div>
</t>
<div class="oe_kanban_clear"/>
</div>
<div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
<div class="oe_kanban_left">
<a string="Edit" icon="gtk-edit" type="edit"/>
<a string="Change Color" icon="color-picker" type="color" name="color"/>
</div>
<br class="oe_kanban_clear"/>
</div>
<div class="oe_kanban_clear"/>
</div>
</div>
</div>

View File

@ -138,40 +138,29 @@
<field name="list_price"/>
<templates>
<t t-name="kanban-box">
<t t-set="color" t-value="kanban_color(record.color.raw_value || record.type.raw_value)"/>
<div t-att-class="color + (record.color.raw_value == 1 ? ' oe_kanban_color_alert' : '')">
<t t-if="record.type.raw_value!='service' and record.qty_available.raw_value lte 0" t-set="border">oe_kanban_color_red</t>
<div t-attf-class="#{kanban_color(record.color.raw_value)} #{border || ''}">
<div class="oe_kanban_box oe_kanban_color_border">
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle oe_kanban_title1">
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle oe_kanban_title3">
<field name="name"/>
</div>
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
<table class="oe_kanban_table">
<tr>
<td valign="top" width="48">
<img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" width="48"/>
</td>
<td>
<div class="oe_kanban_title2">
<t t-if="record.type.raw_value=='service'">No Stock</t>
<t t-if="record.type.raw_value!='service'">
<div><field name="qty_available"/> On Hand , <field name="virtual_available"/> Available</div>
<div>
<t t-if="record.list_price.raw_value!=0">Public Price : <field name="lst_price"/> ,</t>
Cost : <field name="standard_price"/>
</div>
</t>
</div>
</td>
</tr>
</table>
<img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" width="48" style="float: left; padding: 0 4px 4px 0"/>
<div t-if="record.type.raw_value == 'service'">No Stock</div>
<t t-if="record.type.raw_value != 'service'">
<div>Stock: <field name="qty_available"/> on hand, <field name="virtual_available"/> available</div>
<div t-if="record.list_price.raw_value != 0">Public Price: <field name="lst_price"/></div>
<div>Cost : <field name="standard_price"/></div>
</t>
<div class="oe_kanban_clear"/>
</div>
<div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
<div class="oe_kanban_left">
<a string="Edit" icon="gtk-edit" type="edit"/>
<a string="Change Color" icon="color-picker" type="color" name="color"/>
<a string="Update Stock" name="%(stock.action_view_change_product_quantity)d" icon="gtk-execute" type="action"/>
</div>
<br class="oe_kanban_clear"/>
</div>
<div class="oe_kanban_clear"/>
</div>
</div>
</div>