~vauxoo/addons-vauxoo/8.0-import_tax_tariff-dev-yani-rev-2

« back to all changes in this revision

Viewing changes to mrp_request_return_cancel/mrp.py

  • Committer: Nhomar Hernandez
  • Date: 2013-04-19 20:33:12 UTC
  • mfrom: (542.1.314 addons-vauxoo)
  • Revision ID: nhomar@gmail.com-20130419203312-o35v7dn79l6vur0t
[MERGE - PEP8 AND V7-MIG] All migrated to V7 Just
improved osv.osv => osv.Model, osv.osv_memory => osv.TransientModel
import inside openerp.* enviroment
Erased class instansiation no necesarry anymore in V7
AUTOPEP8 run, Left PEP8 long lines manually.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
24
#
25
25
##############################################################################
26
 
from osv import osv, fields
27
 
from tools.translate import _
 
26
from openerp.osv import osv, fields
 
27
from openerp.tools.translate import _
 
28
 
28
29
from datetime import datetime
29
 
import netsvc
30
 
    
31
 
class mrp_production(osv.osv):
 
30
import openerp.netsvc as netsvc
 
31
 
 
32
 
 
33
class mrp_production(osv.Model):
32
34
    _inherit = "mrp.production"
33
 
    
 
35
 
34
36
    def action_cancel(self, cr, uid, ids, context=None):
35
37
 
36
38
        if context is None:
37
39
            context = {}
38
 
            
 
40
 
39
41
        wf_service = netsvc.LocalService("workflow")
40
 
        
 
42
 
41
43
        move_obj = self.pool.get('stock.move')
42
44
        for production in self.browse(cr, uid, ids, context=context):
43
45
            for line in production.picking_ids:
44
 
                wf_service.trg_validate(uid, 'stock.picking', line.id, 'button_cancel', cr)
 
46
                wf_service.trg_validate(
 
47
                    uid, 'stock.picking', line.id, 'button_cancel', cr)
45
48
        return super(mrp_production, self).action_cancel(cr, uid, ids, context=context)
46
 
    
47
 
mrp_production()
 
 
b'\\ No newline at end of file'
 
49