Merge lp:~unifield-team/unifield-wm/us-177 into lp:unifield-wm

Proposed by jftempo
Status: Merged
Merged at revision: 2462
Proposed branch: lp:~unifield-team/unifield-wm/us-177
Merge into: lp:unifield-wm
Diff against target: 31 lines (+8/-2)
1 file modified
kit/wizard/kit_mass_import.py (+8/-2)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/us-177
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+255089@code.launchpad.net
To post a comment you must log in.
lp:~unifield-team/unifield-wm/us-177 updated
2462. By Quentin THEURET @Amaris

US-177 [FIX] Mass Theoretical Kit import error if the value in Active cell is True

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'kit/wizard/kit_mass_import.py'
--- kit/wizard/kit_mass_import.py 2015-03-26 15:22:42 +0000
+++ kit/wizard/kit_mass_import.py 2015-04-02 14:03:26 +0000
@@ -234,11 +234,14 @@
234 #9: Product UoM (if not set, take the Product Default UoM)234 #9: Product UoM (if not set, take the Product Default UoM)
235 """235 """
236 for line, val in values.iteritems():236 for line, val in values.iteritems():
237 vval = val[3]
238 if isinstance(val[3], str):
239 vval = val[3].strip()
237 kit_key = '%s_%s' % (val[0], val[2])240 kit_key = '%s_%s' % (val[0], val[2])
238 tkc_values.setdefault(kit_key, {241 tkc_values.setdefault(kit_key, {
239 'code': val[0],242 'code': val[0],
240 'version': val[2],243 'version': val[2],
241 'active': val[3].strip() in active_values and True or False,244 'active': vval in active_values and True or False,
242 'items': [],245 'items': [],
243 })246 })
244 tkc_values[kit_key]['items'].append({247 tkc_values[kit_key]['items'].append({
@@ -311,7 +314,10 @@
311314
312 # Col. 4 :: Active (expected values: True or False)a315 # Col. 4 :: Active (expected values: True or False)a
313 active_values = [True, False, 'True', 'False', 'TRUE', 'FALSE']316 active_values = [True, False, 'True', 'False', 'TRUE', 'FALSE']
314 if not val[3] or val[3].strip() not in active_values:317 vval = val[3]
318 if isinstance(vval, str):
319 vval = vval.strip()
320 if not vval or vval not in active_values:
315 warning_index.add(line)321 warning_index.add(line)
316 warning_msg.setdefault(line, [])322 warning_msg.setdefault(line, [])
317 warning_msg[line].append(323 warning_msg[line].append(

Subscribers

People subscribed via source and target branches