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
1=== modified file 'kit/wizard/kit_mass_import.py'
2--- kit/wizard/kit_mass_import.py 2015-03-26 15:22:42 +0000
3+++ kit/wizard/kit_mass_import.py 2015-04-02 14:03:26 +0000
4@@ -234,11 +234,14 @@
5 #9: Product UoM (if not set, take the Product Default UoM)
6 """
7 for line, val in values.iteritems():
8+ vval = val[3]
9+ if isinstance(val[3], str):
10+ vval = val[3].strip()
11 kit_key = '%s_%s' % (val[0], val[2])
12 tkc_values.setdefault(kit_key, {
13 'code': val[0],
14 'version': val[2],
15- 'active': val[3].strip() in active_values and True or False,
16+ 'active': vval in active_values and True or False,
17 'items': [],
18 })
19 tkc_values[kit_key]['items'].append({
20@@ -311,7 +314,10 @@
21
22 # Col. 4 :: Active (expected values: True or False)a
23 active_values = [True, False, 'True', 'False', 'TRUE', 'FALSE']
24- if not val[3] or val[3].strip() not in active_values:
25+ vval = val[3]
26+ if isinstance(vval, str):
27+ vval = vval.strip()
28+ if not vval or vval not in active_values:
29 warning_index.add(line)
30 warning_msg.setdefault(line, [])
31 warning_msg[line].append(

Subscribers

People subscribed via source and target branches