~serpent-consulting-services/addons-vauxoo/7.0-fix-aging-due-mx-dependency

« back to all changes in this revision

Viewing changes to purchase_order_type/model/purchase_order.py

  • Committer: Moises Lopez
  • Date: 2014-10-03 08:04:16 UTC
  • mfrom: (1144.1.3 70-addons-vauxoo)
  • Revision ID: moylop260@vauxoo.com-20141003080416-yquvsxfq5i4cy8ux
[MERGE] [FIX] trailing whitespace pylint error C0303 and
[FIX] autopep8 ignoring E501 & E128 and
[FIX] reimported

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    ('service', 'Services'),
31
31
]
32
32
 
 
33
 
33
34
class purchase_order(osv.Model):
34
35
 
35
36
    _inherit = 'purchase.order'
41
42
                  ' service')),
42
43
    }
43
44
 
 
45
 
44
46
class purchase_requisition(osv.Model):
45
47
 
46
48
    _inherit = 'purchase.requisition'
47
49
 
48
50
    def make_purchase_order(self, cr, uid, ids, partner_id,
49
 
                                    context=None):
 
51
                            context=None):
50
52
        if context is None:
51
53
            context = {}
52
54
        res = super(purchase_requisition, self).make_purchase_order(cr, uid, ids, partner_id, context=context)
53
 
        
54
 
        po_obj = self.pool.get('purchase.order') 
 
55
 
 
56
        po_obj = self.pool.get('purchase.order')
55
57
        for requisition in self.browse(cr, uid, ids, context=context):
56
 
            po_req = po_obj.search(cr, uid, [('requisition_id','=',requisition.id)], context=context)
 
58
            po_req = po_obj.search(cr, uid, [('requisition_id', '=', requisition.id)], context=context)
57
59
            for po_id in po_req:
58
 
                po_obj.write(cr, uid, [po_id], {'type': requisition.type }, context=context)
 
60
                po_obj.write(cr, uid, [po_id], {'type': requisition.type}, context=context)
59
61
        return res