Skip to Content
Menu

Easy PDF creator

by
Odoo

27.04

v 10.0 v 11.0 Third Party 22
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name easy_pdf_creator
Websitehttp:// inception.mara@gmail.com
Versions 10.0 11.0
You bought this module and need support? Click here!

Easy PDF report creator module

This module allows us to create whatever model report you want that transmitting PDF report using few codes and much easy way. Now we will work on ODOO v9 and v10. While working these versions we will find out the following advantages.

Advantages:
  • No need of high knowledge of development (very few .PY codes will be written, but not to draw any model at .XML).
  • Easy to prepare report model. Work on HTML rich text editor (likely MS word)
  • Allows to create any model and report adjustment on any chosen model
  • All models shall be added default menu 'EasyPrint' on Sidebar menu. You only need to draw your template designs.
  • It shows a drawing on the model in any size
  • It gives a chance to merge, split, resize the Table
  • Create PDF in a short time and any desired model

It is described below using a example on stock.picking model.

Instructions

After installing Module ODOO to be loaded on Developer mode then Setting->Reports->Easy PDF creator menu appears on the screen. Here we should identify the report model. The screen displays the followings and most important 2 fields are described as below:



Field description:
  • Template name - Must be unique. This name will be used to find an adjusted report on the module.
  • Model name - It describes report model where it adjusted.

Create a model

Advantages:


