Fixed saving of purchase and sales order forms

This commit is contained in:
eeintech 2020-11-05 14:38:54 -05:00
parent 15ea73a448
commit 5b3dd63b89

View File

@ -335,7 +335,8 @@ class PurchaseOrderCreate(AjaxCreateView):
order = form.save(commit=False)
order.created_by = self.request.user
order.save()
return super().save(form)
class SalesOrderCreate(AjaxCreateView):
@ -370,7 +371,8 @@ class SalesOrderCreate(AjaxCreateView):
order = form.save(commit=False)
order.created_by = self.request.user
order.save()
return super().save(form)
class PurchaseOrderEdit(AjaxUpdateView):
@ -428,7 +430,7 @@ class PurchaseOrderCancel(AjaxUpdateView):
form.add_error('confirm', _('Confirm order cancellation'))
if not order.can_cancel():
form.add_error(None, _('Order cannot be cancelled'))
form.add_error(None, _('Order cannot be cancelled as either pending or placed'))
def save(self, order, form, **kwargs):
"""