add - full import pricing features on every distribution
This commit is contained in:
@@ -418,6 +418,10 @@ class Quota(BaseModel):
|
||||
pre_sale_balance = models.IntegerField(default=0)
|
||||
free_sale = models.BooleanField(default=False)
|
||||
free_sale_balance = models.IntegerField(default=0)
|
||||
edited_pricing_features = models.BooleanField(
|
||||
default=False,
|
||||
help_text='True when quota broker values & attribute values changed in distribution of quota'
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return f"Quota ({self.id}) for {self.product.name}"
|
||||
@@ -853,9 +857,13 @@ class QuotaDistribution(BaseModel):
|
||||
def pre_sale(self):
|
||||
return self.quota.pre_sale
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
def save(self, additional_data=None, *args, **kwargs):
|
||||
if not self.distribution_id:
|
||||
self.distribution_id = self.generate_distribution_id()
|
||||
|
||||
if additional_data:
|
||||
self.additional_data = additional_data
|
||||
print(self.additional_data)
|
||||
return super(QuotaDistribution, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user