Usage of modifiers in 'direct' mappings filters the field out when using map_record.values(fields=[...])
Bug #1322645 reported by
Guewen Baconnier @ Camptocamp
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP Connector |
Fix Released
|
Medium
|
Guewen Baconnier @ Camptocamp |
Bug Description
With a mapper having a modifier:
class MyMapper(
direct = [('field', 'field2'),
And such a record:
record = {'name': '300', 'field': 'value', 'no_field': 'no_value'}
When calling the mapper with the 'fields' option to filter the fields to map:
mapper = MyMapper(env)
map_record = mapper.
Expected is:
{'out_name': 300, 'field2': 'value'}
Actual result is:
{'field2': 'value'}
Because 'name' is shadowed by the closure function.
Related branches
lp:~camptocamp/openerp-connector/7.0-modifier-shadow-name-1322645
- OpenERP Connector Core Editors: Pending requested
-
Diff: 43 lines (+24/-1)2 files modifiedconnector/tests/test_mapper.py (+16/-0)
connector/unit/mapper.py (+8/-1)
Changed in openerp-connector: | |
status: | New → Fix Committed |
importance: | Undecided → Medium |
assignee: | nobody → Guewen Baconnier @ Camptocamp (gbaconnier-c2c) |
Changed in openerp-connector: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.