Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Technical
  3. DOCX report generation v 17.0
  4. Sales Conditions FAQ

DOCX report generation

by RYDLAB https://rydlab.ru
Odoo
v 17.0 Third Party 623
Download for v 17.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies Show
• Custom report field
• Report monetary helpers
Lines of code 897
Technical Name docx_report_generation
LicenseLGPL-3
Websitehttps://rydlab.ru
Versions 14.0 15.0 16.0 17.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies Show
• Custom report field
• Report monetary helpers
Lines of code 897
Technical Name docx_report_generation
LicenseLGPL-3
Websitehttps://rydlab.ru
Versions 14.0 15.0 16.0 17.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
  Have questions or need support?

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.

Example of use for tables

The templates use Jinja2 syntax and support table generation.

Rydlab company logo

Need any help for this module?

Contact us for your queries

Email: apps@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.
  • Ratings
  • Discuss
There are no ratings yet!
nice add on
by
Mohamed Salman Ramadhan
on 11/18/24, 11:11 PM

thanks for the effort, but i think gotenberg module is missing, it is related to this line:

from odoo.addons.gotenberg.service.utils import ( 
        get_auth,  # noqa 
        convert_pdf_from_office_url,  # noqa 
        check_gotenberg_installed,  # noqa 
        ) 

i could not find gotenberg module anywhere in your module, could you assist in this ?

PS: gotenberg service is already running as a docker along with odoo on same network, i entered odoo console and manually converted a docx to pdf with success, but when choosing docx(pdf) in the report i am getting:
Gotenberg converting service not available. The PDF can not be created.


Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with