It is very easy to prepare and adjust a model. Because we use HTML rich text editor. It is the same of MS word. There are two types: Constant text and variable (field's value)
  • Constant text should be written directly.
  • Any types of field's value located on the model will be adjusted as below (syntax)
Variables syntax:
  • Integer, Char, Float, Text, Date fields: These fields name will be written {} in brackets.
    Syntax: {field_1}, {field_2} etc.
    EG: {name}, {origin}
  • Many2one field: {} will be written in the brackets. As well as we can approach model field of Many2one field. So that : colon will be written too.
    Syntax: {many2one_field}, {many2one_field:field_1} .
    Example: {partner_id}, {partner_id:phone}, {partner_id:street}
  • One2many field: It will be written as below.
    Syntax: {one2many_field:{field1,field2,field3}}
    Example: product name, quantity, unit, price unit of move_lines of Stock.picking model are adjusted to be printed out.
    {move_lines:{product_id,product_uom,product_uom_qty,price_unit}}
  • Call function: It allows us to print out transmitted value using call function from the model. Function return value must be the types of: text, int, float.
    Syntax: {function_simple:your_function_name} .
    Example: {function_simple:_get_total_qty}
    Function example:
    @api.multi
    def _get_total_qty(self, ids):
    obj = self.env['stock.picking'].browse(ids)
    tot = sum(obj.move_lines.mapped('product_uom_qty'))
    return str(round(tot,3))

    Table can be created using returned value on template mode. So that the called function must be return the data using the following format.
    FORMAT: data = {'header':['col1','col2'],'data':[[112323,435345.5],[23.4,56],[234,345]]}
    Table header values should be described herein. Here are 2 column and 3 raw data.
    Syntax: {function:function_name}.
    EG: {function:_get_custom_data}
  • Binary and image field: Binary or Image field will be displayed without any size.
    Syntax: {image_field:field_name} .
    EG: {image_field:image_medium}
    - It allows to display the drawing with the measured sizes.

    Syntax: {image_field:field_name:width:height}.
    EG: {image_field:image_medium:128:128}
  • Drawing to be displayed indicating via URL: In order to display several drawings on the template mode, firstly, URLs to be showed up on Text field should be set using the following format.
    Format:
    [img.test.com/uploads/20160827/c8ad95ad0e7075.png,img.test.com/uploads/order_note/20170829/7d8df4bd453dc2fc10c.jpg]
    After that the text field should be indicated on the template mode.
    Syntax: {image_field_urls:field_name}
    EG: {image_field_urls:pic_urls}

Default Menu

When connecting EasyPrint button of Sidebar menu of all model with default template, it's easy to set template name as 'Default'.

Appearance

Raw pdf template:


After printing:


Connect prepared template and code

There are two steps in order to use the prepared model.
  • PRINT button should be added to XML view. It calls the print function.
  • python function should be written on the model where prepared
Detailed description in UserGuide folder (word file)

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!
asdsad
by
Carmelo Pierce
on 4/15/21, 5:13 AM

I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site.!!!! Link Building Service 
[url=http://www.fiverr.com/sereen]SEO Services[/url]


Error install
by
Deyvys
on 7/17/18, 9:31 AM Confirmed Purchase

my email is z3deyvys@hotmail.com


ERROR install odoo 10
by
Deyvys
on 7/16/18, 5:10 PM Confirmed Purchase

Traceback (most recent call last): File "/opt/odoo/odoo/http.py", line 642, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo/http.py", line 684, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo/http.py", line 334, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo/service/model.py", line 101, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo/http.py", line 327, in checked_call result = self.endpoint(*a, **kw) File "/opt/odoo/odoo/http.py", line 942, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo/http.py", line 507, in response_wrap response = f(*args, **kw) File "/opt/odoo/addons/web/controllers/main.py", line 896, in call_button action = self._call_kw(model, method, args, {}) File "/opt/odoo/addons/web/controllers/main.py", line 884, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo/odoo/api.py", line 689, in call_kw return call_kw_multi(method, model, args, kwargs) File "/opt/odoo/odoo/api.py", line 680, in call_kw_multi result = method(recs, *args, **kwargs) File "/opt/odoo/odoo/addons/base/module/module.py", line 411, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/opt/odoo/odoo/addons/base/module/module.py", line 485, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/opt/odoo/odoo/modules/registry.py", line 83, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/opt/odoo/odoo/modules/loading.py", line 368, in load_modules loaded_modules, update_module, models_to_check) File "/opt/odoo/odoo/modules/loading.py", line 261, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/opt/odoo/odoo/modules/loading.py", line 173, in load_module_graph _load_data(cr, module_name, idref, mode, kind='data') File "/opt/odoo/odoo/modules/loading.py", line 96, in _load_data tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report) File "/opt/odoo/odoo/tools/convert.py", line 845, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/opt/odoo/odoo/tools/convert.py", line 915, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/opt/odoo/odoo/tools/convert.py", line 799, in parse self._tags[rec.tag](rec, de, mode=mode) File "/opt/odoo/odoo/tools/convert.py", line 707, in _tag_record id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode) File "/opt/odoo/odoo/addons/base/ir/ir_model.py", line 1236, in _update record = record.create(values) File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 362, in create return super(View, self).create(self._compute_defaults(values)) File "/opt/odoo/odoo/models.py", line 3855, in create self._fields[key].determine_inverse(record) File "/opt/odoo/odoo/fields.py", line 1046, in determine_inverse getattr(records, self.inverse)() File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 220, in _inverse_arch view.write(data) File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 380, in write return super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/odoo/models.py", line 3568, in write self._write(old_vals) File "/opt/odoo/odoo/models.py", line 3732, in _write self._validate_fields(vals) File "/opt/odoo/odoo/models.py", line 1081, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e))) ParseError: "Error mientras se validaban las restricciones Modelo no encontrado: report.pdf.output Error de contexto: Vista `action.pdf.output.view` [view_id: 1015, xml_id: n/a, model: report.pdf.output, parent_id: n/a] None" while parsing /opt/odoo/addons/easy_pdf_creator/view/pdf_template_generator_view.xml:4, near action.pdf.output.view report.pdf.output


Try it on demo server
by
Amartuvshin.e
on 6/8/18, 5:11 AM Author

Hi, you can try this freeze module on http://202.70.40.98:6060 . Username: demo Password: demo . You see Sales->Sales->Sales Orders menu :) 1. Click EasyPrint button 2. Change or config Template on Sales->Easy PDF creator menu


Released on v11
by
Amartuvshin.e
on 6/2/18, 7:07 AM Author

You can download on v11. New feature Call function method, when draw data, column names horizontal or vertical draw. @Andrea Piovesana


version 11 coming soon
by
Amartuvshin.e
on 6/2/18, 5:06 AM Author

