Habilitando la selección de método de pago en la compra #72

Merged
mono merged 12 commits from chose_pay_method_on_purchase_#47 into main 2024-11-11 16:27:22 -05:00
Showing only changes of commit 66495e25ff - Show all commits

View File

@ -83,8 +83,8 @@ class Sale(models.Model):
return sum([l.quantity * l.unit_price for l in lines]) return sum([l.quantity * l.unit_price for l in lines])
def clean(self): def clean(self):
if self.payment_method not in [choice[0] for choice in PaymentMethods.choices]: if self.payment_method not in PaymentMethods.values:
raise ValidationError({'payment_method': f"Null or invalid payment method ({self.payment_method}, {PaymentMethods.choices})"}) raise ValidationError({'payment_method': "Invalid payment method"})
@classmethod @classmethod
def sale_header_csv(cls): def sale_header_csv(cls):