~unifield-team/unifield-wm/us-727

« back to all changes in this revision

Viewing changes to msf_doc_import/stock_cost_reevaluation.py

  • Committer: Quentin THEURET
  • Date: 2015-07-15 11:57:19 UTC
  • mto: This revision was merged to the branch mainline in revision 2554.
  • Revision ID: qt@tempo-consulting.fr-20150715115719-zov51h6q6d04mowc
US-285 [IMP] At import of Product coste reevaluation, take care of only the product code (not the product name) to find the good product

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
 
104
104
            # Product name
105
105
            product_name = row.cells[1].data
106
 
            if product_name:
107
 
                try:
108
 
                    product_name = product_name.strip()
109
 
                    product_ids = product_obj.search(cr, uid, [('name', '=', product_name)], context=context)
110
 
                    if product_ids:
111
 
                        product_id = product_ids[0]
112
 
                except Exception:
113
 
                    pass
114
 
 
115
106
            if not product_id:
116
 
                if not product_code and not product_name:
117
 
                    raise osv.except_osv(_('Error'), _('You have to fill at least the product code or the product name on each line'))
118
107
                raise osv.except_osv(_('Error'), _('The Product [%s] %s was not found in the list of the products') % (product_code or '', product_name or ''))
119
108
 
120
109
            # Average cost