← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/stock-logistic-flows/7.0-picking_dispatch-check-availability into lp:stock-logistic-flows

 

Guewen Baconnier @ Camptocamp has proposed merging lp:~camptocamp/stock-logistic-flows/7.0-picking_dispatch-check-availability into lp:stock-logistic-flows.

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

Requested reviews:
  Stock and Logistic Core Editors (stock-logistic-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/stock-logistic-flows/7.0-picking_dispatch-check-availability/+merge/208402

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

-- 
https://code.launchpad.net/~camptocamp/stock-logistic-flows/7.0-picking_dispatch-check-availability/+merge/208402
Your team Stock and Logistic Core Editors is requested to review the proposed merge of lp:~camptocamp/stock-logistic-flows/7.0-picking_dispatch-check-availability into lp:stock-logistic-flows.
=== modified file 'picking_dispatch/picking_dispatch.py'
--- picking_dispatch/picking_dispatch.py	2014-02-18 09:07:52 +0000
+++ picking_dispatch/picking_dispatch.py	2014-02-26 15:31:10 +0000
@@ -162,6 +162,15 @@
                 raise except_osv(_('Error'),
                                  _('This dispatch cannot be processed until %s') % obj.date)
 
+    def action_assign_moves(self, cr, uid, ids, context=None):
+        for dispatch_id in ids:
+            move_obj = self.pool['stock.move']
+            move_ids = move_obj.search(cr, uid,
+                                       [('dispatch_id', '=', dispatch_id)],
+                                       context=context)
+            move_obj.action_assign(cr, uid, move_ids)
+        return True
+
 
 class StockMove(Model):
     _inherit = 'stock.move'

=== modified file 'picking_dispatch/picking_dispatch_view.xml'
--- picking_dispatch/picking_dispatch_view.xml	2013-04-16 14:29:17 +0000
+++ picking_dispatch/picking_dispatch_view.xml	2014-02-26 15:31:10 +0000
@@ -16,6 +16,8 @@
                     class="oe_highlight" type="object"/>
             <button name="action_cancel" states="draft,assigned,progress" string="Cancel"
                     type="object"/>
+            <button name="action_assign_moves" string="Check Availability"
+                    states="draft,assigned,progress" type="object"/>
             <field name="state" widget="statusbar" statusbar_visible="draft,confirm"/>
           </header>
           <sheet>


Follow ups