DOCX report generation

by
Odoo
v 16.0 Third Party 61
Download for v 16.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies
Lines of code 888
Technical Name docx_report_generation
LicenseLGPL-3
Websitehttps://rydlab.ru
Versions 16.0 14.0 15.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies
Lines of code 888
Technical Name docx_report_generation
LicenseLGPL-3
Websitehttps://rydlab.ru
Versions 16.0 14.0 15.0

DOCX REPORT

The DOCX REPORT module is a tool for creating templates using the Jinja template engine. The module allows you to add docx files to the report model as a source template. Thanks to this, you can create automatically filled-out documents in docx and pdf formats.

Rydlab company logo

Features

Easy creation of auto-filled documents

There is no need to create a complex HTML template that is difficult to edit and customize. It is enough to take a template in Docx format and insert the necessary values in the right places.

Access to all attributes of the model

During the creation of the report, the model to which this report belongs is specified. When creating a report template, we can refer to any attribute of the specified model.

Easy template maintenance

There is no need to change the template in the Odoo code; it is enough to upload a new template through the user interface.

The amount-to-words methods are available

Thanks to these methods, we can insert numbers and sums with currencies in words and round the numbers to the desired accuracy.

How to use

Step 1: Install the module

Open the Apps menu in your Odoo and install the module "DOCX report".

Step 2: Activate the Developer Mode

To create a new report in the user interface, we need to activate the developer mode.

Step 3: Open Reports

Now you should go back to the settings. Click "Technical", scroll down the list, and click "Reports".

Step 4: Create Docx template

1. To get model attributes like model field values, use the word "docs" + (dot) + model field name.

2. To call a model method that returns a value, use the word "record" + . (dot) + model method name + () to call it.

3. Use double curly braces "{{ }}" to call methods and attributes.

4. Use curly braces with the percentage sign "{% %}" to create local variables and use loops and if conditions.

Step 5: Reports list view

When the Reports list view will be opened, click the "New" button to create a new report.

Step 6: Create a Report

1. To create a new report, you should fill out the form.

2. "Action name" is the name that will be shown in the Print menu of the model.

3. "Report Type" should be DOCS or DOCX (PDF). The gotenberg service is used to create pdf files. To use it, you need to install the Odoo module to communicate with the service and enter the access details.

4. "Model name" is the name of the model. Fields and methods will be derived from this model.

5. "Report docx template" is the template file that was created at step 4.

6. "Printed report name" is the name of the file after generation.

7. To add this report to the Print menu, you should click on the button "Add in the Print".

Step 7: Create a custom field

1. Custom fields are needed to get data that is not in the fields of the model associated with the report. Thanks to them, you can get data from other models, for example, through the reference fields of the current model.

2. To create a custom field you should click "Custom Fields" menu on the form and then click "Add a line"

3. After that, write your Python code for the new variable.

4. In the template, custom fields are available by the name specified in the "tech_name" field of the custom field entry. For exapmle: {{ contract_date }}.

Step 8: Print the Report

After printing the report the file will be saved. The information from the model will complete the template.

Step 9: Make a report from the Python code

If you want to make the report from the Python code, you should make an ir.action.report record and an ir.attachment record that is connected to the first one. Add the path to the Docx template from step 4.

Rydlab company logo

Need any help for this module?

Contact us for your queries

Email: company@rydlab.ru

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
There are no ratings yet!
by
Fathi Ghaiati
on 5/10/24, 7:02 PM

Hello very good module features however has issue to install it as below, appreciate your advise, thanks 

The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.
Could not get content for docx_report/static/src/css/mimetypes.css.