frepple.printsize() logProgress(10, db) print("\nStart loading data from odoo at", datetime.now().strftime("%H:%M:%S")) odoo_read(db) frepple.printsize() else: # Use input data from the frePPLe database print("\nStart loading data from the database at", datetime.now().strftime("%H:%M:%S")) loadData(database=db, filter=None).run() frepple.printsize() logProgress(33, db) if 'odoo_read' in os.environ: print("\nStart exporting static model to the database with filter \"source = 'odoo'\" at", datetime.now().strftime("%H:%M:%S")) from freppledb.execute.export_database_static import exportStaticModel exportStaticModel(database=db, source='odoo').run() print("\nStart plan generation at", datetime.now().strftime("%H:%M:%S")) createPlan(db) frepple.printsize() logProgress(66, db) if 'odoo_write' in os.environ: print("\nStart exporting plan to odoo at", datetime.now().strftime("%H:%M:%S")) odoo_write(db) print("\nStart exporting plan to the database at", datetime.now().strftime("%H:%M:%S")) exportPlan(db) #print("\nStart saving the plan to flat files at", datetime.now().strftime("%H:%M:%S")) #from freppledb.execute.export_file_plan import exportfrepple as export_plan_to_file
def run(cls, database=DEFAULT_DB_ALIAS, **kwargs): from freppledb.execute.export_database_static import exportStaticModel exportStaticModel(database=database, source='odoo_%s' % cls.mode).run()
frepple.printsize() logProgress(10, db) print("\nStart loading data from odoo at", datetime.now().strftime("%H:%M:%S")) odoo_read(db) frepple.printsize() else: # Use input data from the frePPLe database print("\nStart loading data from the database at", datetime.now().strftime("%H:%M:%S")) loadData(database=db, filter=None).run() frepple.printsize() logProgress(33, db) if 'odoo_read' in os.environ: print("\nStart exporting static model to the database with filter \"source = 'odoo'\" at", datetime.now().strftime("%H:%M:%S")) from freppledb.execute.export_database_static import exportStaticModel exportStaticModel(database=db, source='odoo').run() print("\nStart plan generation at", datetime.now().strftime("%H:%M:%S")) createPlan(db) frepple.printsize() logProgress(66, db) if 'odoo_write' in os.environ: print("\nStart exporting plan to odoo at", datetime.now().strftime("%H:%M:%S")) odoo_write(db) print("\nStart exporting plan to the database at", datetime.now().strftime("%H:%M:%S")) exportPlan(db) #print("\nStart saving the plan to flat files at", datetime.now().strftime("%H:%M:%S")) #from freppledb.execute.export_file_plan import exportfrepple as export_plan_to_file
def run(cls, database=DEFAULT_DB_ALIAS, **kwargs): from freppledb.execute.export_database_static import exportStaticModel exportStaticModel(database=database, source='odoo_%s' % cls.mode).run()
if db == DEFAULT_DB_ALIAS: frepple.settings.logfile = os.path.join(settings.FREPPLE_LOGDIR, "frepple.log") else: frepple.settings.logfile = os.path.join(settings.FREPPLE_LOGDIR, "frepple_%s.log" % db) # Use the test database if we are running the test suite if "FREPPLE_TEST" in os.environ: settings.DATABASES[db]["NAME"] = settings.DATABASES[db]["TEST"]["NAME"] # Welcome message print("frePPLe on %s using %s database '%s' as '%s' on '%s:%s'" % ( sys.platform, settings.DATABASES[db].get("ENGINE", ""), settings.DATABASES[db].get("NAME", ""), settings.DATABASES[db].get("USER", ""), settings.DATABASES[db].get("HOST", ""), settings.DATABASES[db].get("PORT", ""), )) print( "\nStart exporting static model to the database at", datetime.now().strftime("%H:%M:%S"), ) from freppledb.execute.export_database_static import exportStaticModel exportStaticModel(database=db).run() print("\nFinished loading XML data at", datetime.now().strftime("%H:%M:%S"))
# Send the output to a logfile try: db = os.environ['FREPPLE_DATABASE'] or DEFAULT_DB_ALIAS except: db = DEFAULT_DB_ALIAS if db == DEFAULT_DB_ALIAS: frepple.settings.logfile = os.path.join(settings.FREPPLE_LOGDIR, 'frepple.log') else: frepple.settings.logfile = os.path.join(settings.FREPPLE_LOGDIR, 'frepple_%s.log' % db) # Use the test database if we are running the test suite if 'FREPPLE_TEST' in os.environ: settings.DATABASES[db]['NAME'] = settings.DATABASES[db]['TEST']['NAME'] # Welcome message print("frePPLe on %s using %s database '%s' as '%s' on '%s:%s'" % ( sys.platform, settings.DATABASES[db].get('ENGINE', ''), settings.DATABASES[db].get('NAME', ''), settings.DATABASES[db].get('USER', ''), settings.DATABASES[db].get('HOST', ''), settings.DATABASES[db].get('PORT', '') )) print("\nStart exporting static model to the database at", datetime.now().strftime("%H:%M:%S")) from freppledb.execute.export_database_static import exportStaticModel exportStaticModel(database=db).run() print("\nFinished loading XML data at", datetime.now().strftime("%H:%M:%S"))