| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 405 |
| Technical Name |
ks_binary_file_preview |
| License | LGPL-3 |
| Website | https://store.ksolves.com/ |
| Versions | 12.0 13.0 14.0 15.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 405 |
| Technical Name |
ks_binary_file_preview |
| License | LGPL-3 |
| Website | https://store.ksolves.com/ |
| Versions | 12.0 13.0 14.0 15.0 |
Document Preview
Document Preview saves time and storage of users as it allows them to preview the document without downloading it. This app can be used in all Odoo modules to display documents like PDF, image, video file format.
Hot Features
- Supports Multiple Files such as images, PDFs, and Videos
- Preview Files from Anywhere Inside the Odoo Module
Problems/Solutions
PROBLEM:
With the Odoo Module, no preview is available.
SOLUTION:
Document Preview offers a range of file formats such as image, PDF, audio, and Video to be displayed as a Preview.
PROBLEM:
The user had to view the preview in the Attachment (Technical) module.
SOLUTION:
This app lets the user preview in all Odoo modules.
Note:
Extensively Tested on Odoo Vanilla with Ubuntu OS
-
Works with custom binary fields.
-
Support Multiple File Formats.
- - File formats such as pdf, jpeg, gif, png, mp4.
-
If you’re adding the Binary Field to a new code or already working code, then add attachmnt=True in python model wherever you wish to add the field.
-
A button like ( ) will be visible beside all binary fields like shown in the image.
-
Allow access to preview the attachments for the normal user.
Frequently Asked Question
Our Releases
Latest Release 1.0.3
■ Minor code changes to preview rendering.
Release 1.0.2
■ Enhancement - Allow access to preview the attachments for the normal user.
Release 1.0.1
■ Minor code change related to the doc-preview.
Ksolves Suggested Apps
Ksolves Odoo Services
Odoo Implementation
Odoo Community Apps
Odoo Support & Maintenance
Odoo Customization
Odoo Integration Services
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedUseful Module, Easy to configure
Thanks for the quick support.
Re: Useful Module, Easy to configure
Hi James,
Thank you for the 5-star rating & encouraging feedback. We look forward to growing this to a long-term relationship.
Regards,
Team Ksolves!
Solve the issue as soon as possible or roll back to previous verssion
Hello,
last version for Odoo 14 completely screw the system. Here is the error report
Error:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo14/odoo/odoo/http.py", line 685, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo14/odoo/odoo/http.py", line 361, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo14/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo14/odoo/odoo/http.py", line 349, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo14/odoo/odoo/http.py", line 914, in __call__
return self.method(*args, **kw)
File "/opt/odoo14/odoo/odoo/http.py", line 533, in response_wrap
response = f(*args, **kw)
File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1742, in load
action = request.env[action_type].sudo().browse([action_id]).read()
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_actions.py", line 240, in read
result = super(IrActionsActWindow, self).read(fields, load=load)
File "/opt/odoo14/odoo/odoo/models.py", line 3022, in read
return self._read_format(fnames=fields, load=load)
File "/opt/odoo14/odoo/odoo/models.py", line 3042, in _read_format
vals[name] = convert(record[name], record, use_name_get)
File "/opt/odoo14/odoo/odoo/fields.py", line 2687, in convert_to_read
return (value.id, value.sudo().display_name)
File "/opt/odoo14/odoo/odoo/fields.py", line 1021, in __get__
self.compute_value(recs)
File "/opt/odoo14/odoo/odoo/fields.py", line 1177, in compute_value
records._compute_field_value(self)
File "/opt/odoo14/odoo/odoo/models.py", line 4070, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo14/odoo/odoo/models.py", line 1728, in _compute_display_name
names = dict(self.name_get())
File "/opt/odoo14/odoo/odoo/models.py", line 1746, in name_get
result.append((record.id, convert(record[name], record)))
File "/opt/odoo14/odoo/odoo/models.py", line 5687, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo14/odoo/odoo/fields.py", line 1021, in __get__
self.compute_value(recs)
File "/opt/odoo14/odoo/odoo/fields.py", line 1177, in compute_value
records._compute_field_value(self)
File "/opt/odoo14/odoo/odoo/models.py", line 4072, in _compute_field_value
field.compute(self)
File "/opt/odoo14/odoo/odoo/fields.py", line 543, in _compute_related
values = [first(value[name]) for value in values]
File "/opt/odoo14/odoo/odoo/fields.py", line 543, in <listcomp>
values = [first(value[name]) for value in values]
File "/opt/odoo14/odoo/odoo/models.py", line 5687, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo14/odoo/odoo/fields.py", line 2485, in __get__
return super().__get__(records, owner)
File "/opt/odoo14/odoo/odoo/fields.py", line 998, in __get__
recs._fetch_field(self)
File "/opt/odoo14/odoo/odoo/models.py", line 3071, in _fetch_field
self._read(fnames)
File "/opt/odoo14/odoo/odoo/addons/base/models/res_users.py", line 448, in _read
super(Users, self)._read(fields)
File "/opt/odoo14/odoo/odoo/models.py", line 3138, in _read
cr.execute(query_str, params + [sub_ids])
File "<decorator-gen-3>", line 2, in execute
File "/opt/odoo14/odoo/odoo/sql_db.py", line 101, in check
return f(self, *args, **kwargs)
File "/opt/odoo14/odoo/odoo/sql_db.py", line 298, in execute
res = self._obj.execute(query, params)
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/http.py", line 641, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo14/odoo/odoo/http.py", line 317, in _handle_exception
raise exception.with_traceback(None) from new_cause
psycopg2.errors.UndefinedColumn: column res_users.ks_allow_preview does not exist
LINE 1: ...sers"."notification_type" as "notification_type", "res_users...
^
Re: Solve the issue as soon as possible or roll back to previous verssion
Hello Dragan!
Please find the below response to your query. In the latest release, we have added a new feature that non-admin users can also preview the documents. So with the same, we have added fields on the View level and python level. For the same after update the latest release zip you need to restart your server again and upgrade the Document Preview application from the Odoo Apps. Then your issue must be resolved. Module Updation Steps: Steps - 1. Download the latest zip file from Ksolves or Odoo app store, Extract it 2. Replace it with the one currently present in your addons with the same name.
3. Must Restart your server. 4. Upgrade the Document Preview module from Odoo Apps. 5. Now you are ready to go. Note: Firstly update and test the Latest release on Test Server or you must have the backup of the database, when everything is working fine on your Test server then perform the same to your Production or live database to avoid further issues. If you have any other concerns or queries, please feel free to reach out to us odoo.helpdesk@ksolves.in. Thanks,
Team Ksolves!
v17
any plans to upgrade this modue to v17 ?
v17
any plans to upgrade this modue to v17 ?
Hide or remove Download Button in PDF Preview
Hi, how to Hide or remove Download Button in PDF Preview?
Re: Hide or remove Download Button in PDF Preview
Hello Andi,
Thanks for reaching out to us,
Document Preview module allows you to preview the document without downloading it. It does not remove or hide any Odoo default functionality and that download button to download the PDF is Odoo default functionality.
So currently in Document Preview module no any such option available to hide this download button. But as you want to hide this button so sure we can help you in that and discuss your requirement in detail and for that we need to connect over the call first.
So we request you to come up over the call, or please let us know your availability at odoo.helpdesk@ksolves.in. Also, you can book a slot as per the below link.
https://calendly.com/mohsin-
If you have any other concerns or queries, please feel free to reach out to us odoo.helpdesk@ksolves.in.
Thanks,
Team Ksolves!
V16?
Hi
will you come up with a V16 version soon?
Re: V16?
Hello Pdc Mtt Team,
Thanks for reaching out to us.
Yes, the Document Preview version 16 is our priority release, and we are planning to release version 16 on the stores in next upcoming weeks.
If you have any other concerns or queries please feel free to reach out to us at odoo.helpdesk@ksolves.in.
Thanks,
Team Ksolves!
Document Preview is only applicable to administrators only???
Re:
Hello Abhijeet,
Thanks for reaching out to us,
We have enhanced the application and allowed access to preview the attachments for the normal user in the latest version.
So we recommend you, please upgrade the application to the latest version.
For any further queries, feel free to write us at sales@ksolves.com or odoo.helpdesk@ksolves.com
Thanks,
Team Ksolves!
Not Working
Traceback (most recent call last): File "/odoo/odoo-server/odoo/tools/cache.py", line 85, in lookup r = d[key] File "/odoo/odoo-server/odoo/tools/func.py", line 71, in wrapper return func(self, *args, **kwargs) File "/odoo/odoo-server/odoo/tools/lru.py", line 34, in __getitem__ a = self.d[obj] KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7f855a0edd30>, 'web.assets_backend') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/odoo/odoo-server/odoo/tools/convert.py", line 680, in _tag_root f(rec) File "/odoo/odoo-server/odoo/tools/convert.py", line 658, in _tag_template return self._tag_record(record) File "/odoo/odoo-server/odoo/tools/convert.py", line 567, in _tag_record f_val = self.id_get(f_ref) File "/odoo/odoo-server/odoo/tools/convert.py", line 663, in id_get res = self.model_id_get(id_str, raise_if_not_found) File "/odoo/odoo-server/odoo/tools/convert.py", line 669, in model_id_get return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found) File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1935, in _xmlid_to_res_model_res_id return self._xmlid_lookup(xmlid)[1:3] File "<decorator-gen-35>", line 2, in _xmlid_lookup File "/odoo/odoo-server/odoo/tools/cache.py", line 90, in lookup value = d[key] = self.method(*args, **kwargs) File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1928, in _xmlid_lookup raise ValueError('External ID not found in the system: %s' % xmlid) ValueError: External ID not found in the system: web.assets_backend The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/odoo/odoo-server/odoo/http.py", line 688, in dispatch result = self._call_function(**self.params) File "/odoo/odoo-server/odoo/http.py", line 360, in _call_function return checked_call(self.db, *args, **kwargs) File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/odoo/odoo-server/odoo/http.py", line 349, in checked_call result = self.endpoint(*a, **kw) File "/odoo/odoo-server/odoo/http.py", line 917, in __call__ return self.method(*args, **kw) File "/odoo/odoo-server/odoo/http.py", line 536, in response_wrap response = f(*args, **kw) File "/odoo/odoo-server/addons/web/controllers/main.py", line 1352, in call_button action = self._call_kw(model, method, args, kwargs) File "/odoo/odoo-server/addons/web/controllers/main.py", line 1340, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/odoo/odoo-server/odoo/api.py", line 464, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/odoo/odoo-server/odoo/api.py", line 451, in _call_kw_multi result = method(recs, *args, **kwargs) File "<decorator-gen-74>", line 2, in button_immediate_install File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 74, in check_and_log return method(self, *args, **kwargs) File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 483, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 600, in _button_immediate_function registry = modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/odoo/odoo-server/odoo/modules/registry.py", line 87, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/odoo/odoo-server/odoo/modules/loading.py", line 474, in load_modules processed_modules += load_marked_modules(cr, graph, File "/odoo/odoo-server/odoo/modules/loading.py", line 363, in load_marked_modules loaded, processed = load_module_graph( File "/odoo/odoo-server/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package) File "/odoo/odoo-server/odoo/modules/loading.py", line 69, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind) File "/odoo/odoo-server/odoo/tools/convert.py", line 745, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate) File "/odoo/odoo-server/odoo/tools/convert.py", line 811, in convert_xml_import obj.parse(doc.getroot()) File "/odoo/odoo-server/odoo/tools/convert.py", line 731, in parse self._tag_root(de) File "/odoo/odoo-server/odoo/tools/convert.py", line 693, in _tag_root raise ParseError('while parsing %s:%s, somewhere inside\n%s' % ( Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/odoo/odoo-server/odoo/http.py", line 644, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/odoo/odoo-server/odoo/http.py", line 302, in _handle_exception raise exception.with_traceback(None) from new_cause odoo.tools.convert.ParseError: while parsing None:3, somewhere inside <data name="board assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="/ks_binary_file_preview/static/src/js/ks_binary_preview.js"/> </xpath> </data>Re: Not Working
Hi Mohammad,
We have received your query. Kindly mark your query to odoo.helpdesk@ksolves.in for us to raise a ticket.
We'd take it up on priority and check with our tech development team on the possible solutions. We shall reply soon with the update Regards,
Team Ksolves
Hi Juan,
We have checked your concern and we will provide the fixes for the same in our next release and update you accordingly.
For any other concerns or queries, please feel free to reach out to us odoo.helpdesk@ksolves.in.
Thanks,
Team Ksolves !
error
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 85, in lookup r = d[key] File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 71, in wrapper return func(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 34, in __getitem__ a = self.d[obj] KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7f55491a0430>, 'web.assets_backend') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 680, in _tag_root f(rec) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 658, in _tag_template return self._tag_record(record) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 567, in _tag_record f_val = self.id_get(f_ref) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 663, in id_get res = self.model_id_get(id_str, raise_if_not_found) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 669, in model_id_get return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1935, in _xmlid_to_res_model_res_id return self._xmlid_lookup(xmlid)[1:3] File "<decorator-gen-35>", line 2, in _xmlid_lookup File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 90, in lookup value = d[key] = self.method(*args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1928, in _xmlid_lookup raise ValueError('External ID not found in the system: %s' % xmlid) ValueError: External ID not found in the system: web.assets_backend The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/usr/lib/python3/dist-packages/odoo/http.py", line 687, in dispatch result = self._call_function(**self.params) File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/http.py", line 348, in checked_call result = self.endpoint(*a, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 916, in __call__ return self.method(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 535, in response_wrap response = f(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1339, in call_button action = self._call_kw(model, method, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1327, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/api.py", line 464, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/api.py", line 451, in _call_kw_multi result = method(recs, *args, **kwargs) File "<decorator-gen-74>", line 2, in button_immediate_install File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 74, in check_and_log return method(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 483, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 600, in _button_immediate_function registry = modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 87, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 474, in load_modules processed_modules += load_marked_modules(cr, graph, File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 363, in load_marked_modules loaded, processed = load_module_graph( File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package) File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 745, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 811, in convert_xml_import obj.parse(doc.getroot()) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 731, in parse self._tag_root(de) File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 693, in _tag_root raise ParseError('while parsing %s:%s, somewhere inside\n%s' % ( Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/http.py", line 643, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/lib/python3/dist-packages/odoo/http.py", line 301, in _handle_exception raise exception.with_traceback(None) from new_cause odoo.tools.convert.ParseError: while parsing None:3, somewhere inside <data name="board assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="/ks_binary_file_preview/static/src/js/ks_binary_preview.js"/> </xpath> </data>Re: error
Hi Juan,
We have received your query. Kindly mark your query to sales@ksolves.com We will check with our tech development team on the possible solutions.
Regards,
Team Ksolves