~allison-miller/openerp-connector/7.0-magentoerpconnect-invoice-export-state

« back to all changes in this revision

Viewing changes to magentoerpconnect/unit/import_synchronizer.py

  • Committer: Guewen Baconnier
  • Date: 2013-06-20 13:02:39 UTC
  • mfrom: (883.1.1 magentoerpconnect)
  • Revision ID: guewen.baconnier@camptocamp.com-20130620130239-ork22cpsly3ng76i
[FIX] Some models in Magento do not have 'log' keys 'updated_at' or 'created_at', we should never assume the key 'updated_at' exist. When it doesn't, the import is never skipped but is always done.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        """Return True if the import should be skipped because
69
69
        it is already up-to-date in OpenERP"""
70
70
        assert self.magento_record
 
71
        if not self.magento_record.get('updated_at'):
 
72
            return  # no update date on Magento, always import it.
71
73
        if not binding_id:
72
 
            return
 
74
            return  # it does not exist so it shoud not be skipped
73
75
        binding = self.session.browse(self.model._name, binding_id)
74
76
        sync = binding.sync_date
75
77
        if not sync: