Merge lp:~domsense/domsense-agilebg-addons/ea_import_fix_missing_value_rows into lp:~domsense/domsense-agilebg-addons/ea_import

Proposed by Alex Comba - Agile BG
Status: Merged
Merged at revision: 27
Proposed branch: lp:~domsense/domsense-agilebg-addons/ea_import_fix_missing_value_rows
Merge into: lp:~domsense/domsense-agilebg-addons/ea_import
Diff against target: 28 lines (+3/-4)
1 file modified
ea_import/ea_import_template.py (+3/-4)
To merge this branch: bzr merge lp:~domsense/domsense-agilebg-addons/ea_import_fix_missing_value_rows
Reviewer Review Type Date Requested Status
Agile Business Group Pending
Review via email: mp+151453@code.launchpad.net

Commit message

[FIX] adding key_field even if template_line.key_field has no value

Description of the change

Adding key_field even if template_line.key_field has no value

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ea_import/ea_import_template.py'
--- ea_import/ea_import_template.py 2013-01-03 11:10:00 +0000
+++ ea_import/ea_import_template.py 2013-03-04 10:38:30 +0000
@@ -48,12 +48,12 @@
48 for template_line in template.line_ids:48 for template_line in template.line_ids:
49 field_name = template_line.target_field.name49 field_name = template_line.target_field.name
50 value = template_line.get_field(record_list, testing=True)50 value = template_line.get_field(record_list, testing=True)
51 if template_line.key_field:
52 upd_key.append((template_line.target_field.name, '=', value))
51 if template_line.default_value and not value:53 if template_line.default_value and not value:
52 value = template_line.default_value54 value = template_line.default_value
53 if value:55 if value:
54 record.update({field_name: value})56 record.update({field_name: value})
55 if template_line.key_field:
56 upd_key.append((template_line.target_field.name, '=', value))
57 else:57 else:
58 if template_line.required:58 if template_line.required:
59 ready_to_create_new = False59 ready_to_create_new = False
@@ -83,8 +83,7 @@
83 value = template_line.default_value83 value = template_line.default_value
84 else:84 else:
85 value = template_line.get_field(input_list, testing=True)85 value = template_line.get_field(input_list, testing=True)
86 if value:86 key.append((field_name, '=', value))
87 key.append((field_name, '=', value))
88 if not key:87 if not key:
89 return [None]88 return [None]
90 if template.update_current:89 if template.update_current:

Subscribers

People subscribed via source and target branches

to all changes: