[MERGE]sync with trunk

bzr revid: sgo@tinyerp.com-20130307110812-h0r3bohva0bif8s7
This commit is contained in:
sgo@tinyerp.com 2013-03-07 16:38:12 +05:30
commit 97ca9d233a
2 changed files with 10 additions and 13 deletions

View File

@ -1021,17 +1021,4 @@ class account_invoice(osv.Model):
sale_order_obj.message_post(cr, uid, so_ids, body=_("Invoice paid"), context=context)
return res
class stock_picking(osv.osv):
_inherit = 'stock.picking'
def action_done(self, cr, uid, ids, context=None):
""" Changes picking state to done. This method is called at the end of
the workflow by the activity "done".
"""
for record in self.browse(cr, uid, ids, context):
if record.type == "out" and record.sale_id:
self.pool.get('sale.order').message_post(cr, uid, [record.sale_id.id], body=_("Products delivered"), context=context)
return super(stock_picking, self).action_done(cr, uid, ids, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -20,6 +20,7 @@
##############################################################################
from openerp.osv import fields, osv
from openerp.tools.translate import _
class stock_move(osv.osv):
_inherit = 'stock.move'
@ -119,6 +120,15 @@ class stock_picking(osv.osv):
'invoice_ids': [(4, invoice_id)],
})
return super(stock_picking, self)._invoice_hook(cursor, user, picking, invoice_id)
def action_done(self, cr, uid, ids, context=None):
""" Changes picking state to done. This method is called at the end of
the workflow by the activity "done".
"""
for record in self.browse(cr, uid, ids, context):
if record.type == "out" and record.sale_id:
self.pool.get('sale.order').message_post(cr, uid, [record.sale_id.id], body=_("Products delivered"), context=context)
return super(stock_picking, self).action_done(cr, uid, ids, context=context)
# Redefinition of the new field in order to update the model stock.picking.out in the orm
# FIXME: this is a temporary workaround because of a framework bug (ref: lp996816). It should be removed as soon as