Merge lp:~camptocamp/magentoerpconnect/import-partners-fix-magento-request-2013-02-26 into lp:magentoerpconnect/oerp6.1-oldstable

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 671
Proposed branch: lp:~camptocamp/magentoerpconnect/import-partners-fix-magento-request-2013-02-26
Merge into: lp:magentoerpconnect/oerp6.1-oldstable
Diff against target: 19 lines (+2/-6)
1 file modified
magentoerpconnect/sale.py (+2/-6)
To merge this branch: bzr merge lp:~camptocamp/magentoerpconnect/import-partners-fix-magento-request-2013-02-26
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review, no test Approve
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+150591@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

+1 for pun.

review: Approve (code review, no test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Alexandre noticed that the `updated_at` field is populated with the creation datetime when a record is created, so you can just always rely on this field and avoid two calls.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) :
review: Needs Fixing
672. By Yannick Vaucher @ Camptocamp

[IMP] magentoerpconnect - in partner import make only one call to search ids on 'updated_at' as this field is set on create in magento

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Seems I'm too used to create_date and write_date of OpenERP.

I removed the filter on 'created_at' but I'm not sure whether I should remove or not the generation of multiple call to simulate OR operator even if not used anymore. Maybe this could be done in the call method itself.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

I think that something not used should be removed.

673. By Yannick Vaucher @ Camptocamp

[REM] magentoerpconnect - remove the ORiginal way to simulate OR operator

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Corrected, be the LGTM with me

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Sorry that you had to remove your pun ;-)

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'magentoerpconnect/sale.py'
--- magentoerpconnect/sale.py 2013-02-14 12:59:51 +0000
+++ magentoerpconnect/sale.py 2013-03-01 12:43:31 +0000
@@ -84,14 +84,10 @@
84 """84 """
85 filters = []85 filters = []
86 if from_date:86 if from_date:
87 filters = [87 filters = [{'updated_at': {'gt': from_date}}]
88 {'created_at': {'gt': from_date}}, # OR
89 {'updated_at': {'gt': from_date}}
90 ]
91 if website_id:88 if website_id:
92 if filters:89 if filters:
93 for f in filters:90 filters[0].update(website_id={'eq': website_id})
94 f.update(website_id={'eq': website_id})
95 else:91 else:
96 filters = [{'website_id': {'eq': website_id}}]92 filters = [{'website_id': {'eq': website_id}}]
9793