~camptocamp/stock-logistic-flows/7.0-stock_picking_priority-ids-domain-1297220-gbr

« back to all changes in this revision

Viewing changes to picking_dispatch/picking_dispatch.py

Add a button on the dispatch to check the availability of all moves of the dispatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
                raise except_osv(_('Error'),
163
163
                                 _('This dispatch cannot be processed until %s') % obj.date)
164
164
 
 
165
    def action_assign_moves(self, cr, uid, ids, context=None):
 
166
        move_obj = self.pool['stock.move']
 
167
        move_ids = move_obj.search(cr, uid,
 
168
                                   [('dispatch_id', 'in', ids)],
 
169
                                   context=context)
 
170
        move_obj.action_assign(cr, uid, move_ids)
 
171
        return True
 
172
 
165
173
 
166
174
class StockMove(Model):
167
175
    _inherit = 'stock.move'