Hi all v11 is coming soon, and you see my new module Table Header Freeze :)


How to fix this error in install
by
ARISTIDE ATSE
on 3/19/18, 8:07 PM Confirmed Purchase

Traceback (most recent call last): File "/odoo/odoo-server/odoo/http.py", line 641, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/odoo/odoo-server/odoo/http.py", line 683, in dispatch result = self._call_function(**self.params) File "/odoo/odoo-server/odoo/http.py", line 333, in _call_function return checked_call(self.db, *args, **kwargs) File "/odoo/odoo-server/odoo/service/model.py", line 101, in wrapper return f(dbname, *args, **kwargs) File "/odoo/odoo-server/odoo/http.py", line 326, in checked_call result = self.endpoint(*a, **kw) File "/odoo/odoo-server/odoo/http.py", line 941, in __call__ return self.method(*args, **kw) File "/odoo/odoo-server/odoo/http.py", line 506, in response_wrap response = f(*args, **kw) File "/odoo/odoo-server/addons/web/controllers/main.py", line 889, in call_button action = self._call_kw(model, method, args, {}) File "/odoo/odoo-server/addons/web/controllers/main.py", line 877, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/odoo/odoo-server/odoo/api.py", line 689, in call_kw return call_kw_multi(method, model, args, kwargs) File "/odoo/odoo-server/odoo/api.py", line 680, in call_kw_multi result = method(recs, *args, **kwargs) File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 411, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 485, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/odoo/odoo-server/odoo/modules/registry.py", line 83, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/odoo/odoo-server/odoo/modules/loading.py", line 339, in load_modules loaded_modules, update_module) File "/odoo/odoo-server/odoo/modules/loading.py", line 237, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/odoo/odoo-server/odoo/modules/loading.py", line 156, in load_module_graph _load_data(cr, module_name, idref, mode, kind='data') File "/odoo/odoo-server/odoo/modules/loading.py", line 95, in _load_data tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report) File "/odoo/odoo-server/odoo/tools/convert.py", line 845, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/odoo/odoo-server/odoo/tools/convert.py", line 915, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/odoo/odoo-server/odoo/tools/convert.py", line 799, in parse self._tags[rec.tag](rec, de, mode=mode) File "/odoo/odoo-server/odoo/tools/convert.py", line 707, in _tag_record id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode) File "/odoo/odoo-server/odoo/addons/base/ir/ir_model.py", line 1229, in _update record = record.create(values) File "/odoo/odoo-server/odoo/addons/base/ir/ir_ui_view.py", line 362, in create return super(View, self).create(self._compute_defaults(values)) File "/odoo/odoo-server/odoo/models.py", line 3831, in create self._fields[key].determine_inverse(record) File "/odoo/odoo-server/odoo/fields.py", line 1041, in determine_inverse getattr(records, self.inverse)() File "/odoo/odoo-server/odoo/addons/base/ir/ir_ui_view.py", line 220, in _inverse_arch view.write(data) File "/odoo/odoo-server/odoo/addons/base/ir/ir_ui_view.py", line 380, in write return super(View, self).write(self._compute_defaults(vals)) File "/odoo/odoo-server/odoo/models.py", line 3557, in write self._write(old_vals) File "/odoo/odoo-server/odoo/models.py", line 3708, in _write self._validate_fields(vals) File "/odoo/odoo-server/odoo/models.py", line 1079, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e))) ParseError: "Erreur lors de la validation de la contrainte Mod\xe8le non trouv\xe9 : report.pdf.output Contexte de l'erreur : Vue `action.pdf.output.view` [view_id: 1004, xml_id: n/a, model: report.pdf.output, parent_id: n/a] None" while parsing /odoo/odoo-server/addons/easy_pdf_creator/view/pdf_template_generator_view.xml:4, near action.pdf.output.view report.pdf.output


by
Andrea Piovesana
on 3/17/18, 12:22 PM

ciao what about for version 11? any schedule?


Resolved
by
Ash
on 3/10/18, 4:42 AM

