2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 18:45:40 +00:00

Adds "active" field for Company model (#7024)

* Add "active" field to Company model

* Expose 'active' parameter to API

* Fix default value

* Add 'active' column to PUI

* Update PUI table

* Update company detail pages

* Update API filters for SupplierPart and ManufacturerPart

* Bump API version

* Update order forms

* Add edit action to SalesOrderDetail page

* Enable editing of ReturnOrder

* Typo fix

* Adds explicit "active" field to SupplierPart model

* More updates

- Add "inactive" badge to SupplierPart page
- Update SupplierPartTable
- Update backend API fields

* Update ReturnOrderTable

- Also some refactoring

* Impove usePurchaseOrderLineItemFields hook

* Cleanup

* Implement duplicate action for SupplierPart

* Fix for ApiForm

- Only override initialValues for specified fields

* Allow edit and duplicate of StockItem

* Fix for ApiForm

- Default values were overriding initial data

* Add duplicate part option

* Cleanup ApiForm

- Cache props.fields

* Fix unused import

* More fixes

* Add unit tests

* Allow ordering company by 'active' status

* Update docs

* Merge migrations

* Fix for serializers.py

* Force new form value

* Remove debug call

* Further unit test fixes

* Update default CSRF_TRUSTED_ORIGINS values

* Reduce debug output
This commit is contained in:
Oliver
2024-04-20 23:18:25 +10:00
committed by GitHub
parent 2632bcfbbc
commit 2fe0eefa8f
41 changed files with 927 additions and 390 deletions

View File

@ -12,8 +12,7 @@ Run the following commands from the top-level project directory:
```
$ git clone https://github.com/inventree/inventree
$ cd inventree/docs
$ pip install -r requirements.txt
$ pip install -r docs/requirements.txt
```
## Serve Locally

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -11,7 +11,7 @@ External companies are represented by the *Company* database model. Each company
- [Manufacturer](#manufacturers)
!!! tip Multi Purpose
A company may be allocated to multiple categories
A company may be allocated to multiple categories, for example, a company may be both a supplier and a customer.
### Edit Company
@ -20,6 +20,20 @@ To edit a company, click on the <span class='fas fa-edit'>Edit Company</span> ic
!!! warning "Permission Required"
The edit button will not be available to users who do not have the required permissions to edit the company
### Disable Company
Rather than deleting a company, it is possible to disable it. This will prevent the company from being used in new orders, but will not remove it from the database. Additionally, any existing orders associated with the company (and other linked items such as supplier parts, for a supplier) will remain intact. Unless the company is re-enabled, it will not be available for selection in new orders.
It is recommended to disable a company rather than deleting it, as this will preserve the integrity of historical data.
To disable a company, simply edit the company details and set the `active` attribute to `False`:
{% with id="company_disable", url="order/company_disable.png", description="Disable Company" %}
{% include "img.html" %}
{% endwith %}
To re-enable a company, simply follow the same process and set the `active` attribute to `True`.
### Delete Company
To delete a company, click on the <span class='fas fa-trash-alt'></span> icon under the actions menu. Confirm the deletion using the checkbox then click on <span class="badge inventree confirm">Submit</span>
@ -193,6 +207,24 @@ To edit a supplier part, first access the supplier part detail page with one of
After the supplier part details are loaded, click on the <span class='fas fa-edit'></span> icon next to the supplier part image. Edit the supplier part information then click on <span class="badge inventree confirm">Submit</span>
#### Disable Supplier Part
Supplier parts can be individually disabled - for example, if a supplier part is no longer available for purchase. By disabling the part in the InvenTree system, it will no longer be available for selection in new purchase orders. However, any existing purchase orders which reference the supplier part will remain intact.
The "active" status of a supplier part is clearly visible within the user interface:
{% with id="supplier_part_disable", url="order/disable_supplier_part.png", description="Disable Supplier Part" %}
{% include "img.html" %}
{% endwith %}
To change the "active" status of a supplier part, simply edit the supplier part details and set the `active` attribute:
{% with id="supplier_part_disable_edit", url="order/disable_supplier_part_edit.png", description="Disable Supplier Part" %}
{% include "img.html" %}
{% endwith %}
It is recommended to disable a supplier part rather than deleting it, as this will preserve the integrity of historical data.
#### Delete Supplier Part
To delete a supplier part, first access the supplier part detail page like in the [Edit Supplier Part](#edit-supplier-part) section.