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 if Show field hints in Open Developer Tools 's is activated, .
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;
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.comSelection Field:
{{dict(object.x_test_selection)}}
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"}}
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 "}}
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) .
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.
How to Print Document
Lastly, select "Print" to print the document.
See: The print option in the Sales Module is shown above