update
This commit is contained in:
parent
62813388d7
commit
3f89935d1b
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 5.1.6 on 2025-03-06 01:43
|
# Generated by Django 4.2.20 on 2025-03-20 17:15
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Generated by Django 5.1.6 on 2025-03-06 01:43
|
# Generated by Django 4.2.20 on 2025-03-20 17:15
|
||||||
|
|
||||||
import django.db.models.deletion
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -9,8 +9,8 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('haikalbot', '0001_initial'),
|
|
||||||
('inventory', '0001_initial'),
|
('inventory', '0001_initial'),
|
||||||
|
('haikalbot', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|||||||
@ -6,7 +6,7 @@ class InventoryConfig(AppConfig):
|
|||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
import inventory.signals
|
import inventory.signals
|
||||||
# from decimal import Decimal
|
from decimal import Decimal
|
||||||
# from inventory.models import VatRate
|
from inventory.models import VatRate
|
||||||
# VatRate.objects.get_or_create(rate=Decimal('0.15'), is_active=True)
|
VatRate.objects.get_or_create(rate=Decimal('0.15'), is_active=True)
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
|||||||
# Generated by Django 5.1.7 on 2025-03-16 19:09
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('inventory', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='saleorder',
|
|
||||||
name='payment_method',
|
|
||||||
field=models.CharField(choices=[('cash', 'Cash'), ('finance', 'Finance'), ('lease', 'Lease'), ('credit_card', 'Credit Card'), ('bank_transfer', 'Bank Transfer'), ('SADAD', 'SADAD')], max_length=20),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@ -358,8 +358,6 @@ class Car(models.Model):
|
|||||||
vendor = models.ForeignKey(
|
vendor = models.ForeignKey(
|
||||||
VendorModel,
|
VendorModel,
|
||||||
models.DO_NOTHING,
|
models.DO_NOTHING,
|
||||||
null=True,
|
|
||||||
blank=True,
|
|
||||||
related_name="cars",
|
related_name="cars",
|
||||||
verbose_name=_("Vendor"),
|
verbose_name=_("Vendor"),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -899,11 +899,6 @@ def create_dealer_settings(sender, instance, created, **kwargs):
|
|||||||
bill_unearned_account=instance.entity.get_all_accounts().filter(role=roles.LIABILITY_CL_ACC_PAYABLE).first()
|
bill_unearned_account=instance.entity.get_all_accounts().filter(role=roles.LIABILITY_CL_ACC_PAYABLE).first()
|
||||||
)
|
)
|
||||||
|
|
||||||
@receiver(post_save, sender=models.Dealer)
|
|
||||||
def check_if_vat_exists(sender, instance, created, **kwargs):
|
|
||||||
if created:
|
|
||||||
models.VatRate.objects.get_create(is_active=True)
|
|
||||||
|
|
||||||
# @receiver(post_save, sender=EstimateModel)
|
# @receiver(post_save, sender=EstimateModel)
|
||||||
# def update_estimate_status(sender, instance,created, **kwargs):
|
# def update_estimate_status(sender, instance,created, **kwargs):
|
||||||
|
|
||||||
|
|||||||
@ -4070,6 +4070,7 @@ class LedgerModelListView(LoginRequiredMixin, ListView,ArchiveIndexView):
|
|||||||
show_all = False
|
show_all = False
|
||||||
show_current = False
|
show_current = False
|
||||||
show_visible = False
|
show_visible = False
|
||||||
|
allow_empty = True
|
||||||
|
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
|||||||
@ -29,8 +29,6 @@ commonmark
|
|||||||
contourpy
|
contourpy
|
||||||
crispy-bootstrap5
|
crispy-bootstrap5
|
||||||
cryptography
|
cryptography
|
||||||
cssselect2
|
|
||||||
ctranslate2
|
|
||||||
cycler
|
cycler
|
||||||
Cython
|
Cython
|
||||||
decorator
|
decorator
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
from inventory.models import *
|
from inventory.models import *
|
||||||
|
from django_ledger.models import VendorModel
|
||||||
from rich import print
|
from rich import print
|
||||||
import random
|
import random
|
||||||
import datetime
|
import datetime
|
||||||
@ -8,6 +9,9 @@ from inventory.services import decodevin
|
|||||||
|
|
||||||
def run():
|
def run():
|
||||||
# car = Car.objects.filter(vin='2C3HD46R4WH170267')
|
# car = Car.objects.filter(vin='2C3HD46R4WH170267')
|
||||||
|
dealer = Dealer.objects.first()
|
||||||
|
vendors = [VendorModel.objects.create(vendor_name=f'vendor{i}',entity_model=dealer.entity) for i in range(1, 5)]
|
||||||
|
|
||||||
vin_list = [
|
vin_list = [
|
||||||
"1B3ES56C13D120225",
|
"1B3ES56C13D120225",
|
||||||
"1GB4KYC86FF131536",
|
"1GB4KYC86FF131536",
|
||||||
@ -24,8 +28,8 @@ def run():
|
|||||||
]
|
]
|
||||||
for vin in vin_list:
|
for vin in vin_list:
|
||||||
try:
|
try:
|
||||||
for _ in range(15):
|
for _ in range(5):
|
||||||
dealer = Dealer.objects.get(user__email="ismail.mosa.ibrahim@gmail.com")
|
|
||||||
vin = f"{vin[:-4]}{random.randint(0, 9)}{random.randint(0, 9)}{random.randint(0, 9)}{random.randint(0, 9)}"
|
vin = f"{vin[:-4]}{random.randint(0, 9)}{random.randint(0, 9)}{random.randint(0, 9)}{random.randint(0, 9)}"
|
||||||
result = decodevin(vin)
|
result = decodevin(vin)
|
||||||
make = CarMake.objects.get(name=result["maker"])
|
make = CarMake.objects.get(name=result["maker"])
|
||||||
@ -35,13 +39,14 @@ def run():
|
|||||||
year = result["modelYear"]
|
year = result["modelYear"]
|
||||||
serie = random.choice(model.carserie_set.all())
|
serie = random.choice(model.carserie_set.all())
|
||||||
trim = random.choice(serie.cartrim_set.all())
|
trim = random.choice(serie.cartrim_set.all())
|
||||||
|
vendor = random.choice(vendors)
|
||||||
car = Car.objects.create(
|
car = Car.objects.create(
|
||||||
vin=vin,
|
vin=vin,
|
||||||
id_car_make=make,
|
id_car_make=make,
|
||||||
id_car_model=model,
|
id_car_model=model,
|
||||||
id_car_serie=serie,
|
id_car_serie=serie,
|
||||||
id_car_trim=trim,
|
id_car_trim=trim,
|
||||||
|
vendor=vendor,
|
||||||
year=(int(year) or 2025),
|
year=(int(year) or 2025),
|
||||||
receiving_date=datetime.datetime.now(),
|
receiving_date=datetime.datetime.now(),
|
||||||
dealer=dealer,
|
dealer=dealer,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user