Docx Report - Populating MS Word templates | Report Doc | Report Docx

by
Odoo

106.31

v 17.0 Third Party 156
Live Preview
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 722
Technical Name populating_ms_word_template
LicenseOPL-1
Versions 14.0 15.0 13.0 17.0 16.0 11.0 9.0 12.0 10.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 722
Technical Name populating_ms_word_template
LicenseOPL-1
Versions 14.0 15.0 13.0 17.0 16.0 11.0 9.0 12.0 10.0

Populating MS Word templates

Simple & Effective

Design print templates using word

Installation required: pip install docx-mailmerge You just need to design a word template file and put it on odoo. So you have a design template on word.

DEMO

Date: 28/12/2020 Update version: 1.3

Features updated

1. Convert datetime UTC to datetime user timezone.

2. Add keyword "numerical_order" to do ordinal numbers in the printed data table.

3. Add keyword "float_time" to display time.

4. Add the keyword "count" to count the total number of lines.

5. Additional keyword "sum_number2word" to convert from numbers to letters.

Date: 12/04/2022 Update version: 1.3

Features updated

1. Fix error not downloading PDF files .

2. Define file name docx .

DEMO Version 1.3

Input:

Output:

Date: 21/04/2022 Update version 1.4

Features updated

Export PDF file

DEMO Version 1.4

Video Demo

File Source:

Sample files: Click Download

Export Docx:

Export PDF:

Date: 10/09/2022 Update version 1.5

Features updated

Fix installation error on odoo SH

Date: 04/10/2022 Update version 1.6

Features updated

1. Allows to export images to docx and pdf files

2. Allow to get a value in field one2 many (treeview)

3. Fix the error of exporting attachments in emails

Click Open Video Demo

Date: 24/08/2023 Update version 1.7

Features updated

1. Allow to convert barcode from data field

2. Allow execution of IF . conditional statement

Click Open Video Demo

Free User Manual Support

1. You get free training support via teamviewer

2. You are support directly via skype for free

Supports

Free 24/7

For any supports or questions, please contact me via:

dev.odoo.vn@gmail.com

Thank you!

Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

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 or have a question related to your purchase, please use the support page.
There are no ratings yet!
Error
by
Global Brand Company
on 4/27/24, 6:04 AM Confirmed Purchase

RPC_ERROR

Odoo Server Error

Traceback (most recent call last):

  File "/mnt/extra-addons/populating_ms_word_template/controllers/report_controller.py", line 71, in report_download

    response = self.report_routes(reportname, docids=docids, converter=converter, context=context)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 722, in route_wrapper

    result = endpoint(self, *args, **params_ok)

  File "/mnt/extra-addons/populating_ms_word_template/controllers/report_controller.py", line 41, in report_routes

    pdf = report.with_context(context).render_doc_doc(datas, data=data)[0]

  File "/mnt/extra-addons/populating_ms_word_template/models/ir_actions_report.py", line 330, in render_doc_doc

    docx = self.export_doc_by_template(datas=res_ids[0], file_name_export=self.print_report_name,suffix=suffix)

  File "/mnt/extra-addons/populating_ms_word_template/models/ir_actions_report.py", line 323, in export_doc_by_template

    return self.convert_docx_to_pdf(docx_binary_value)

  File "/mnt/extra-addons/populating_ms_word_template/models/ir_actions_report.py", line 388, in convert_docx_to_pdf

    process = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout)

  File "/usr/lib/python3.10/subprocess.py", line 503, in run

    with Popen(*popenargs, **kwargs) as process:

  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__

    self._execute_child(args, executable, preexec_fn, close_fds,

  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child

    raise child_exception_type(errno_num, err_msg, err_filename)

FileNotFoundError: [Errno 2] No such file or directory: 'libreoffice'


The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    RPCError@https://test.sanamq8.com/web/assets/b6a976d/web.assets_web.min.js:2873:319

    makeErrorFromResponse@https://test.sanamq8.com/web/assets/b6a976d/web.assets_web.min.js:2876:163

    configureBlobDownloadXHR/xhr.onload/decoder.onload@https://test.sanamq8.com/web/assets/b6a976d/web.assets_web.min.js:2862:7


Support!
by
Mirsad Selimovic
on 3/31/24, 7:42 PM Confirmed Purchase

Dear,
I have uploaded to custom addons as every else and on activate I get this error :

I have installed pip to each user and even my venv enviroment

Traceback (most recent call last):
  File "/opt/odoo17/odoo17/odoo/http.py", line 1765, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo17/odoo17/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/opt/odoo17/odoo17/odoo/http.py", line 1792, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo17/odoo17/odoo/http.py", line 1996, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo17/odoo17/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo17/odoo17/odoo/http.py", line 722, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo17/odoo17/addons/web/controllers/dataset.py", line 28, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/opt/odoo17/odoo17/addons/web/controllers/dataset.py", line 20, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo17/odoo17/odoo/api.py", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo17/odoo17/odoo/api.py", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "", line 2, in button_immediate_install
  File "/opt/odoo17/odoo17/odoo/addons/base/models/ir_module.py", line 75, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo17/odoo17/odoo/addons/base/models/ir_module.py", line 466, in button_immediate_install
    return self._button_immediate_function(self.env.registry[self._name].button_install)
  File "/opt/odoo17/odoo17/odoo/addons/base/models/ir_module.py", line 590, in _button_immediate_function
    registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "", line 2, in new
  File "/opt/odoo17/odoo17/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/opt/odoo17/odoo17/odoo/modules/registry.py", line 113, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/opt/odoo17/odoo17/odoo/modules/loading.py", line 480, in load_modules
    processed_modules += load_marked_modules(env, graph,
  File "/opt/odoo17/odoo17/odoo/modules/loading.py", line 364, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/opt/odoo17/odoo17/odoo/modules/loading.py", line 185, in load_module_graph
    load_openerp_module(package.name)
  File "/opt/odoo17/odoo17/odoo/modules/module.py", line 395, in load_openerp_module
    __import__(qualname)
  File "/opt/odoo17/odoo17-custom-addons/populating_ms_word_template/__init__.py", line 3, in 
    from . import models
  File "/opt/odoo17/odoo17-custom-addons/populating_ms_word_template/models/__init__.py", line 5, in 
    from . import ir_actions_report
  File "/opt/odoo17/odoo17-custom-addons/populating_ms_word_template/models/ir_actions_report.py", line 17, in 
    from docx import Document
ModuleNotFoundError: No module named 'docx'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    at makeErrorFromResponse (http://172.30.174.176:8069/web/assets/983b691/web.assets_web.min.js:2876:163)
    at XMLHttpRequest. (http://172.30.174.176:8069/web/assets/983b691/web.assets_web.min.js:2880:13)


Re: Support!
by
Dev Odoo
on 4/2/24, 12:18 AM Author

Please install the library: pip install python-docx