Skip to content

Commit

Permalink
Build order rules (#7842)
Browse files Browse the repository at this point in the history
* Add new global setting

* Check if there are open children before completing a build

* Adds management command to export settings definition

* Fix settings export

* Extract settings data into documentation

* Add global settings spec

* User settings

* Revert strict mode

* Tweak unit test

* Remove unreachable code

* Always export settings first

* Remove unused macro

* Remove old images

* Re-add missing docs strings

* Tweak docs

* Remove unused import
  • Loading branch information
SchrodingersGat authored Aug 9, 2024
1 parent 556a316 commit 42183a3
Show file tree
Hide file tree
Showing 20 changed files with 378 additions and 161 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ InvenTree/web/static
docs/schema.yml
docs/docs/api/*.yml
docs/docs/api/schema/*.yml
inventree_settings.json
Binary file not shown.
Binary file removed docs/docs/assets/images/settings/user_reporting.png
Binary file not shown.
28 changes: 13 additions & 15 deletions docs/docs/build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,16 @@ Build orders may (optionally) have a target complete date specified. If this dat
- Builds can be filtered by overdue status in the build list
- Overdue builds will be displayed on the home page

## Build Order Restrictions

There are a number of optional restrictions which can be applied to build orders, which may be enabled or disabled in the system settings:

### Require Active Part

If this option is enabled, build orders can only be created for parts which are marked as [Active](../part/part.md#active-parts).

### Require Locked Part

If this option is enabled, build orders can only be created for parts which are marked as [Locked](../part/part.md#locked-parts).

### Require Valid BOM

If this option is enabled, build orders can only be created for parts which have a valid [Bill of Materials](./bom.md) defined.
## Build Order Settings

The following [global settings](../settings/global.md) are available for adjusting the behavior of build orders:

| Name | Description | Default | Units |
| ---- | ----------- | ------- | ----- |
{{ globalsetting("BUILDORDER_REFERENCE_PATTERN") }}
{{ globalsetting("BUILDORDER_REQUIRE_RESPONSIBLE") }}
{{ globalsetting("BUILDORDER_REQUIRE_ACTIVE_PART") }}
{{ globalsetting("BUILDORDER_REQUIRE_LOCKED_PART") }}
{{ globalsetting("BUILDORDER_REQUIRE_VALID_BOM") }}
{{ globalsetting("BUILDORDER_REQUIRE_CLOSED_CHILDS") }}
{{ globalsetting("PREVENT_BUILD_COMPLETION_HAVING_INCOMPLETED_TESTS") }}
11 changes: 11 additions & 0 deletions docs/docs/order/purchase_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,14 @@ This view can be accessed externally as an ICS calendar using a URL like the fol
`http://inventree.example.org/api/order/calendar/purchase-order/calendar.ics`

by default, completed orders are not exported. These can be included by appending `?include_completed=True` to the URL.

## Purchase Order Settings

The following [global settings](../settings/global.md) are available for purchase orders:

| Name | Description | Default | Units |
| ---- | ----------- | ------- | ----- |
{{ globalsetting("PURCHASEORDER_REFERENCE_PATTERN") }}
{{ globalsetting("PURCHASEORDER_REQUIRE_RESPONSIBLE") }}
{{ globalsetting("PURCHASEORDER_EDIT_COMPLETED_ORDERS") }}
{{ globalsetting("PURCHASEORDER_AUTO_COMPLETE") }}
11 changes: 11 additions & 0 deletions docs/docs/order/return_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,14 @@ This view can be accessed externally as an ICS calendar using a URL like the fol
`http://inventree.example.org/api/order/calendar/return-order/calendar.ics`

by default, completed orders are not exported. These can be included by appending `?include_completed=True` to the URL.

## Return Order Settings

The following [global settings](../settings/global.md) are available for return orders:

| Name | Description | Default | Units |
| ---- | ----------- | ------- | ----- |
{{ globalsetting("RETURNORDER_ENABLED") }}
{{ globalsetting("RETURNORDER_REFERENCE_PATTERN") }}
{{ globalsetting("RETURNORDER_REQUIRE_RESPONSIBLE") }}
{{ globalsetting("RETURNORDER_EDIT_COMPLETED_ORDERS") }}
12 changes: 12 additions & 0 deletions docs/docs/order/sales_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,15 @@ All these fields can be edited by the user:
{% with id="edit-shipment", url="order/edit_shipment.png", description="Edit shipment" %}
{% include "img.html" %}
{% endwith %}

## Sales Order Settings

The following [global settings](../settings/global.md) are available for sales orders:

| Name | Description | Default | Units |
| ---- | ----------- | ------- | ----- |
{{ globalsetting("SALESORDER_REFERENCE_PATTERN") }}
{{ globalsetting("SALESORDER_REQUIRE_RESPONSIBLE") }}
{{ globalsetting("SALESORDER_DEFAULT_SHIPMENT") }}
{{ globalsetting("SALESORDER_EDIT_COMPLETED_ORDERS") }}
{{ globalsetting("SALESORDER_SHIP_COMPLETE") }}
7 changes: 1 addition & 6 deletions docs/docs/settings/currency.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ If a different currency exchange backend is needed, or a custom implementation i

### Currency Settings

In the [settings screen](./global.md), under the *Pricing* section, the following currency settings are available:

| Setting | Description | Default Value |
| --- | --- |
| Default Currency | The selected *default* currency for the system. | USD |
| Supported Currencies | The list of supported currencies for the system. | AUD, CAD, CNY, EUR, GBP, JPY, NZD, USD |
Refer to the [global settings](./global.md#pricing-and-currency) documentation for more information on available currency settings.

#### Supported Currencies

Expand Down
Loading

0 comments on commit 42183a3

Please sign in to comment.