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

Proposed by Alex Comba - Agile BG
Status: Needs review
Proposed branch: lp:~domsense/domsense-agilebg-addons/ea_import_upper_selection_name
Merge into: lp:~domsense/domsense-agilebg-addons/ea_import
Diff against target: 14 lines (+2/-2)
1 file modified
ea_import/ea_import_template_line.py (+2/-2)
To merge this branch: bzr merge lp:~domsense/domsense-agilebg-addons/ea_import_upper_selection_name
Reviewer Review Type Date Requested Status
Lorenzo Battistini Disapprove
Review via email: mp+149099@code.launchpad.net

Commit message

[IMP] get_selection_from_name adding uppercase string comparison

Description of the change

Added upper string comparison before to get selection.

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

I think the right way to import selection fields is to use the key string instead of the value string

review: Disapprove
28. By Alex Comba - Agile BG

[MERGE]

Unmerged revisions

28. By Alex Comba - Agile BG

[MERGE]

27. By Alex Comba - Agile BG

[IMP] get_selection_from_name adding uppercase string comparison

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ea_import/ea_import_template_line.py'
2--- ea_import/ea_import_template_line.py 2013-01-25 14:51:56 +0000
3+++ ea_import/ea_import_template_line.py 2013-03-21 08:40:51 +0000
4@@ -249,8 +249,8 @@
5 for template_line in self.browse(cr, uid, ids, context=context):
6 target_model_pool = self.pool.get(template_line.target_model_id.model)
7 selection_dict = dict(target_model_pool._columns[template_line.target_field.name].selection)
8- revrese_selection_dict = dict((v, k) for k, v in selection_dict.iteritems())
9- return revrese_selection_dict.get(target_string)
10+ reverse_selection_dict = dict((v.upper(), k) for k, v in selection_dict.iteritems())
11+ return reverse_selection_dict.get(target_string.upper())
12
13 ea_import_template_line()
14 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches

to all changes: