[IMP] check_assign/action_assign in picking

bzr revid: qdp-launchpad@openerp.com-20130625122432-3p9sc2f082cfenjp
This commit is contained in:
Quentin (OpenERP) 2013-06-25 14:24:32 +02:00
parent 75432056b9
commit 58b2b57fa3
2 changed files with 5 additions and 3 deletions

View File

@ -1001,7 +1001,7 @@ class stock_picking(osv.osv):
# TODO: Check locations to see if in the same location ?
return True
def action_assign(self, cr, uid, ids, *args):
def check_assign(self, cr, uid, ids, *args):
""" Changes state of picking to available if all moves are confirmed.
@return: True
"""
@ -1062,6 +1062,8 @@ class stock_picking(osv.osv):
""" Changes picking state to assigned.
@return: True
"""
for picking in self.browse(cr, uid, ids, context=context):
self.pool.get('stock.move').action_assign(cr, uid, [move.id for move in picking.move_lines], context=context)
self.write(cr, uid, ids, {'state': 'assigned'})
return True

View File

@ -759,7 +759,7 @@
<header>
<button name="draft_force_assign" states="draft" string="Confirm" type="object" class="oe_highlight" groups="base.group_user"/>
<button name="draft_validate" states="draft" string="Confirm &amp; Transfer" type="object" class="oe_highlight" groups="base.group_user"/>
<!-- <button name="action_assign" states="confirmed" string="Check Availability" type="object"/> -->
<!-- <button name="check_assign" states="confirmed" string="Check Availability" type="object"/> -->
<button name="force_assign" states="confirmed" string="Force Availability" type="object" class="oe_highlight" groups="base.group_user"/>
<button name="action_process" states="assigned" string="Confirm &amp; Transfer" groups="stock.group_stock_user" type="object" class="oe_highlight"/>
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice/Refund" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" class="oe_highlight" groups="base.group_user"/>
@ -909,7 +909,7 @@
</xpath>
<xpath expr="/form/header//button[@name='draft_validate']" position="replace">
<button name="draft_validate" states="draft" string="Confirm &amp; Deliver" type="object" class="oe_highlight"/>
<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
<button name="check_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
</xpath>
<xpath expr="/form/header//button[@name='action_process']" position="replace">
<button name="action_process" states="assigned" string="Deliver" type="object" class="oe_highlight"/>