Merge lp:~camptocamp/openerp-connector-magento/7.0-no-updated_at-1301417 into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0

Proposed by Guewen Baconnier @ Camptocamp on 2014-04-02
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp on 2014-04-17
Approved revision: 965
Merge reported by: Guewen Baconnier @ Camptocamp
Merged at revision: not available
Proposed branch: lp:~camptocamp/openerp-connector-magento/7.0-no-updated_at-1301417
Merge into: lp:~openerp-connector-core-editors/openerp-connector-magento/7.0
Diff against target: 14 lines (+3/-1)
1 file modified
magentoerpconnect/unit/export_synchronizer.py (+3/-1)
To merge this branch: bzr merge lp:~camptocamp/openerp-connector-magento/7.0-no-updated_at-1301417
Reviewer Review Type Date Requested Status
Leonardo Pistone (community) code review Approve on 2014-04-03
OpenERP Connector Core Editors 2014-04-02 Pending
Review via email: mp+213860@code.launchpad.net

Description of the change

To post a comment you must log in.
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/unit/export_synchronizer.py'
2--- magentoerpconnect/unit/export_synchronizer.py 2013-11-12 08:43:40 +0000
3+++ magentoerpconnect/unit/export_synchronizer.py 2014-04-02 14:33:10 +0000
4@@ -83,7 +83,9 @@
5 return True
6 record = self.backend_adapter.read(self.magento_id,
7 attributes=['updated_at'])
8-
9+ if not record['updated_at']:
10+ # in rare case it can be empty, in doubt, import it
11+ return False
12 fmt = DEFAULT_SERVER_DATETIME_FORMAT
13 sync_date = datetime.strptime(sync, fmt)
14 magento_date = datetime.strptime(record['updated_at'], fmt)