2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Make modals/forms more reactive (#5897)

* First draft for refactoring the api forms including modals

* Fix merging errors

* Fix deepsource

* Fix jsdoc

* trigger: deepsource

* Try to improve performance by not passing the whole definition down

* First draft for switching to react-hook-form

* Fix warning log in console with i18n when locale is not loaded

* Fix: deepsource

* Fixed RelatedModelField initial value loading and disable submit if form is not 'dirty'

* Make field state hookable to state

* Added nested object field to PUI form framework

* Fix ts errors while integrating the new forms api into a few places

* Fix: deepsource

* Fix some values were not present in the submit data if the field is hidden

* Handle error while loading locales

* Fix: deepsource
This commit is contained in:
Lukas
2023-11-20 14:00:44 +01:00
committed by GitHub
parent 0d7b4f2f17
commit cb537780dc
20 changed files with 1161 additions and 690 deletions

View File

@ -819,7 +819,7 @@ class PartSerializer(InvenTree.serializers.RemoteImageMixin, InvenTree.serialize
# Create initial stock entry
if initial_stock:
quantity = initial_stock['quantity']
location = initial_stock['location'] or instance.default_location
location = initial_stock.get('location', None) or instance.default_location
if quantity > 0:
stockitem = stock.models.StockItem(