[IMP] stock: update UX of stock moves report
Minor UX updates to stock moves report:
- don't default groupby source location
- order list by date
- rename "Units of Measure" column to "Unit"
- add color to quantity field (green = incoming qty into stock, red =
outgoing, black = all others [i.e. internal transfers/external
locations only, etc]
- search filter order updated
- make to location_{dest_}id text-muted when not a physical location
(i.e. internal/transit)
- display "Quantity" instead of "Demand" for product_uom_qty and show
sum at bottom of list
"stock moves" part of b2b task: 2882539
Part-of: odoo/odoo#97109
This commit is contained in:
@@ -80,6 +80,8 @@ class StockMove(models.Model):
|
||||
auto_join=True, index=True, required=True,
|
||||
check_company=True,
|
||||
help="Location where the system will stock the finished products.")
|
||||
location_usage = fields.Selection(string="Source Location Type", related='location_id.usage')
|
||||
location_dest_usage = fields.Selection(string="Destination Location Type", related='location_dest_id.usage')
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', 'Destination Address ',
|
||||
states={'done': [('readonly', True)]},
|
||||
|
||||
@@ -30,16 +30,22 @@
|
||||
<field name="model">stock.move</field>
|
||||
<field eval="8" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Moves" create="0">
|
||||
<field name="date" groups="base.group_no_one" decoration-danger="(state not in ('cancel','done')) and date > current_date" />
|
||||
<tree string="Moves" create="0" default_order="date desc">
|
||||
<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="location_usage" invisible="1"/>
|
||||
<field name="location_dest_usage" invisible="1"/>
|
||||
<field name="product_id"/>
|
||||
<field name="location_id" options="{'no_create': True}" string="From"/>
|
||||
<field name="location_dest_id" options="{'no_create': True}" string="To"/>
|
||||
<field name="location_id" options="{'no_create': True}" string="From"
|
||||
decoration-muted="location_usage not in ('internal','transit')"/>
|
||||
<field name="location_dest_id" options="{'no_create': True}" string="To"
|
||||
decoration-muted="location_dest_usage not in ('internal','transit')"/>
|
||||
<field name="product_packaging_id" optional="hide" groups="product.group_stock_packaging"/>
|
||||
<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="product_uom_qty" string="Quantity" sum="Total Quantity"
|
||||
decoration-danger="(location_usage in ('internal','transit')) and (location_dest_usage not in ('internal','transit'))"
|
||||
decoration-success="(location_usage not in ('internal','transit')) and (location_dest_usage in ('internal','transit'))"/>
|
||||
<field name="product_uom" options="{'no_open': True, 'no_create': True}" string="Unit" groups="uom.group_uom"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="state" widget='badge' optional="show"
|
||||
decoration-danger="state=='cancel'"
|
||||
@@ -363,9 +369,9 @@
|
||||
<field eval="3" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Stock Moves">
|
||||
<field name="origin" filter_domain="['|', '|', ('origin', 'ilike', self), ('name', 'ilike', self), ('picking_id', 'ilike', self)]" string="Reference"/>
|
||||
<field name="name" string="Location" filter_domain="['|',('location_id', 'ilike', self),('location_dest_id', 'ilike', self)]" groups="stock.group_stock_multi_locations"/>
|
||||
<field name="product_id"/>
|
||||
<field name="name" string="Location" filter_domain="['|',('location_id', 'ilike', self),('location_dest_id', 'ilike', self)]"/>
|
||||
<field name="origin" filter_domain="['|', '|', ('origin', 'ilike', self), ('name', 'ilike', self), ('picking_id', 'ilike', self)]" string="Reference"/>
|
||||
<field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id', 'child_of', self)]"/>
|
||||
<filter string="Ready" name="ready" domain="[('state','=','assigned')]" help="Stock moves that are Available (Ready to process)"/>
|
||||
<filter string="To Do" name="future" domain="[('state','in',('assigned','confirmed','waiting'))]" help="Stock moves that are Confirmed, Available or Waiting"/>
|
||||
@@ -395,7 +401,7 @@
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_id" ref="view_move_tree"/>
|
||||
<field name="search_view_id" ref="view_move_search"/>
|
||||
<field name="context">{'search_default_done': 1, 'search_default_groupby_location_id': 1}</field>
|
||||
<field name="context">{'search_default_done': 1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No stock move found
|
||||
|
||||
Reference in New Issue
Block a user