Ignore my earlier post , it is now working. The issue was that template name should be default all small case. It would be good to have it working for list view as well.


Getting error while running easyprint
by
Ash
on 3/9/18, 12:38 PM

I get the following error while running the easyprint from the Print button dropdown in the model In form : Not found template!, must be template name 'default' In List : Uncaught TypeError: Cannot read property 'id' of undefined Have carefullly followed the steps mentioned above. What could be the reason ?


How to fix this error in install
by
Wilson Uemura
on 2/27/18, 2:05 AM Confirmed Purchase

Traceback (most recent call last): File "C:\Program Files (x86)\HR SYSTEM\server\odoo\http.py", line 641, in _handle_exception File "C:\Program Files (x86)\HR SYSTEM\server\odoo\http.py", line 683, in dispatch File "C:\Program Files (x86)\HR SYSTEM\server\odoo\http.py", line 333, in _call_function File "C:\Program Files (x86)\HR SYSTEM\server\odoo\service\model.py", line 101, in wrapper File "C:\Program Files (x86)\HR SYSTEM\server\odoo\http.py", line 326, in checked_call File "C:\Program Files (x86)\HR SYSTEM\server\odoo\http.py", line 941, in __call__ File "C:\Program Files (x86)\HR SYSTEM\server\odoo\http.py", line 506, in response_wrap File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\web\controllers\main.py", line 894, in call_button File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\web\controllers\main.py", line 882, in _call_kw File "C:\Program Files (x86)\HR SYSTEM\server\odoo\api.py", line 689, in call_kw File "C:\Program Files (x86)\HR SYSTEM\server\odoo\api.py", line 680, in call_kw_multi File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\base\module\module.py", line 411, in button_immediate_install File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\base\module\module.py", line 485, in _button_immediate_function File "C:\Program Files (x86)\HR SYSTEM\server\odoo\modules\registry.py", line 83, in new File "C:\Program Files (x86)\HR SYSTEM\server\odoo\modules\loading.py", line 339, in load_modules File "C:\Program Files (x86)\HR SYSTEM\server\odoo\modules\loading.py", line 237, in load_marked_modules File "C:\Program Files (x86)\HR SYSTEM\server\odoo\modules\loading.py", line 156, in load_module_graph File "C:\Program Files (x86)\HR SYSTEM\server\odoo\modules\loading.py", line 95, in _load_data File "C:\Program Files (x86)\HR SYSTEM\server\odoo\tools\convert.py", line 845, in convert_file File "C:\Program Files (x86)\HR SYSTEM\server\odoo\tools\convert.py", line 915, in convert_xml_import File "C:\Program Files (x86)\HR SYSTEM\server\odoo\tools\convert.py", line 799, in parse File "C:\Program Files (x86)\HR SYSTEM\server\odoo\tools\convert.py", line 707, in _tag_record File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\base\ir\ir_model.py", line 1229, in _update File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\base\ir\ir_ui_view.py", line 362, in create File "C:\Program Files (x86)\HR SYSTEM\server\odoo\models.py", line 3834, in create File "C:\Program Files (x86)\HR SYSTEM\server\odoo\fields.py", line 1041, in determine_inverse File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\base\ir\ir_ui_view.py", line 220, in _inverse_arch File "C:\Program Files (x86)\HR SYSTEM\server\odoo\addons\base\ir\ir_ui_view.py", line 380, in write File "C:\Program Files (x86)\HR SYSTEM\server\odoo\models.py", line 3560, in write File "C:\Program Files (x86)\HR SYSTEM\server\odoo\models.py", line 3711, in _write File "C:\Program Files (x86)\HR SYSTEM\server\odoo\models.py", line 1081, in _validate_fields ParseError: "Error while validating constraint Modelo n\xe3o encontrado: report.pdf.output Contexto de erro: Veja `action.pdf.output.view` [view_id: 975, xml_id: n/a, model: report.pdf.output, parent_id: n/a] None" while parsing file:///c:/program files (x86)/hr system/server/odoo/addons/easy_pdf_creator/view/pdf_template_generator_view.xml:4, near action.pdf.output.view report.pdf.output Thanks