Context data available in Production Sheets

Part production sheet

The outermost structure looks like that:

{ "theme_font": "Open Sans", "theme_date_format": "d.m.Y", "logo_url": <url to the service logo picture> "issue_date": <date + time when the sheet was created>, "parts": (explained below), }

parts attribute is a list containing all of the selected MesParts.

That’s why you would usually iterate over the parts in the template.
Example:

{% for part in parts %} ... {% endfor %}

 

Following attributes are available for every item in parts:

 

  • issue_date
    Date + time when the prod sheet was created
    Example:
    {{ part.issue_date }}

  • picture_url
    Url to get the part thumbnail
    Example:

    <img src="{{ part.picture_url }}" alt="part_image" class="line-image" >

     

  • part_url
    Url to the part detail page of a part
    It is used to create a qr code, that’s why ?qr is added at the end of the URL
    Example:

     

  • project_name
    Name of the part’s project
    Example:
    {{ part.project_name }}

  • order_date
    Date + time when the part’s order was created
    Example:
    {{ part.order_date }}

  • order_number
    Number of the part’s order
    Example:
    {{ part.order_number }}

  • order_reference
    Customer reference provided while creating the part’s order
    Example:
    {{ part.order_reference }}

  • shipping_method
    Shipping method specified in the part’s order
    Example:
    {{ part.shipping_method }}

  • payment_method
    Payment method specified in the part’s order
    Example:
    {{ part.payment_method }}

  • customer_name
    Full name of the person who ordered the part
    Example:
    {{ part.customer_name }}

  • customer_phone
    Mobile phone number of the person who ordered the part
    Example:
    {{ part.customer_phone }}

  • customer_email
    Email address of the person who ordered the part
    Example:
    {{ part.customer_email }}

  • production_steps
    This will be only populated if part has exactly one sequence.
    List of the workflow step objects - ordered steps from the parts’s workflow.
    Each object have multiple attributes. This is the structure of the step object:


    Example:

     

  • production_steps_raw
    List of the workflow step objects - ordered steps from the parts’s workflow.
    Each object has all the attributes you can find in b3_mes_workflowstatus table.
    Example:

     

  • name
    Part’s name
    Example:
    {{ part.name }}

  • number
    Part’s id
    Example:
    {{ part.number }}

  • quantity
    Number of part’s copies to be printed
    Example:
    {{ part.quantity }}

  • material
    Name of the part’s configured material
    Example:
    {{ part.material }}

  • technology
    Name of the technology, used to print with a given material
    Example:
    {{ part.technology }}

  • dimensions
    Part’s dimensions specified in the STL file
    Example:

     

  • measure_unit
    Unit used to specify dimensions in the STL file
    Example:
    {{ part.measure_unit }}

  • post_processings
    List of the part’s post processings objects.
    Each object have two attributes: title and colorTitle.
    Example:

     

  • instructions
    Instructions related to processing the part
    Example:
    {{ part.instructions }}

  • attachments
    List of attachment objects added in the part detail view.
    Each object has all the attributes you can find in b3_mes_partattachment table.
    Example:

     

  • assignees
    List of user objects, that are attached to the part as assignees.
    Each object has all the attributes you can find in auth_user table + b3_organization_userprofile.
    Example:

     

  • target_date
    Part’s target date
    Example:
    {{ part.target_date }}

  • part_requirements
    List of field objects, that are attached to the part as part requirements.
    Each object has multiple attributes: label, type, value.
    Example:

Job production sheet

The outermost structure looks like that:

parts attribute is a list containing all of the sequences of a job.

You would usually iterate over the parts in the template.
Example:

Every object in parts contain the same attributes as objects in the sequence prod sheet. Please reference Sequence prod sheet from this doc below.

Available job attributes:

  • job
    Job object.
    It has all the attributes you can find in b3_mes_job table.
    Example:

    {{ job.workstation.name }}

  • group_quantity
    A sum of all sequence quantities.
    Example:
    {{ group_quantity }}

  • job_documentation
    List of field objects, that are attached to the job as job requirements.
    Each object has multiple attributes: label, type, value.
    Example:

     

  • job_url
    Url to the job detail page of the job
    It is used to create a qr code, that’s why ?qr is added at the end of the URL
    Example:

     

  • job_assignees
    A string containing the full names of users who are assigned to the job.
    Example:

    {{ job_assignees }}

  • job_duration
    Job’s duration in the format HH:MM:SS
    Example:

    {{ job_duration }}

  • job_material_lots
    A string containing internal_lot_numbers of lots assigned to the job.
    Example:

    {{ job_material_lots }}

  • job_material
    Name of the material which is used in the job.
    Example:
    {{ job_material }}

  • job_technology
    Name of the technology that is used to print with the configured material.
    Example:
    {{ job_technology }}

  • job_attachments
    List of attachment objects added in the job detail view.
    Each object has all the attributes you can find in b3_mes_jobattachment table.
    Example:

Sequence production sheet

The outermost structure looks like that:

parts attribute is a list containing all of the selected sequences.

You would usually iterate over the parts in the template.
Example:

Every object in parts contain the same data as objects in Part prod sheet + few extra attributes.
Extra parts attributes:

  • sequence_amount
    Quantity of items in a given sequence.
    Example:

    {{ part.sequence_amount }}

  • sequence_id
    ID of the sequence.
    Example:
    {{ part.sequence_id }}

  • sequence_url
    Url to the hidden detail view of the sequence.
    It is used to create a qr code, that’s why ?qr is added at the end of the URL
    Example:

     

  • sequence_steps
    This is the same object as `production_steps` in Part prod sheet.
    It is always populated.