Merge lp:~wantellets/prestashoperpconnect/prestashoperpconnect_id_shop into lp:prestashoperpconnect

Proposed by WANTELLET Sylvain
Status: Rejected
Rejected by: Sébastien BEAU - http://www.akretion.com
Proposed branch: lp:~wantellets/prestashoperpconnect/prestashoperpconnect_id_shop
Merge into: lp:prestashoperpconnect
Diff against target: 51 lines (+16/-7)
2 files modified
prestashoperpconnect/prestashop_model.py (+11/-6)
prestashoperpconnect/unit/import_synchronizer.py (+5/-1)
To merge this branch: bzr merge lp:~wantellets/prestashoperpconnect/prestashoperpconnect_id_shop
Reviewer Review Type Date Requested Status
Sébastien BEAU - http://www.akretion.com Disapprove
Review via email: mp+183446@code.launchpad.net

Description of the change

Add id_shop for customer import_customers_since for multi-shop configuration and non-shared customers.
(requires to add id_shop to prestapyt supported filters)

To post a comment you must log in.
252. By WANTELLET Sylvain

MERGE changes from main branch

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

The project has moved to Github https://github.com/OCA/connector-prestashop.
Please resubmit your MP on github using following procedure https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub.

I put this MP in rejected in the meanwhile.

Regards

review: Disapprove

Unmerged revisions

252. By WANTELLET Sylvain

MERGE changes from main branch

251. By WANTELLET Sylvain

Add id_shop for customer import_customers_since for multi-shop configuration and non-shared customers.
(requires to add id_shop to prestapyt supported filters)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'prestashoperpconnect/prestashop_model.py'
--- prestashoperpconnect/prestashop_model.py 2013-10-25 10:35:45 +0000
+++ prestashoperpconnect/prestashop_model.py 2013-11-04 13:35:22 +0000
@@ -133,12 +133,17 @@
133 backend_record.import_partners_since,133 backend_record.import_partners_since,
134 DEFAULT_SERVER_DATETIME_FORMAT134 DEFAULT_SERVER_DATETIME_FORMAT
135 )135 )
136 import_customers_since.delay(136 shop_obj = self.pool.get('prestashop.shop')
137 session,137 list_shops = shop_obj.search(cr, uid, [('backend_id', '=', backend_record.id)])
138 backend_record.id,138 shops = shop_obj.browse(cr, uid, list_shops, context=context)
139 since_date,139 for shop in shops:
140 priority=10,140 import_customers_since.delay(
141 )141 session,
142 backend_record.id,
143 since_date,
144 shop.prestashop_id,
145 priority=10,
146 )
142147
143 return True148 return True
144149
145150
=== modified file 'prestashoperpconnect/unit/import_synchronizer.py'
--- prestashoperpconnect/unit/import_synchronizer.py 2013-10-25 12:40:37 +0000
+++ prestashoperpconnect/unit/import_synchronizer.py 2013-11-04 13:35:22 +0000
@@ -658,7 +658,7 @@
658658
659659
660@job660@job
661def import_customers_since(session, backend_id, since_date=None):661def import_customers_since(session, backend_id, since_date=None, id_shop=None):
662 """ Prepare the import of partners modified on Prestashop """662 """ Prepare the import of partners modified on Prestashop """
663 import_batch(session, 'prestashop.res.partner.category', backend_id)663 import_batch(session, 'prestashop.res.partner.category', backend_id)
664664
@@ -666,6 +666,10 @@
666 if since_date:666 if since_date:
667 date_str = since_date.strftime('%Y-%m-%d %H:%M:%S')667 date_str = since_date.strftime('%Y-%m-%d %H:%M:%S')
668 filters = {'date': '1', 'filter[date_upd]': '>[%s]' % (date_str)}668 filters = {'date': '1', 'filter[date_upd]': '>[%s]' % (date_str)}
669 if id_shop:
670 if filters is None:
671 filters = {}
672 filters.update({'id_shop': id_shop})
669 import_batch(session, 'prestashop.res.partner', backend_id, filters, priority=15)673 import_batch(session, 'prestashop.res.partner', backend_id, filters, priority=15)
670674
671 now_fmt = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)675 now_fmt = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)