Word(.doc/.docx) Report In Odoo
By Muhamed Yasir,

  Category: Blog, Uncategorized     Comments: None

Sharing is caring!

As we know already, Odoo is providing most of the reports in PDF only. In some cases, we have option to export the report in Odoo. But most of the cases, we may face a situation to get the report in word file(.docx / .doc). This is required when we need to modify the content of the file like some application forms, certificate templates etc.

To manage this, by using python-docx library, we can print application forms, ceritificates templates and other word reports in Odoo. python-docx is a Python library for creating and updating Microsoft Word (.docx) files.

Installation

python-docx is hosted on PyPI, so installation is relatively simple, and just depends on what installation utilities you have installed.

python-docx may be installed with pip if you have it available:

python-docx can also be installed using easy_install, although this is discouraged:

If neither pip nor easy_install is available, it can be installed manually by downloading the distribution from PyPI, unpacking the tarball, and running setup.py:

python-docx depends on the lxml package. Both pip and easy_install will take care of satisfying those dependencies for you, but if you use this last method you will need to install those yourself.

Opening a document  

 

Adding a paragraph

Adding a heading

Adding a page break

Adding a table

Adding a picture

Applying a paragraph style

Applying bold and italic

Applying a character style

Example of python-docx

This will help you to do Odoo custom Xls reports as per your requirements. So this is one of the most common request from Odoo users. This  Odoo Customization helps to meet the users demand.

Leave a Reply

avatar
  Subscribe  
Notify of