~camptocamp/openerp-connector-magento/7.0-pending-merge

« back to all changes in this revision

Viewing changes to magentoerpconnect/magento_model.py

  • Committer: Guewen Baconnier
  • Date: 2014-07-17 14:33:11 UTC
  • Revision ID: guewen.baconnier@camptocamp.com-20140717143311-ebug72hokskwcxrs
Add a 'to date' boundary to batch jobs https://github.com/OCA/connector-magento/pull/17

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
            else:
243
243
                from_date = None
244
244
            import_batch.delay(session, model,
245
 
                               backend.id, filters={'from_date': from_date})
 
245
                               backend.id,
 
246
                               filters={'from_date': from_date,
 
247
                                        'to_date': import_start_time})
246
248
        # Records from Magento are imported based on their `created_at`
247
249
        # date.  This date is set on Magento at the beginning of a
248
250
        # transaction, so if the import is run between the beginning and
369
371
            partner_import_batch.delay(
370
372
                session, 'magento.res.partner', backend_id,
371
373
                {'magento_website_id': website.magento_id,
372
 
                    'from_date': from_date})
 
374
                 'from_date': from_date,
 
375
                 'to_date': import_start_time})
373
376
        # Records from Magento are imported based on their `created_at`
374
377
        # date.  This date is set on Magento at the beginning of a
375
378
        # transaction, so if the import is run between the beginning and
544
547
                'magento.sale.order',
545
548
                backend_id,
546
549
                {'magento_storeview_id': storeview.magento_id,
547
 
                 'from_date': from_date},
 
550
                 'from_date': from_date,
 
551
                 'to_date': import_start_time},
548
552
                priority=1)  # executed as soon as possible
549
553
        # Records from Magento are imported based on their `created_at`
550
554
        # date.  This date is set on Magento at the beginning of a