~unifield-team/unifield-wm/us-927

« back to all changes in this revision

Viewing changes to msf_doc_import/check_line.py

  • Committer: Olivier DOSSMANN
  • Date: 2013-03-22 13:35:49 UTC
  • mto: This revision was merged to the branch mainline in revision 1589.
  • Revision ID: od@tempo-consulting.fr-20130322133549-vnmjtnuysyee7q3e
UF-1894 [MOVE] msf_supply_doc_import to msf_doc_import directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
"""
23
23
This module is dedicated to help checking lines of Excel file at importation.
24
24
"""
25
 
from msf_supply_doc_import import MAX_LINES_NB
 
25
from msf_doc_import import MAX_LINES_NB
26
26
from tools.translate import _
27
27
import logging
28
28
 
164
164
                    cost_price = product_obj.browse(cr, uid, [default_code])[0].standard_price
165
165
            else:
166
166
                msg = _('The Product Code has to be a string.')
167
 
        if not default_code or default_code == obj_data.get_object_reference(cr, uid, 'msf_supply_doc_import', 'product_tbd')[1]:
 
167
        if not default_code or default_code == obj_data.get_object_reference(cr, uid, 'msf_doc_import', 'product_tbd')[1]:
168
168
            comment += _(' Product Code to be defined')
169
169
            error_list.append(msg or _('The Product\'s Code has to be defined'))
170
170
    # if the cell is empty
236
236
                            error_list.append(msg or _('The UOM imported was not in the same category than the UOM of the product so we took the UOM of the product instead.'))
237
237
            else:
238
238
                msg = _('The UOM Name has to be a string.')
239
 
            if not uom_id or uom_id == obj_data.get_object_reference(cr, uid, 'msf_supply_doc_import', 'uom_tbd')[1]:
 
239
            if not uom_id or uom_id == obj_data.get_object_reference(cr, uid, 'msf_doc_import', 'uom_tbd')[1]:
240
240
                error_list.append(msg or _('The UOM Name was not valid.'))
241
 
                uom_id = obj_data.get_object_reference(cr, uid, 'msf_supply_doc_import', 'uom_tbd')[1]
 
241
                uom_id = obj_data.get_object_reference(cr, uid, 'msf_doc_import', 'uom_tbd')[1]
242
242
        else:
243
243
            error_list.append(msg or _('The UOM Name was empty.'))
244
244
            if default_code:
245
245
                uom_id = product_obj.browse(cr, uid, [default_code])[0].uom_id.id
246
246
            else:
247
 
                uom_id = obj_data.get_object_reference(cr, uid, 'msf_supply_doc_import', 'uom_tbd')[1]
 
247
                uom_id = obj_data.get_object_reference(cr, uid, 'msf_doc_import', 'uom_tbd')[1]
248
248
    # if the cell is empty
249
249
    except IndexError, e:
250
250
        error_list.append(_('The UOM Name was empty. (Details: %s)') % e)
251
251
        if default_code:
252
252
            uom_id = product_obj.browse(cr, uid, [default_code])[0].uom_id.id
253
253
        else:
254
 
            uom_id = obj_data.get_object_reference(cr, uid, 'msf_supply_doc_import', 'uom_tbd')[1]
 
254
            uom_id = obj_data.get_object_reference(cr, uid, 'msf_doc_import', 'uom_tbd')[1]
255
255
    return {'uom_id': uom_id, 'error_list': error_list}
256
256
 
257
257