summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorPratima Gupta <pgu@odoo.com>2020-05-11 11:40:48 +0000
committerPratima Gupta <pgu@odoo.com>2020-05-20 12:08:49 +0000
commit835dac49c3985bfb0d19c60c85695982d6f822fc (patch)
tree493edeb03fd88f5a9495618ed6a4517d0b89165a /addons
parent1ecdaa349188d11aab5211f2c8ffce99b4c7b09a (diff)
[IMP] *: update list view
This commit adapts several views to make them use newly defined widgets, the new decoration-xxx mechanism on fields, and to adapt them to the new design of buttons. used following widgets and designs - 1) decoration-bf 2) many2one_avatar_user widget 3) badge widget Task-2248231 closes odoo/odoo#51074 Related: odoo/enterprise#10528 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/mrp/views/mrp_production_views.xml14
-rw-r--r--addons/mrp/views/mrp_unbuild_views.xml4
-rw-r--r--addons/mrp/views/mrp_workorder_views.xml4
-rw-r--r--addons/product_expiry/views/production_lot_views.xml3
-rw-r--r--addons/product_expiry/views/stock_quant_views.xml5
-rw-r--r--addons/purchase_requisition/views/purchase_requisition_views.xml10
-rw-r--r--addons/repair/views/repair_views.xml9
-rw-r--r--addons/stock/views/stock_inventory_views.xml6
-rw-r--r--addons/stock/views/stock_move_line_views.xml4
-rw-r--r--addons/stock/views/stock_move_views.xml6
-rw-r--r--addons/stock/views/stock_picking_views.xml12
-rw-r--r--addons/stock/views/stock_production_lot_views.xml2
-rw-r--r--addons/stock/views/stock_quant_views.xml6
-rw-r--r--addons/stock/views/stock_scrap_views.xml6
-rw-r--r--addons/stock_landed_costs/views/stock_landed_cost_views.xml4
-rw-r--r--addons/stock_picking_batch/views/stock_picking_batch_views.xml10
16 files changed, 48 insertions, 57 deletions
diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml
index 040e711af94..25c876f8e0e 100644
--- a/addons/mrp/views/mrp_production_views.xml
+++ b/addons/mrp/views/mrp_production_views.xml
@@ -6,24 +6,22 @@
<field name="name">mrp.production.tree</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
- <tree string="Manufacturing Orders" default_order="date_planned_start desc"
- decoration-info="state=='confirmed'"
- decoration-danger="date_planned_start&lt;current_date and state not in ('done','cancel')"
- decoration-muted="state in ('done','cancel')" multi_edit="1">
+ <tree string="Manufacturing Orders" default_order="date_planned_start desc" multi_edit="1">
<field name="message_needaction" invisible="1"/>
- <field name="name"/>
+ <field name="name" decoration-bf="1"/>
<field name="date_planned_start" readonly="1" optional="show"
- attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}"/>
+ attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}" decoration-danger="date_planned_start&lt;current_date and state not in ('done','cancel')"/>
+ <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="hide"/>
<field name="product_id" readonly="1" optional="show"/>
<field name="product_uom_id" string="Unit of Measure" options="{'no_open':True,'no_create':True}" groups="uom.group_uom" optional="show"/>
<field name="bom_id" readonly="1" optional="hide"/>
<field name="origin" optional="show"/>
- <field name="user_id" optional="hide"/>
+ <field name="user_id" optional="hide" widget="many2one_avatar_user"/>
<field name="routing_id" groups="mrp.group_mrp_routings" optional="show"/>
<field name="reservation_state" optional="show"/>
<field name="product_qty" sum="Total Qty" string="Quantity" readonly="1" optional="show"/>
- <field name="state" optional="show"/>
<field name="company_id" readonly="1" groups="base.group_multi_company" optional="show"/>
+ <field name="state" optional="show" widget='badge' decoration-success="state == 'done'" decoration-info="state not in ('done', 'cancel')"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
<field name="delay_alert_date" invisible="1"/>
<field string=" " name="json_popover" widget="stock_rescheduling_popover" attrs="{'invisible': [('delay_alert_date', '=', False)]}"/>
diff --git a/addons/mrp/views/mrp_unbuild_views.xml b/addons/mrp/views/mrp_unbuild_views.xml
index 3722e6b124d..da34aa1c8f5 100644
--- a/addons/mrp/views/mrp_unbuild_views.xml
+++ b/addons/mrp/views/mrp_unbuild_views.xml
@@ -175,17 +175,17 @@
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<tree>
- <field name="name"/>
+ <field name="name" decoration-bf="1"/>
<field name="product_id"/>
<field name="bom_id"/>
<field name="mo_id"/>
<field name="lot_id" groups="stock.group_production_lot"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
- <field name="state"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
<field name="company_id" groups="base.group_multi_company"/>
+ <field name="state" widget='badge' decoration-success="state == 'done'" decoration-info="state == 'draft'"/>
</tree>
</field>
</record>
diff --git a/addons/mrp/views/mrp_workorder_views.xml b/addons/mrp/views/mrp_workorder_views.xml
index 8b0637acb9d..81df6f6c9c3 100644
--- a/addons/mrp/views/mrp_workorder_views.xml
+++ b/addons/mrp/views/mrp_workorder_views.xml
@@ -64,9 +64,9 @@
<field name="name">mrp.production.work.order.tree</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
- <tree string="Work Orders" delete="0" create="0" decoration-success="date_planned_start&gt;=current_date and state == 'ready'" decoration-muted="state in ('done','cancel')" decoration-danger="date_planned_start&lt;current_date and state in ('ready')">
+ <tree string="Work Orders" delete="0" create="0">
<field name="name"/>
- <field name="date_planned_start"/>
+ <field name="date_planned_start" decoration-danger="date_planned_start&lt;current_date and state in ('ready')"/>
<field name="workcenter_id" widget="selection"/>
<field name="production_id"/>
<field name="product_id"/>
diff --git a/addons/product_expiry/views/production_lot_views.xml b/addons/product_expiry/views/production_lot_views.xml
index 3219eff5690..34a5a14450f 100644
--- a/addons/product_expiry/views/production_lot_views.xml
+++ b/addons/product_expiry/views/production_lot_views.xml
@@ -44,10 +44,11 @@
<field name="inherit_id" ref="stock.view_production_lot_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='create_date']" position="after">
+ <field name="product_qty" invisible="1"/>
+ <field name="alert_date" optional="hide" widget='remaining_days' attrs="{'invisible': [('product_qty', '&lt;=', 0)]}"/>
<field name="use_date" optional="hide"/>
<field name="removal_date" optional="hide"/>
<field name="expiration_date" optional="hide"/>
- <field name="alert_date" optional="hide"/>
</xpath>
</field>
</record>
diff --git a/addons/product_expiry/views/stock_quant_views.xml b/addons/product_expiry/views/stock_quant_views.xml
index 7415b66f371..07e914ec25c 100644
--- a/addons/product_expiry/views/stock_quant_views.xml
+++ b/addons/product_expiry/views/stock_quant_views.xml
@@ -32,11 +32,6 @@
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
<field name="arch" type="xml">
- <xpath expr="//tree" position="attributes">
- <attribute name="decoration-danger">
- removal_date &lt; current_date or inventory_quantity &lt; 0
- </attribute>
- </xpath>
<xpath expr="//field[@name='inventory_quantity']" position="before">
<field name="removal_date" optional="show"
invisible="context.get('hide_removal_date')"/>
diff --git a/addons/purchase_requisition/views/purchase_requisition_views.xml b/addons/purchase_requisition/views/purchase_requisition_views.xml
index d3122ffbd98..cfff7799891 100644
--- a/addons/purchase_requisition/views/purchase_requisition_views.xml
+++ b/addons/purchase_requisition/views/purchase_requisition_views.xml
@@ -193,16 +193,16 @@
<field name="name">purchase.requisition.tree</field>
<field name="model">purchase.requisition</field>
<field name="arch" type="xml">
- <tree decoration-muted="state == 'cancel'" decoration-danger="date_end and date_end&lt;current_date" string="Purchase Agreements">
+ <tree string="Purchase Agreements">
<field name="message_needaction" invisible="1"/>
- <field name="name"/>
- <field name="user_id" optional="show"/>
+ <field name="name" decoration-bf="1"/>
+ <field name="user_id" optional="show" widget='many2one_avatar_user'/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" optional="show"/>
<field name="ordering_date" optional="show"/>
<field name="schedule_date" optional="hide"/>
- <field name="date_end" optional="show"/>
+ <field name="date_end" optional="show" widget='remaining_days' decoration-danger="date_end and date_end&lt;current_date" attrs="{'invisible': [('state','in', ('done', 'cancel'))]}"/>
<field name="origin" optional="show"/>
- <field name="state" optional="show"/>
+ <field name="state" optional="show" widget='badge' decoration-success="state == 'done'" decoration-info="state not in ('done', 'cancel')"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</tree>
</field>
diff --git a/addons/repair/views/repair_views.xml b/addons/repair/views/repair_views.xml
index a0fd4177c42..2ceddfa433f 100644
--- a/addons/repair/views/repair_views.xml
+++ b/addons/repair/views/repair_views.xml
@@ -6,19 +6,18 @@
<field name="name">repair.tree</field>
<field name="model">repair.order</field>
<field name="arch" type="xml">
- <tree string="Repairs order" multi_edit="1"
- decoration-muted="state in ('done','cancel')" decoration-info="state=='draft'">
- <field name="name" />
+ <tree string="Repairs order" multi_edit="1">
+ <field name="name"/>
<field name="product_id" readonly="1" optional="show"/>
<field name="product_qty" optional="hide" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" readonly="1" optional="hide"/>
- <field name="user_id" optional="hide"/>
+ <field name="user_id" optional="hide" widget='many2one_avatar_user'/>
<field name="partner_id" readonly="1" optional="show"/>
<field name="address_id" optional="show"/>
<field name="guarantee_limit" optional="show"/>
<field name="location_id" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" readonly="1" optional="show"/>
- <field name="state" optional="show"/>
+ <field name="state" optional="show" widget='badge' decoration-success="state == 'done'" decoration-info="state not in ('done', 'cancel')"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</tree>
</field>
diff --git a/addons/stock/views/stock_inventory_views.xml b/addons/stock/views/stock_inventory_views.xml
index 76c5853e091..e9bf7205d67 100644
--- a/addons/stock/views/stock_inventory_views.xml
+++ b/addons/stock/views/stock_inventory_views.xml
@@ -104,13 +104,13 @@
<field name="name">stock.inventory.tree</field>
<field name="model">stock.inventory</field>
<field name="arch" type="xml">
- <tree string="Lot/Serial Number Inventory" decoration-muted="state == 'cancel'">
- <field name="name"/>
+ <tree string="Lot/Serial Number Inventory">
<field name="date"/>
+ <field name="name"/>
<field name="location_ids" widget="many2many_tags" optional="hide" groups="stock.group_stock_multi_locations"/>
<field name="product_ids" widget="many2many_tags" optional="hide"/>
- <field name="state"/>
<field name="company_id" groups="base.group_multi_company" optional="show"/>
+ <field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state in ('draft', 'confirm')"/>
</tree>
</field>
</record>
diff --git a/addons/stock/views/stock_move_line_views.xml b/addons/stock/views/stock_move_line_views.xml
index 82f166eb2e2..f655cde96b6 100644
--- a/addons/stock/views/stock_move_line_views.xml
+++ b/addons/stock/views/stock_move_line_views.xml
@@ -4,7 +4,7 @@
<field name="name">stock.move.line.tree</field>
<field name="model">stock.move.line</field>
<field name="arch" type="xml">
- <tree decoration-muted="state == 'cancel'" decoration-danger="(state not in ('cancel','done'))" string="Move Lines" create="0" default_order="date">
+ <tree string="Move Lines" create="0" default_order="date">
<field name="date"/>
<field name="reference" string="Reference"
invisible="context.get('no_reference', False)"/>
@@ -14,8 +14,8 @@
<field name="location_dest_id"/>
<field name="qty_done" string="Quantity Done"/>
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
- <field name="state"/>
<field name="company_id" groups="base.group_multi_company" force_save="1"/>
+ <field name="state" widget='badge' decoration-success="state == 'done'" decoration-info="state not in ('done', 'cancel')"/>
</tree>
</field>
</record>
diff --git a/addons/stock/views/stock_move_views.xml b/addons/stock/views/stock_move_views.xml
index 71a972c3727..46e55055e4b 100644
--- a/addons/stock/views/stock_move_views.xml
+++ b/addons/stock/views/stock_move_views.xml
@@ -50,8 +50,8 @@
<field name="model">stock.move</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
- <tree decoration-muted="state == 'cancel'" decoration-danger="(state not in ('cancel','done')) and date > current_date" string="Moves" create="0">
- <field name="date" groups="base.group_no_one"/>
+ <tree string="Moves" create="0">
+ <field name="date" groups="base.group_no_one" decoration-danger="(state not in ('cancel','done')) and date > current_date" />
<field name="reference"/>
<field name="picking_type_id" invisible="1"/>
<field name="create_date" invisible="1" groups="base.group_no_one"/>
@@ -60,8 +60,8 @@
<field name="location_dest_id" options="{'no_create': True}" string="To"/>
<field name="product_uom_qty"/>
<field name="product_uom" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
- <field name="state"/>
<field name="company_id" groups="base.group_multi_company"/>
+ <field name="state" widget='badge' decoration-success="state == 'done'" decoration-info="state not in ('done', 'cancel')"/>
</tree>
</field>
</record>
diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml
index 1c00241c427..23f574312fd 100644
--- a/addons/stock/views/stock_picking_views.xml
+++ b/addons/stock/views/stock_picking_views.xml
@@ -189,24 +189,22 @@
<field name="name">stock.picking.tree</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
- <tree string="Picking list" multi_edit="1"
- decoration-info="state == 'draft'" decoration-muted="state == 'cancel'"
- decoration-danger="state not in ('cancel', 'done') and scheduled_date &lt; current_date">
- <field name="name"/>
+ <tree string="Picking list" multi_edit="1">
+ <field name="name" decoration-bf="1"/>
<field name="location_id" options="{'no_create': True}" string="From" groups="stock.group_stock_multi_locations" optional="show"/>
<field name="location_dest_id" options="{'no_create': True}" string="To" groups="stock.group_stock_multi_locations" optional="show"/>
<field name="partner_id" optional="show"/>
<field name="signature" string="Signed" optional="hide" widget="boolean" groups="stock.group_stock_sign_delivery"/>
- <field name="user_id" optional="hide"/>
+ <field name="user_id" optional="hide" widget="many2one_avatar_user"/>
<field name="date" invisible="1"/>
- <field name="scheduled_date" optional="show"/>
+ <field name="scheduled_date" optional="show" decoration-danger="scheduled_date &lt; current_date and state not in ('done', 'cancel')"/>
<field name="origin" optional="show"/>
<field name="group_id" invisible="1"/>
<field name="backorder_id" optional="hide"/>
- <field name="state" optional="show"/>
<field name="priority" optional="hide"/>
<field name="picking_type_id" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="show"/>
+ <field name="state" optional="show" widget="badge" decoration-success="state == 'done'" decoration-info="state not in ('done', 'cancel')"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
<field name="delay_alert_date" invisible="1"/>
<field name="json_popover" string=" " widget="stock_rescheduling_popover" attrs="{'invisible': [('delay_alert_date', '=', False)]}"/>
diff --git a/addons/stock/views/stock_production_lot_views.xml b/addons/stock/views/stock_production_lot_views.xml
index bccc9e18d95..b03b03dad66 100644
--- a/addons/stock/views/stock_production_lot_views.xml
+++ b/addons/stock/views/stock_production_lot_views.xml
@@ -52,7 +52,7 @@
<field name="model">stock.production.lot</field>
<field name="arch" type="xml">
<tree string="Lots/Serial Numbers" multi_edit="1">
- <field name="name"/>
+ <field name="name" decoration-bf="1"/>
<field name="ref" optional="show"/>
<field name="product_id" readonly="1"/>
<field name="create_date" optional="show"/>
diff --git a/addons/stock/views/stock_quant_views.xml b/addons/stock/views/stock_quant_views.xml
index dcc20ae9081..e80addc5e95 100644
--- a/addons/stock/views/stock_quant_views.xml
+++ b/addons/stock/views/stock_quant_views.xml
@@ -75,7 +75,7 @@
<field name="model">stock.quant</field>
<field eval="10" name="priority"/>
<field name="arch" type="xml">
- <tree decoration-danger="inventory_quantity &lt; 0" editable="bottom"
+ <tree editable="bottom"
create="1" edit="1" import="0" js_class="singleton_list">
<field name="id" invisible="1"/>
<field name="tracking" invisible="1"/>
@@ -100,7 +100,7 @@
options="{'no_create': True}"/>
<field name="quantity" string="On Hand Quantity"
invisible="1"/>
- <field name="inventory_quantity" string="On Hand Quantity"
+ <field name="inventory_quantity" string="On Hand Quantity" decoration-danger="inventory_quantity &lt; 0"
readonly="0"/>
<field name="available_quantity" optional="show"/>
<field name="product_uom_id" groups="uom.group_uom"/>
@@ -115,7 +115,7 @@
<field eval="10" name="priority"/>
<field name="arch" type="xml">
<tree string="Inventory Valuation" js_class="inventory_report_list"
- create="0" delete="0" decoration-danger="quantity &lt; 0">
+ create="0" delete="0">
<field name="product_id" invisible="context.get('single_product', False)"/>
<field name="location_id" invisible="context.get('hide_location', False)"/>
<field name="lot_id" groups="stock.group_production_lot"
diff --git a/addons/stock/views/stock_scrap_views.xml b/addons/stock/views/stock_scrap_views.xml
index ade2b90a16e..ce23049925d 100644
--- a/addons/stock/views/stock_scrap_views.xml
+++ b/addons/stock/views/stock_scrap_views.xml
@@ -118,16 +118,16 @@
<field name="name">stock.scrap.tree</field>
<field name="model">stock.scrap</field>
<field name="arch" type="xml">
- <tree multi_edit="1" decoration-danger="state == 'draft'">
- <field name="name"/>
+ <tree multi_edit="1">
+ <field name="name" decoration-bf="1"/>
<field name="date_done"/>
<field name="product_id" readonly="1"/>
<field name="scrap_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="scrap_location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
- <field name="state"/>
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
+ <field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state == 'draft'"/>
</tree>
</field>
</record>
diff --git a/addons/stock_landed_costs/views/stock_landed_cost_views.xml b/addons/stock_landed_costs/views/stock_landed_cost_views.xml
index cc8dd4373b8..7933f52a71b 100644
--- a/addons/stock_landed_costs/views/stock_landed_cost_views.xml
+++ b/addons/stock_landed_costs/views/stock_landed_cost_views.xml
@@ -122,10 +122,10 @@
<field name="model">stock.landed.cost</field>
<field name="arch" type="xml">
<tree string="Landed Costs">
- <field name="name"/>
+ <field name="name" decoration-bf="1"/>
<field name="date"/>
- <field name="state"/>
<field name="company_id" groups="base.group_multi_company"/>
+ <field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state == 'draft'"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</tree>
</field>
diff --git a/addons/stock_picking_batch/views/stock_picking_batch_views.xml b/addons/stock_picking_batch/views/stock_picking_batch_views.xml
index b094234f657..14a2214115b 100644
--- a/addons/stock_picking_batch/views/stock_picking_batch_views.xml
+++ b/addons/stock_picking_batch/views/stock_picking_batch_views.xml
@@ -138,11 +138,11 @@
<field name="name">stock.picking.batch.tree</field>
<field name="model">stock.picking.batch</field>
<field name="arch" type="xml">
- <tree string="Stock Batch Transfer" decoration-muted="state=='cancel'" multi_edit="1">
- <field name="name"/>
- <field name="user_id"/>
- <field name="state"/>
+ <tree string="Stock Batch Transfer" multi_edit="1">
+ <field name="name" decoration-bf="1"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
<field name="company_id" groups="base.group_multi_company"/>
+ <field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state in ('draft', 'in_progress')"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</tree>
</field>
@@ -230,7 +230,7 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree"/>
<field name="arch" type="xml">
- <xpath expr="//field[@name='state']" position="before">
+ <xpath expr="//field[@name='company_id']" position="before">
<field name="batch_id" optional="show"
domain="[
('state', 'in', ['draft', 'in_progress']),