mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-29 12:34:21 +00:00
Fix migrate script
This commit is contained in:
parent
d54f0f4c65
commit
00f05c71c5
31
migrate.py
31
migrate.py
@ -337,6 +337,9 @@ def migrate_counters():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("FAIL to migrate counter %s: %s" % (r['id_comptoir'], repr(e)))
|
print("FAIL to migrate counter %s: %s" % (r['id_comptoir'], repr(e)))
|
||||||
cur.close()
|
cur.close()
|
||||||
|
eboutic = Counter.objects.filter(id=3).first()
|
||||||
|
eboutic.type = "EBOUTIC"
|
||||||
|
eboutic.save()
|
||||||
|
|
||||||
def reset_customer_amount():
|
def reset_customer_amount():
|
||||||
Refilling.objects.all().delete()
|
Refilling.objects.all().delete()
|
||||||
@ -543,7 +546,7 @@ def migrate_sellings():
|
|||||||
op = User.objects.filter(id=r['id_utilisateur']).first() or root
|
op = User.objects.filter(id=r['id_utilisateur']).first() or root
|
||||||
customer = Customer.objects.filter(user__id=r['id_utilisateur_client']).first() or root.customer
|
customer = Customer.objects.filter(user__id=r['id_utilisateur_client']).first() or root.customer
|
||||||
new = Selling(
|
new = Selling(
|
||||||
label=product.name or "Produit supprimé",
|
label=product.name or "Produit inexistant",
|
||||||
counter=counter,
|
counter=counter,
|
||||||
club=club,
|
club=club,
|
||||||
product=product,
|
product=product,
|
||||||
@ -587,22 +590,22 @@ def migrate_permanencies():
|
|||||||
cur.close()
|
cur.close()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# migrate_users()
|
migrate_users()
|
||||||
# migrate_profile_pict()
|
migrate_profile_pict()
|
||||||
# migrate_clubs()
|
migrate_clubs()
|
||||||
# migrate_club_memberships()
|
migrate_club_memberships()
|
||||||
# migrate_subscriptions()
|
migrate_subscriptions()
|
||||||
# update_customer_account()
|
update_customer_account()
|
||||||
# migrate_counters()
|
migrate_counters()
|
||||||
# migrate_permanencies()
|
migrate_permanencies()
|
||||||
# migrate_typeproducts()
|
migrate_typeproducts()
|
||||||
migrate_products()
|
migrate_products()
|
||||||
migrate_products_to_counter()
|
migrate_products_to_counter()
|
||||||
# reset_customer_amount()
|
# reset_customer_amount()
|
||||||
# migrate_invoices()
|
migrate_invoices()
|
||||||
# migrate_refillings()
|
migrate_refillings()
|
||||||
# migrate_sellings()
|
migrate_sellings()
|
||||||
reset_index('core', 'counter')
|
# reset_index('core', 'counter', 'subscription')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user