summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgo@tinyerp.com <>2013-03-07 16:38:12 +0530
committersgo@tinyerp.com <>2013-03-07 16:38:12 +0530
commit97ca9d233ab6e1aae3c8c6bcd7d609fc08fcd3ae (patch)
tree2e535a089df85f8a3bb040305a23d74918bce004
parentd29957f302f8aa1ec24d9fa92ac990e8f50aec74 (diff)
parent591eb1c74d772ff03cd1d70d677ecac5558ca78d (diff)
[MERGE]sync with trunk
bzr revid: sgo@tinyerp.com-20130307110812-h0r3bohva0bif8s7
-rw-r--r--addons/sale/sale.py13
-rw-r--r--addons/sale_stock/stock.py10
2 files changed, 10 insertions, 13 deletions
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 19f9e9ff857..62aca05c78c 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -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:
diff --git a/addons/sale_stock/stock.py b/addons/sale_stock/stock.py
index 93acf8579f5..e1070998ae8 100644
--- a/addons/sale_stock/stock.py
+++ b/addons/sale_stock/stock.py
@@ -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