Skip to content

Commit

Permalink
Revert "[FIX] stock: Expected date on stock.picking will change, if E…
Browse files Browse the repository at this point in the history
…xpected date on stock.move changes. This fixes bug lp1266480."

This reverts commit d90d208.
  • Loading branch information
OCA git bot authored and OCA git bot committed Aug 18, 2015
1 parent c6c3d78 commit e70c207
Showing 1 changed file with 4 additions and 33 deletions.
37 changes: 4 additions & 33 deletions addons/stock/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,16 +629,6 @@ def get_min_max_date(self, cr, uid, ids, field_name, arg, context=None):
res[pick]['min_date'] = dt1
res[pick]['max_date'] = dt2
return res

def _get_stock_move_changes(self, cr, uid, ids, context=None):
'''Return the ids of pickings that should change, due to changes
in stock moves.'''
move_pool = self.pool['stock.move']
picking_ids = set()
for move_obj in move_pool.browse(cr, uid, ids, context=context):
if move_obj.picking_id:
picking_ids.add(move_obj.picking_id.id)
return list(picking_ids)

def create(self, cr, user, vals, context=None):
if ('name' not in vals) or (vals.get('name')=='/'):
Expand Down Expand Up @@ -674,31 +664,12 @@ def create(self, cr, user, vals, context=None):
* Transferred: has been processed, can't be modified or cancelled anymore\n
* Cancelled: has been cancelled, can't be confirmed anymore"""
),
'min_date': fields.function(
get_min_max_date,
fnct_inv=_set_minimum_date, multi='min_max_date',
store={
'stock.move': (
_get_stock_move_changes,
['date_expected'], 10,
)
},
type='datetime', string='Scheduled Time', select=True,
help="Scheduled time for the shipment to be processed"
),
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"),
'date': fields.datetime('Creation Date', help="Creation date, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'max_date': fields.function(
get_min_max_date,
fnct_inv=_set_maximum_date, multi='min_max_date',
store={
'stock.move': (
_get_stock_move_changes,
['date_expected'], 10,
)
},
type='datetime', string='Max. Expected Date', select=True
),
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
store=True, type='datetime', string='Max. Expected Date', select=2),
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
'product_id': fields.related('move_lines', 'product_id', type='many2one', relation='product.product', string='Product'),
'auto_picking': fields.boolean('Auto-Picking', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
Expand Down

0 comments on commit e70c207

Please sign in to comment.