style(Purchase)
This commit is contained in:
		| @@ -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): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user