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

« back to all changes in this revision

Viewing changes to mrp_production_procurement_order/procurement.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:
24
24
#
25
25
##############################################################################
26
26
 
27
 
from tools.translate import _
28
 
from osv import osv, fields
29
 
 
30
 
class procurement_order(osv.osv):
 
27
from openerp.tools.translate import _
 
28
 
 
29
from openerp.osv import osv, fields
 
30
 
 
31
 
 
32
class procurement_order(osv.Model):
31
33
    _inherit = "procurement.order"
32
 
    
 
34
 
33
35
    _columns = {
34
36
        'production_ids': fields.many2many('mrp.production', 'mrp_production_procurement_order_rel', 'procurement_id', 'production_id', 'Production orders'),
35
37
        'production_created': fields.many2one('mrp.production', 'Production order'),
36
38
    }
37
 
    
 
39
 
38
40
    def make_mo(self, cr, uid, ids, context=None):
39
41
        """ writes the production created to the procurement
40
42
        @return: same res than original make_mo
41
43
        """
42
 
        res = super(procurement_order, self).make_mo(cr, uid, ids, context=context)
 
44
        res = super(procurement_order, self).make_mo(
 
45
            cr, uid, ids, context=context)
43
46
        for line in res:
44
47
            self.write(cr, uid, [line], {'production_created': res.get(line)})
45
48
        return res
46
49
 
47
 
procurement_order()
 
 
b'\\ No newline at end of file'