Skip to content
Permalink
Browse files

[IMP] stock: default date on stock move

When the user set the schedule date and then the moves. The default date
expected on the move is today. However two inverse function on picking
are trigger. _set_move_without_package and _set_scheduled_date.

In the case where _set_scheduled_date is trigger first it will not write
the date on the stock_move and the stock_move will be created afterward.
In this case the move will have today as date and the picking date will
remains in the future. That could be confusing for the user and
problematic for the forecast report that are focus on the move date.

In order to fix it, set a default_date on move that is equals to the
schedule date on its picking.

It remains an issue that _set_scheduled_date could trigger after
_set_move_without_package and would erase all the manual date from the
user. However it could not be fix without involve existing feature nor
adding a new button.

Task: 1849912
  • Loading branch information
amoyaux committed Dec 2, 2019
1 parent 4d43a0d commit 2ce03fa7211bab684a02495a8133d8b203cf3a4e
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/stock/views/stock_picking_views.xml
@@ -323,7 +323,7 @@
</page>

<page string="Operations">
<field name="move_ids_without_package" attrs="{'readonly': ['|', '&amp;', ('show_operations', '=', True), '|', ('is_locked', '=', True), ('state', '=', 'done'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'default_company_id': company_id, 'picking_type_code': picking_type_code, 'default_picking_id': id, 'form_view_ref':'stock.view_move_form', 'address_in_id': partner_id, 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
<field name="move_ids_without_package" attrs="{'readonly': ['|', '&amp;', ('show_operations', '=', True), '|', ('is_locked', '=', True), ('state', '=', 'done'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'default_company_id': company_id, 'picking_type_code': picking_type_code, 'default_picking_id': id, 'form_view_ref':'stock.view_move_form', 'address_in_id': partner_id, 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_date_expected': scheduled_date}">
<tree decoration-danger="not parent.immediate_transfer and state != 'done' and quantity_done > reserved_availability and show_reserved_availability" decoration-muted="scrapped == True or state == 'cancel' or (state == 'done' and is_locked == True)" string="Stock Moves" editable="bottom">
<field name="company_id" invisible="1"/>
<field name="name" invisible="1"/>

0 comments on commit 2ce03fa

Please sign in to comment.
You can’t perform that action at this time.