[IMP] purchase: responsiveness (+mobile)

> support kanban view for order lines in puchase form view.

closes odoo/odoo#34737

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Victor Feyens
2019-07-16 08:38:30 +00:00
parent 561829849f
commit 8f137f66bc
+57
View File
@@ -183,6 +183,7 @@
<page string="Products">
<field name="order_line"
widget="section_and_note_one2many"
mode="tree,kanban"
attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}">
<tree string="Purchase Order Lines" editable="bottom">
<control>
@@ -267,6 +268,62 @@
<label for="name" string="Note" attrs="{'invisible': [('display_type', '!=', 'line_note')]}"/>
<field name="name" nolabel="1" attrs="{'invisible': [('display_type', '=', False)]}"/>
</form>
<kanban class="o_kanban_mobile">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom" groups="uom.group_uom"/>
<field name="price_subtotal"/>
<field name="price_tax" invisible="1"/>
<field name="price_total" invisible="1"/>
<field name="price_unit"/>
<field name="display_type"/>
<field name="taxes_id" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click {{ record.display_type.raw_value ? 'o_is_' + record.display_type.raw_value : '' }}">
<t t-if="!record.display_type.raw_value">
<div class="row">
<div class="col-8">
<strong>
<span t-esc="record.product_id.value"/>
</strong>
</div>
<div class="col-4">
<strong>
<span t-esc="record.price_subtotal.value" class="float-right text-right"/>
</strong>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
<span>
Quantity:
<t t-esc="record.product_qty.value"/>
<t t-esc="record.product_uom.value"/>
</span>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
<span>
Unit Price:
<t t-esc="record.price_unit.value"/>
</span>
</div>
</div>
</t>
<div
t-elif="record.display_type.raw_value === 'line_section' || record.display_type.raw_value === 'line_note'"
class="row">
<div class="col-12">
<span t-esc="record.name.value"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
<group class="oe_subtotal_footer oe_right">
<field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>