Esempio n. 1
0
def get_openerp():
    """openerp_instance"""
    global openerp_instance
    if not openerp_instance:
        config = kooltuo_config()
        openerp_instance = openerp(dbname=config.dbname, uri=config.uri, user=config.user, pwd=config.password)
    return openerp_instance
Esempio n. 2
0
def get_openerp():
    """openerp_instance"""
    global openerp_instance
    if not openerp_instance:
        config = kooltuo_config()
        openerp_instance = openerp(dbname=config.dbname,
                                   uri=config.uri,
                                   user=config.user,
                                   pwd=config.password)
    return openerp_instance
Esempio n. 3
0
    def OnClick(self, button, cancel):
        import win32ui  # Possible, but not necessary, to use a Pythonwin GUI

        print "[ButtonEvent][OnClick] start"

        config = kooltuo_config()
        try:
            if config.validate_conection():
                sync = syncronize()
                sync.sync_all()
        except ErrorValidatingConection, (instance):
            win32ui.MessageBox(instance.parameter)
Esempio n. 4
0
 def OnClick(self, button, cancel):
     import win32ui # Possible, but not necessary, to use a Pythonwin GUI
     
     print "[ButtonEvent][OnClick] start"
     
     config = kooltuo_config()
     try:
         if config.validate_conection():
             sync = syncronize()
             sync.sync_all()
     except ErrorValidatingConection, (instance):
         win32ui.MessageBox(instance.parameter)
Esempio n. 5
0
 def set_new_syncronization_time(self, item_type):
     """create a new record with the sync last date"""
     sync_rec = self.ooop.KooltuoSyncReport.new()
     sync_rec.outlook_application_id = self.oapp_id
     dt = datetime.now() + timedelta(seconds=2)  #hack 4 outlook
     sync_rec.last_sync_date = str(dt)
     sync_rec.name = item_type_str(item_type)
     sync_rec.state = "done"
     sync_rec.save()
     #guardar en el cfg
     config = kooltuo_config()
     config.last_sync = dt
     # config.last_sync = sync_rec.last_sync_date
     config.save()
     return True
Esempio n. 6
0
 def set_new_syncronization_time(self, item_type):
     """create a new record with the sync last date"""
     sync_rec = self.ooop.KooltuoSyncReport.new()
     sync_rec.outlook_application_id = self.oapp_id
     dt = datetime.now()+ timedelta(seconds=2) #hack 4 outlook
     sync_rec.last_sync_date = str(dt)
     sync_rec.name = item_type_str(item_type)
     sync_rec.state = "done"
     sync_rec.save()
     #guardar en el cfg
     config = kooltuo_config()
     config.last_sync = dt
     # config.last_sync = sync_rec.last_sync_date
     config.save()
     return True
Esempio n. 7
0
 def __init__(self):
     print "[syncronize][__init__] start"
     self.openerp = conect.get_openerp()
     self.out_contacts = outlook_contacts()
     self.config = kooltuo_config()
     print "[syncronize][__init__] end"
Esempio n. 8
0
 def __init__(self):
     print "[syncronize][__init__] start"
     self.openerp = conect.get_openerp()
     self.out_contacts = outlook_contacts()
     self.config = kooltuo_config()
     print "[syncronize][__init__] end"