~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to procurement_request/wizard/wizard_import_list.py

  • Committer: jf
  • Date: 2012-03-27 14:38:50 UTC
  • Revision ID: jf@tempo4-20120327143850-e41gh5zyjam3un11
[FIX] Default values

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        """
56
56
    }
57
57
 
58
 
    def close_window(self, cr, uid, ids, context={}):
 
58
    def close_window(self, cr, uid, ids, context=None):
59
59
        '''
60
60
        Simply close the wizard
61
61
        '''
 
62
        if context is None:
 
63
            context = {}
62
64
        return {'type': 'ir.actions.act_window',
63
65
                'res_model': 'sale.order',
64
66
                'view_type': 'form',
66
68
                'res_id': context.get('list_id'),
67
69
                'target': 'crush'}
68
70
 
69
 
    def default_get(self, cr, uid, fields, context={}):
 
71
    def default_get(self, cr, uid, fields, context=None):
70
72
        '''
71
73
        Check if the Procurement List is saved and 
72
74
        set the error message
73
75
        '''
 
76
        if context is None:
 
77
            context = {}
74
78
        res = super(wizard_import_list, self).default_get(cr, uid, fields, context=context)
75
79
 
76
80
        # If we are after the importation
92
96
        return res
93
97
 
94
98
 
95
 
    def import_file(self, cr, uid, ids, context={}):
 
99
    def import_file(self, cr, uid, ids, context=None):
96
100
        '''
97
101
        Import the file passed on the wizard in the
98
102
        Procurement List
99
103
        '''
 
104
        if context is None:
 
105
            context = {}
100
106
        list_line_obj = self.pool.get('sale.order.line')
101
107
        list_obj = self.pool.get('sale.order')
102
108
        product_obj = self.pool.get('product.product')