Skip to content

Commit

Permalink
fix: Remove history tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
hossainchisty committed May 16, 2023
1 parent 724d38c commit 2c00f94
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions products/models/product_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from ckeditor.fields import RichTextField
from cloudinary.models import CloudinaryField
from django_countries.fields import CountryField
from simple_history.models import HistoricalRecords

from django.db import models
from suppliers.models import Supplier
Expand Down Expand Up @@ -131,7 +130,7 @@ class Product(Timestamp):
recently_updated = models.DateTimeField(null=True, blank=True)
supplier_price = models.DecimalField(max_digits=10, decimal_places=2)
supplier = models.ForeignKey(Supplier, on_delete=models.CASCADE)
history = HistoricalRecords()


def save(self, *args, **kwargs):
""" override the save method for logical purposes """
Expand Down
4 changes: 0 additions & 4 deletions sales/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from decimal import Decimal

from simple_history.models import HistoricalRecords

from customers.models import Customer
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
Expand Down Expand Up @@ -53,8 +51,6 @@ class Sale(Timestamp):
due = models.DecimalField(default=00.00, max_digits=10, decimal_places=2)
total = models.DecimalField(default=00.00, max_digits=10, decimal_places=2)

history = HistoricalRecords()

def save(self, *args, **kwargs):
""" override the save method for logical purposes """
# If this flag is True then status will be set to 'paid'.
Expand Down
2 changes: 0 additions & 2 deletions suppliers/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django_countries.fields import CountryField
from phonenumber_field.modelfields import PhoneNumberField
from simple_history.models import HistoricalRecords

from django.db import models
from django.utils.translation import gettext_lazy as _
Expand All @@ -19,7 +18,6 @@ class Supplier(Timestamp):
supplier_country = CountryField()
supplier_fax = models.BigIntegerField(null=True, blank=True, verbose_name=_('Supplier Fax'))
supplier_previous_balance = models.DecimalField(max_digits=10, decimal_places=2, default=0, verbose_name=_('Supplier Previous Balance'))
history = HistoricalRecords()

class Meta:
verbose_name = _('Supplier')
Expand Down

0 comments on commit 2c00f94

Please sign in to comment.