Mapper: add modifier to follow m2o relations #94

Merged
merged 2 commits into from Jul 20, 2015

Conversation

Projects
None yet
3 participants
@LeartS
Contributor

LeartS commented Jul 14, 2015

A modifier for direct mappings to follow many2one fields, a use case I think it's quite common.

Example with model = product.product

direct = [
    (follow_m2o_relations('product_tmpl_id.categ_id.name'), 'category_name')]
Mapper: add modifier to follow m2o relations
Does not do particular checks to see if each "step" is a
valid m2o field, relies on the standard and familiar
Odoo recordset errors instead.
@guewen

This comment has been minimized.

Show comment
Hide comment
@guewen

guewen Jul 14, 2015

Member

Thanks :-)
A good idea!

Travis complains about:

./connector/unit/mapper.py:251:80: E501 line too long (80 > 79 characters)

Would you mind to add a test? You can use this test as a basis: https://github.com/OCA/connector/blob/8.0/connector/tests/test_mapper.py#L389-L400

Member

guewen commented Jul 14, 2015

Thanks :-)
A good idea!

Travis complains about:

./connector/unit/mapper.py:251:80: E501 line too long (80 > 79 characters)

Would you mind to add a test? You can use this test as a basis: https://github.com/OCA/connector/blob/8.0/connector/tests/test_mapper.py#L389-L400

@guewen

This comment has been minimized.

Show comment
Hide comment
@guewen

guewen Jul 14, 2015

Member

Thanks ! 😄
👍

Member

guewen commented Jul 14, 2015

Thanks ! 😄
👍

@gurneyalex

This comment has been minimized.

Show comment
Hide comment
@gurneyalex

gurneyalex Jul 16, 2015

Member

👍

Member

gurneyalex commented Jul 16, 2015

👍

guewen added a commit that referenced this pull request Jul 20, 2015

Merge pull request #94 from LeartS/m2o_relations_modifier
Mapper: add modifier to follow m2o relations

@guewen guewen merged commit 27a6236 into OCA:8.0 Jul 20, 2015

2 checks passed

ci/runbot runbot build 3110810-94-c3fb82 (runtime 30s)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment