Merge lp:~hanane-s/prestashoperpconnect/prestashoperpconnect-map-country-in-addresses into lp:prestashoperpconnect

Proposed by hanane
Status: Rejected
Rejected by: Sébastien BEAU - http://www.akretion.com
Proposed branch: lp:~hanane-s/prestashoperpconnect/prestashoperpconnect-map-country-in-addresses
Merge into: lp:prestashoperpconnect
Diff against target: 19 lines (+9/-0)
1 file modified
prestashoperpconnect/unit/mapper.py (+9/-0)
To merge this branch: bzr merge lp:~hanane-s/prestashoperpconnect/prestashoperpconnect-map-country-in-addresses
Reviewer Review Type Date Requested Status
PrestashopERPConnect core editors Pending
Review via email: mp+177335@code.launchpad.net

Description of the change

we map the country in addresses when we get the new addresses from prestashop

To post a comment you must log in.
Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi hanane, thanks for your work
I did not see you merge before and I had propose similary to your work here
https://code.launchpad.net/~sebastien.beau/prestashoperpconnect/prestashoperpconnect-fix/+merge/179949

But I think the good solution is to add a generic powerfull binding and use a direct mapping.
I will talk about it tomorrow with Guewen

Have a good day

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi hanane I merge a fix, I do not use the method get_openerp_id as I think this method should be remove (using unwrap in binding is better)
The merge done is here :
https://code.launchpad.net/~sebastien.beau/prestashoperpconnect/prestashoperpconnect-fix/+merge/179949

Thanks for your work

Unmerged revisions

243. By hanane

[IMP] mapping country with customer addresses

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'prestashoperpconnect/unit/mapper.py'
2--- prestashoperpconnect/unit/mapper.py 2013-07-17 07:03:37 +0000
3+++ prestashoperpconnect/unit/mapper.py 2013-07-29 09:12:32 +0000
4@@ -231,6 +231,15 @@
5 @mapping
6 def customer(self, record):
7 return {'customer': True}
8+
9+ @mapping
10+ def country_id(self, record):
11+ if record.get('id_country'):
12+ return {'country_id': self.get_openerp_id(
13+ 'prestashop.res.country',
14+ record['id_country']
15+ )}
16+ return {}
17
18
19 @prestashop