From 4cd4a84bacd40c292d2cf8ade4fd1e34a6f96ca3 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 29 Oct 2023 12:07:21 +0100 Subject: [PATCH] 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 --- InvenTree/company/.models.py.swp | Bin 0 -> 16384 bytes docs/docs/extend/plugins/urls.md | 4 ++-- docs/docs/report/context_variables.md | 25 ++++++++++++++++++------- 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 InvenTree/company/.models.py.swp diff --git a/InvenTree/company/.models.py.swp b/InvenTree/company/.models.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..3108f0257b9bc0271005898a3bae9012f07c1252 GIT binary patch literal 16384 zcmeHNTZ|k>6)ghc;b4f8ACLf57QxIqechujpgux zKw@ z-(151--1iNC zgmS<`bMlwxB@uY381KmUO5AoTN+mv4Ic7w6g{D6Y}7rcDr z+y8t{{!cF-czNfw?nh|v|B^R*`B&!T{&e%zFwij2Fwij2Fwij2Fwij2Fwij2Fwij2 zFz`RgfO)>Z0MA}FH@bNKAMXFJy_Jw>fnNeY0KN=-2~fac;11xgZz1F-z{i0Hf%gLh zxUrXz-vK`c9tR!+G;k4E0TzKfffsNy{T%QM;H$tX;CA4tI|%tK@EPFKz%S@(l1a@KfMhz}JCCfQNyP0Ed8mz}tbh0nfjQkiP+c0DcYp3iuxIUEn*w5Lf~t z;JG&v@_XP(U<6#pyAUq{F9Lr8o&vrG2;jZIZNP6|PslfcZQum37r1&mA)f*Aa3J_!%$)J_;NH4g&W8dw{1=Uw8ue2G9ob_1?Fqyxn4@*zXzKp9!T~6Ymxl7S1?rL-We%HHvwo zOsOIfO!Jg(2|cn?5Ztshp_%P1a@`)7z*4;nEz4Plw)mKdtaY(N&52&C zvJGr##8woSOvtHWC$%jF4=xbf4L%B)aw+nmIT?&ke8H&Kxn@ZQeh_B^k#j{6w34~t zp@j`v71(i#rb*Y45Co>Xq>_^7$#$IJJ*F<*D0w0DYX>nG1|jd({Y_=GE3%{la9^K8MOeh^YmNWLCHYWx5K%GTRNN&-GL?sS(`>c$iT|mexK7 zgR>0>vKa5yw5((@Vv750wWh6m*0tIYe8xb1oSPBMUQD#@6pC?Q#KgHj@P1p zi6f-y`3FC_$ssNj{bd>vmpXiqx9dgqq`6Yo#TAivsL3lS)6D<%%h$SjD-vngb?sMz z0%NoH8n%pf36VX6m9Y*Ly3i(F2(d*)c{Rdo@MW?kmDJrCT zBc>mu%ia;=yfGg}+OV#(X3ozVqe#`L?|hY$&asJ9FmP$ic0tN(`}z*A~k{Y0PuRHL{%jqu6D> zd)v^%hdXqm8h3VVH0N3cbw2~sR3wGuQ$Z9o*F}EbY{c;4!fVE&ZN#r6+-(~}Bd?5r zI3{H=J8V{#^+?U{Fd^=82p0U+;XA`VUJIlkPbb3M{wMx_0VBv+tKt3$ON!01c9d?L zD@-y|kx8)T{{IWO7yk`l?*DQ7ZI2tczrPAR4m<{Y9(WJ%N8I0k8#oE91MdJ#+iRwM zb2JPz3^WWh3^WWh3^WWh3^WWh3^WWh4E(nln63kbniFbXKow>Z@?jp44G%Q6)k>ccm;>k_7ekqyB!h zy=cvtit)U*fT`^Hy1$(mF!&C~@iZhgwkv)lh<#{LbZJ_Dx! literal 0 HcmV?d00001 diff --git a/docs/docs/extend/plugins/urls.md b/docs/docs/extend/plugins/urls.md index 5ebef8d7bb..0bf16f3016 100644 --- a/docs/docs/extend/plugins/urls.md +++ b/docs/docs/extend/plugins/urls.md @@ -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)`) ### 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. ``` 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 %} -``` \ No newline at end of file +``` diff --git a/docs/docs/report/context_variables.md b/docs/docs/report/context_variables.md index 7ec4bc21b3..610f8e4cda 100644 --- a/docs/docs/report/context_variables.md +++ b/docs/docs/report/context_variables.md @@ -115,7 +115,7 @@ Each part object has access to a lot of context variables about the part. The fo ### Stock -#### Stock Item +#### StockItem | 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) | | packaging | Description of how the StockItem is packaged (e.g. "reel", "loose", "tape" etc) | -#### Stock Location +#### StockLocation | Variable | Description | |----------|-------------| @@ -161,18 +161,19 @@ Each part object has access to a lot of context variables about the part. The fo ### Suppliers -#### Supplier +#### Company | Variable | Description | |----------|-------------| | name | Name of the company | | description | Longer form description | | website | URL for the company website | -| address | Postal address | -| contact | Contace Name | +| primary_address | [Address](./context_variables.md#address) object that is marked as primary address | +| address | String format of the primary address | +| contact | Contact Name | | phone | Contact phone number | | 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) | | is_customer | Boolean value, is this company a customer | | 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 | | 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 | Variable | Description | |----------|-------------| | 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 | -| 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) | | link | Link to external website for this supplier part | | description | Descriptive notes field |