[IMP] procurement: use the new signal_xxx methods instead of trg_validate.
bzr revid: vmt@openerp.com-20130128100038-6dyftmdm8tfn6j5k
This commit is contained in:
parent
86680d853b
commit
f6fd7368a2
|
@ -19,10 +19,12 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from operator import attrgetter
|
||||
import time
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
import time
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
# Procurement
|
||||
|
@ -42,7 +44,6 @@ class mrp_property_group(osv.osv):
|
|||
'name': fields.char('Property Group', size=64, required=True),
|
||||
'description': fields.text('Description'),
|
||||
}
|
||||
mrp_property_group()
|
||||
|
||||
class mrp_property(osv.osv):
|
||||
"""
|
||||
|
@ -59,7 +60,6 @@ class mrp_property(osv.osv):
|
|||
_defaults = {
|
||||
'composition': lambda *a: 'min',
|
||||
}
|
||||
mrp_property()
|
||||
|
||||
class StockMove(osv.osv):
|
||||
_inherit = 'stock.move'
|
||||
|
@ -72,7 +72,6 @@ class StockMove(osv.osv):
|
|||
default['procurements'] = []
|
||||
return super(StockMove, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
StockMove()
|
||||
|
||||
class procurement_order(osv.osv):
|
||||
"""
|
||||
|
@ -456,15 +455,13 @@ class procurement_order(osv.osv):
|
|||
|
||||
class StockPicking(osv.osv):
|
||||
_inherit = 'stock.picking'
|
||||
def test_finished(self, cursor, user, ids):
|
||||
def test_finished(self, cr, uid, ids):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
res = super(StockPicking, self).test_finished(cursor, user, ids)
|
||||
for picking in self.browse(cursor, user, ids):
|
||||
res = super(StockPicking, self).test_finished(cr, uid, ids)
|
||||
for picking in self.browse(cr, uid, ids):
|
||||
for move in picking.move_lines:
|
||||
if move.state == 'done' and move.procurements:
|
||||
for procurement in move.procurements:
|
||||
wf_service.trg_validate(user, 'procurement.order',
|
||||
procurement.id, 'button_check', cursor)
|
||||
self.pool.get('procurement.order').signal_button_check(cr, uid, map(attrgetter('id'), move.procurements))
|
||||
return res
|
||||
|
||||
class stock_warehouse_orderpoint(osv.osv):
|
||||
|
|
Loading…
Reference in New Issue