From 244470fd8b567d0d5e6effe0b00786d3424b53c5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 18 Dec 2022 13:43:00 +0100 Subject: [PATCH] Added context variables fo user model (#404) * started python API reference guide * Added test to the API reference guide * Added Price break * added context variables to the build section * Cleand up build section and added new example * Fine tuning * fixed picture * removed unfinished python reference guide * Added allocated_stock to the build rreport * Added contect variables for user model * Added link to user in build.md --- docs/report/build.md | 6 +++--- docs/report/context_variables.md | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/report/build.md b/docs/report/build.md index 2a549d3..7ba819e 100644 --- a/docs/report/build.md +++ b/docs/report/build.md @@ -34,10 +34,10 @@ The following variables are accessed by build.variable | can_complete | Boolean that tells if the build can be completed ( all material allocated)| | creation_date | Date where the build has been created | | completion_date | Date the build was completed (or, if incomplete, the expected date of completion) | -| completed_by | User that completed the build | +| completed_by | The [User](./context_variables.md#user) that completed the build | | is_overdue | Boolean that tells if the build is overdue | | is_complete | Boolean that tells if the build is complete | -| issued_by | User who created the build | +| issued_by | The [User](./context_variables.md#user) who created the build | | link | External URL for extra information | | notes | Text notes | | parent | Reference to a parent build object if this is a sub build | @@ -45,7 +45,7 @@ The following variables are accessed by build.variable | quantity | Build order quantity | | reference | Build order reference (required, must be unique) | | required_parts | A query set with all parts that are required for the build | -| responsible | User (or group) responsible for completing the build | +| responsible | Owner responsible for completing the build. This can be a user or a group. Depending on that further context variables differ | | sales_order | References to a [Sales Order](./context_variables.md#salesorder) object for which this build is required (e.g. the output of this build will be used to fulfil a sales order) | | status | The status of the build. 20 means 'Production' | | sub_build_count | Number of sub builds | diff --git a/docs/report/context_variables.md b/docs/report/context_variables.md index 1922d16..e48da2b 100644 --- a/docs/report/context_variables.md +++ b/docs/report/context_variables.md @@ -231,3 +231,14 @@ Each part object has access to a lot of context variables about the part. The fo | prefix | Purchase Order reference prefix | | reference | The reference number | | title | The title of the order | + + +#### user + +| Variable | Description | +|----------|-------------| +| username | the username of the user | +| fist_name | The first name of the user | +| last_name | The last name of the user | +| email | The email address of the user | +| pk | The primary key of the user |