~vauxoo/openerp-mexico-localization/7.0-l10n_mx_invoice_datetime-validate-dev-julio

« back to all changes in this revision

Viewing changes to l10n_mx_import_info/stock.py

  • Committer: Jorge Angel Naranjo Rogel
  • Date: 2013-12-16 20:10:42 UTC
  • mfrom: (323.3.10 oml7.0-ids-nuevo)
  • Revision ID: jorge_nr@vauxoo.com-20131216201042-5ce3igsy9xh23jl9
[IMP] added context=None and if context is None

Merge from lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_isinstance_ids_dev_carlos

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    }
32
32
 
33
33
    def name_get(self, cr, uid, ids, context=None):
 
34
        if context is None:
 
35
            context = {}
 
36
        ids = isinstance(ids, (int, long)) and [ids] or ids
34
37
        if not len(ids):
35
38
            return []
36
39
        # Avoiding use 000 in show name.
55
58
# product_qty_p=[{'product_id':p.product_id.id,'qty':p.qty,'uom_id':p.uom_id.id}
56
59
# for p in move.tracking_id.import_id.product_info_ids if
57
60
# p.product_id.id==move.product_id.id]
 
61
        if context is None:
 
62
            context = {}
58
63
        product_import_info_obj = self.pool.get('product.import.info')
59
64
        product_uom_obj = self.pool.get('product.uom')
60
65
        for move in self.browse(cr, uid, ids, context=context):
100
105
        # print "move.state",move.state
101
106
        # print "import_id",import_id
102
107
        # print "move.product_id.pack_control",move.product_id.pack_control
 
108
        if context is None:
 
109
            context = {}
103
110
        if move.state != 'done':
104
111
            # purchase o sale, generate a stock.move with state confirmed or
105
112
            # draft, then not validate with these states.
132
139
        @param context: context arguments, like lang, time zone
133
140
        @return: return a dict that contains new values, and context
134
141
        """
 
142
        if context is None:
 
143
            context = {}
135
144
        return {
136
145
            'value': {},
137
146
            'context': {},
141
150
        """ Checks track lot with import information is assigned to stock move or not.
142
151
        @return: True or False
143
152
        """
 
153
        if context is None:
 
154
            context = {}
144
155
        for move in self.browse(cr, uid, ids, context=context):
145
156
            # Check if i need to verify the track for import info.
146
157
            ex = True
173
184
    
174
185
    def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id,
175
186
        invoice_vals, context=None):
 
187
        if context is None:
 
188
            context = {}
176
189
        invoice_line_data = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id,
177
190
            invoice_vals, context=context)
178
191
        invoice_line_data.update({