mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Added context variables for address (#5807)
* Corrected report mixin example * Remove unused file * Added context variables for company and address * Repair link in file * Repair link in file * Repair link in file * Removed blank
This commit is contained in:
parent
3c5e2a3541
commit
4cd4a84bac
BIN
InvenTree/company/.models.py.swp
Normal file
BIN
InvenTree/company/.models.py.swp
Normal file
Binary file not shown.
@ -32,7 +32,7 @@ Rendering templated views is also supported. Templated HTML files should be plac
|
|||||||
Placed here, the template can be called using the file name (ex: `render(request, 'test.html', context)`)
|
Placed here, the template can be called using the file name (ex: `render(request, 'test.html', context)`)
|
||||||
|
|
||||||
### Implementing a Page Base
|
### Implementing a Page Base
|
||||||
Some plugins require a page with a navbar, sidebar, and content.
|
Some plugins require a page with a navbar, sidebar, and content.
|
||||||
This can be done within a templated HTML file. Extend the file "page_base.html". This can be done by placing the following line at the top of the file.
|
This can be done within a templated HTML file. Extend the file "page_base.html". This can be done by placing the following line at the top of the file.
|
||||||
``` HTML
|
``` HTML
|
||||||
{% extends "page_base.html" %}
|
{% extends "page_base.html" %}
|
||||||
@ -60,4 +60,4 @@ The current page base can be found [here](https://github.com/inventree/InvenTree
|
|||||||
|
|
||||||
|
|
||||||
{% endblock js_ready %}
|
{% endblock js_ready %}
|
||||||
```
|
```
|
||||||
|
@ -115,7 +115,7 @@ Each part object has access to a lot of context variables about the part. The fo
|
|||||||
|
|
||||||
### Stock
|
### Stock
|
||||||
|
|
||||||
#### Stock Item
|
#### StockItem
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
|----------|-------------|
|
|----------|-------------|
|
||||||
@ -144,7 +144,7 @@ Each part object has access to a lot of context variables about the part. The fo
|
|||||||
| purchase_price | The unit purchase price for this [StockItem](./context_variables.md#stockitem) - this is the unit price at time of purchase (if this item was purchased from an external supplier) |
|
| purchase_price | The unit purchase price for this [StockItem](./context_variables.md#stockitem) - this is the unit price at time of purchase (if this item was purchased from an external supplier) |
|
||||||
| packaging | Description of how the StockItem is packaged (e.g. "reel", "loose", "tape" etc) |
|
| packaging | Description of how the StockItem is packaged (e.g. "reel", "loose", "tape" etc) |
|
||||||
|
|
||||||
#### Stock Location
|
#### StockLocation
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
|----------|-------------|
|
|----------|-------------|
|
||||||
@ -161,18 +161,19 @@ Each part object has access to a lot of context variables about the part. The fo
|
|||||||
|
|
||||||
### Suppliers
|
### Suppliers
|
||||||
|
|
||||||
#### Supplier
|
#### Company
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
|----------|-------------|
|
|----------|-------------|
|
||||||
| name | Name of the company |
|
| name | Name of the company |
|
||||||
| description | Longer form description |
|
| description | Longer form description |
|
||||||
| website | URL for the company website |
|
| website | URL for the company website |
|
||||||
| address | Postal address |
|
| primary_address | [Address](./context_variables.md#address) object that is marked as primary address |
|
||||||
| contact | Contace Name |
|
| address | String format of the primary address |
|
||||||
|
| contact | Contact Name |
|
||||||
| phone | Contact phone number |
|
| phone | Contact phone number |
|
||||||
| email | Contact email address |
|
| email | Contact email address |
|
||||||
| link | A second econdary URL to the company (Actually only accessible in the admin interface) |
|
| link | A second URL to the company (Actually only accessible in the admin interface) |
|
||||||
| notes | Extra notes about the company (Actually only accessible in the admin interface) |
|
| notes | Extra notes about the company (Actually only accessible in the admin interface) |
|
||||||
| is_customer | Boolean value, is this company a customer |
|
| is_customer | Boolean value, is this company a customer |
|
||||||
| is_supplier | Boolean value, is this company a supplier |
|
| is_supplier | Boolean value, is this company a supplier |
|
||||||
@ -180,13 +181,23 @@ Each part object has access to a lot of context variables about the part. The fo
|
|||||||
| currency_code | Default currency for the company |
|
| currency_code | Default currency for the company |
|
||||||
| parts | Query set with all parts that the company supplies |
|
| parts | Query set with all parts that the company supplies |
|
||||||
|
|
||||||
|
#### Address
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
|----------|-------------|
|
||||||
|
| line1 | First line of the postal address |
|
||||||
|
| line2 | Second line of the postal address |
|
||||||
|
| postal_code | ZIP code of the city |
|
||||||
|
| postal_city | City name |
|
||||||
|
| country | Country name |
|
||||||
|
|
||||||
#### SupplierPart
|
#### SupplierPart
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
|----------|-------------|
|
|----------|-------------|
|
||||||
| part | Link to the master Part (Obsolete) |
|
| part | Link to the master Part (Obsolete) |
|
||||||
| source_item | The sourcing [StockItem](./context_variables.md#stockitem) linked to this [SupplierPart](./context_variables.md#supplierpart) instance |
|
| source_item | The sourcing [StockItem](./context_variables.md#stockitem) linked to this [SupplierPart](./context_variables.md#supplierpart) instance |
|
||||||
| supplier | [Supplier](./context_variables.md#supplier) that supplies this part |
|
| supplier | [Company](./context_variables.md#company) that supplies this part |
|
||||||
| SKU | Stock keeping unit (supplier part number) |
|
| SKU | Stock keeping unit (supplier part number) |
|
||||||
| link | Link to external website for this supplier part |
|
| link | Link to external website for this supplier part |
|
||||||
| description | Descriptive notes field |
|
| description | Descriptive notes field |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user