fix(Purchase): create Purchase with other payments methods.
This commit is contained in:
parent
c85f0554fb
commit
4f0f899c70
@ -14,7 +14,12 @@ class SaleView(viewsets.ModelViewSet):
|
|||||||
customer = Customer.objects.get(pk=data['customer'])
|
customer = Customer.objects.get(pk=data['customer'])
|
||||||
date = data['date']
|
date = data['date']
|
||||||
lines = data['saleline_set']
|
lines = data['saleline_set']
|
||||||
sale = Sale.objects.create(customer=customer, date=date)
|
payment_method = data['payment_method']
|
||||||
|
sale = Sale.objects.create(
|
||||||
|
customer=customer,
|
||||||
|
date=date,
|
||||||
|
payment_method=payment_method
|
||||||
|
)
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
product = Product.objects.get(pk=line['product'])
|
product = Product.objects.get(pk=line['product'])
|
||||||
|
Loading…
Reference in New Issue
Block a user