style(Purchase)
This commit is contained in:
parent
b7c4cf5d44
commit
66495e25ff
@ -83,8 +83,8 @@ class Sale(models.Model):
|
||||
return sum([l.quantity * l.unit_price for l in lines])
|
||||
|
||||
def clean(self):
|
||||
if self.payment_method not in [choice[0] for choice in PaymentMethods.choices]:
|
||||
raise ValidationError({'payment_method': f"Null or invalid payment method ({self.payment_method}, {PaymentMethods.choices})"})
|
||||
if self.payment_method not in PaymentMethods.values:
|
||||
raise ValidationError({'payment_method': "Invalid payment method"})
|
||||
|
||||
@classmethod
|
||||
def sale_header_csv(cls):
|
||||
|
Loading…
Reference in New Issue
Block a user