Skip to content

Commit e70c207

Browse files
OCA git botOCA git bot
OCA git bot
authored and
OCA git bot
committed
Revert "[FIX] stock: Expected date on stock.picking will change, if Expected date on stock.move changes. This fixes bug lp1266480."
This reverts commit d90d208.
1 parent c6c3d78 commit e70c207

File tree

1 file changed

+4
-33
lines changed

1 file changed

+4
-33
lines changed

addons/stock/stock.py

+4-33
Original file line numberDiff line numberDiff line change
@@ -629,16 +629,6 @@ def get_min_max_date(self, cr, uid, ids, field_name, arg, context=None):
629629
res[pick]['min_date'] = dt1
630630
res[pick]['max_date'] = dt2
631631
return res
632-
633-
def _get_stock_move_changes(self, cr, uid, ids, context=None):
634-
'''Return the ids of pickings that should change, due to changes
635-
in stock moves.'''
636-
move_pool = self.pool['stock.move']
637-
picking_ids = set()
638-
for move_obj in move_pool.browse(cr, uid, ids, context=context):
639-
if move_obj.picking_id:
640-
picking_ids.add(move_obj.picking_id.id)
641-
return list(picking_ids)
642632

643633
def create(self, cr, user, vals, context=None):
644634
if ('name' not in vals) or (vals.get('name')=='/'):
@@ -674,31 +664,12 @@ def create(self, cr, user, vals, context=None):
674664
* Transferred: has been processed, can't be modified or cancelled anymore\n
675665
* Cancelled: has been cancelled, can't be confirmed anymore"""
676666
),
677-
'min_date': fields.function(
678-
get_min_max_date,
679-
fnct_inv=_set_minimum_date, multi='min_max_date',
680-
store={
681-
'stock.move': (
682-
_get_stock_move_changes,
683-
['date_expected'], 10,
684-
)
685-
},
686-
type='datetime', string='Scheduled Time', select=True,
687-
help="Scheduled time for the shipment to be processed"
688-
),
667+
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
668+
store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"),
689669
'date': fields.datetime('Creation Date', help="Creation date, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
690670
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
691-
'max_date': fields.function(
692-
get_min_max_date,
693-
fnct_inv=_set_maximum_date, multi='min_max_date',
694-
store={
695-
'stock.move': (
696-
_get_stock_move_changes,
697-
['date_expected'], 10,
698-
)
699-
},
700-
type='datetime', string='Max. Expected Date', select=True
701-
),
671+
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
672+
store=True, type='datetime', string='Max. Expected Date', select=2),
702673
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
703674
'product_id': fields.related('move_lines', 'product_id', type='many2one', relation='product.product', string='Product'),
704675
'auto_picking': fields.boolean('Auto-Picking', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),

0 commit comments

Comments
 (0)