788
788
def sync_threaded(self, cr, uid, recover=False, context=None):
789
789
BackgroundProcess(cr, uid,
790
('sync_recover' if recover else 'sync'),
790
('sync_recover_withbackup' if recover else 'sync_withbackup'),
794
def sync_manual_threaded(self, cr, uid, recover=False, context=None):
795
BackgroundProcess(cr, uid,
796
('sync_manual_recover_withbackup' if recover else 'sync_manual_withbackup'),
813
def sync_recover_withbackup(self, cr, uid, context=None):
815
Call both pull_all_data and recover_message functions - used in manual sync wizard
817
#Check for a backup before automatic sync
818
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'beforeautomaticsync', context=context)
819
self.sync_recover(cr, uid, context=context)
820
#Check for a backup after automatic sync
821
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'afterautomaticsync', context=context)
822
return {'type': 'ir.actions.act_window_close'}
825
def sync_manual_recover_withbackup(self, cr, uid, context=None):
827
Call both pull_all_data and recover_message functions - used in manual sync wizard
829
#Check for a backup before automatic sync
830
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'beforemanualsync', context=context)
831
self.sync_recover(cr, uid, context=context)
832
#Check for a backup after automatic sync
833
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'aftermanualsync', context=context)
834
return {'type': 'ir.actions.act_window_close'}
807
837
def sync(self, cr, uid, context=None):
808
838
self._logger.info("Start synchronization")
809
839
self.pull_update(cr, uid, context=context)
813
843
self._logger.info("Synchronization succesfully done")
847
def sync_withbackup(self, cr, uid, context=None):
849
Call both pull_all_data and recover_message functions - used in manual sync wizard
851
#Check for a backup before automatic sync
852
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'beforeautomaticsync', context=context)
853
self.sync(cr, uid, context=context)
854
#Check for a backup after automatic sync
855
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'afterautomaticsync', context=context)
856
return {'type': 'ir.actions.act_window_close'}
859
def sync_manual_withbackup(self, cr, uid, context=None):
861
Call both pull_all_data and recover_message functions - used in manual sync wizard
863
#Check for a backup before automatic sync
864
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'beforemanualsync', context=context)
865
self.sync(cr, uid, context=context)
866
#Check for a backup after automatic sync
867
self.pool.get('backup.config').exp_dump_for_state(cr, uid, 'aftermanualsync', context=context)
868
return {'type': 'ir.actions.act_window_close'}
816
870
def get_upgrade_status(self, cr, uid, context=None):