mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
new function for initials
This commit is contained in:
parent
c2a5e1fd23
commit
4830ff28bf
@ -2051,6 +2051,10 @@ class PartPricing(AjaxView):
|
|||||||
|
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
def get_initials(self):
|
||||||
|
""" returns initials for form """
|
||||||
|
return {'quantity': self.get_quantity()}
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
|
|
||||||
quantity = self.get_quantity()
|
quantity = self.get_quantity()
|
||||||
@ -2063,8 +2067,7 @@ class PartPricing(AjaxView):
|
|||||||
quantity = self.get_quantity()
|
quantity = self.get_quantity()
|
||||||
|
|
||||||
# Retain quantity value set by user
|
# Retain quantity value set by user
|
||||||
form = self.form_class()
|
form = self.form_class(initial=self.get_initials())
|
||||||
form.fields['quantity'].initial = quantity
|
|
||||||
|
|
||||||
# TODO - How to handle pricing in different currencies?
|
# TODO - How to handle pricing in different currencies?
|
||||||
currency = None
|
currency = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user