Docx Template Documentation

  Docx Template Guide  


This Guide shows how to create a document template.

 

How to Prepare Document Template


The basic features that should be known while preparing the template are shown below, using sale order as an example.  The field name can easily be seen iShow field hints in Open Developer Tools 's is activated, .

Docx Template Documentation 1


An object is simply summarized as a record from where the user wanted to print the information from. For this example, the object is "sale.order".

Some useful codes are given below as follows;

  • 1
    General Information

     Print Date:

    {{datetime.today().strftime('%d-%m-%Y')}}

    Image: 

    {{img(object.partner_id.image,size=(512,512)) or ‘’}}

    Link: 

    {{link(object.user_id.email)}}
    info@cloudoffix.com


    Selection Field:

    {{dict(object.x_test_selection)}}

  • 2
    Get Information from an Object

    Sale order id:

    {{object.name}}

    Amount of taxes and currency: 

    {{object.amount_tax}}{{object.currency_id.symbol}}

    Subtotal amount with 2 digits after the comma and the currency: 

    {{'{:,.2f}'.format(object.sub_total)}}{{object.currency_id.symbol}}

    Payment terms:

    {{object.payment_term_id}}

    Expiration date(value in the cell or blank):

    {{object.validity_date or"}}
  • 3
    Get Information from an Object in another Object

    Related person's name only:

    {{object.partner_id.name}} 

    Company name only:

    {{object.partner_id.parent_id.name}}

    Email:

    {{object.partner_id.name.email or "}}
  • 4
    Get Information from a List in an Object

    Loop usage is essential when it is necessary to get information from a list (One2many, Many2many field) .

    Docx Template Documentation 3


How to Transfer Document Template to CloudOffix



Next, follow the steps below:

      • Go to Settings Module

      • The Docx Templates can be found under the Technical title. (If it is absent, It means that the module CloudOffix Report Engine is not loaded)

      • Enter the Docx Templates and create new template.

      • Upload the template.

      • Then Go to Reporting under the Technical title.

      • Choose Docx as Report Type, and PDF as Output Format.

      • Then select the loaded template in the Template field.

Docx Template Documentation 4

 

How to Print Document


 Lastly, select "Print" to print the document.

See: The print option in the Sales Module is shown above

Docx Template Documentation 5