" + "No preview available
") + text = "Cant Preview" + return text + + @api.model + def save_edited_image(self, attachment_id, myImage): + """The image is replaced by image from Toast image editor + :param int attach_id: id of attachment. + :param str image: new image data + :return file containing image + """ + file = self.sudo().browse(attachment_id) + file.write({'datas': myImage.strip('data:image/png;base64')}) + return file + + @api.model + def generate_qr_code(self, attach_id): + """Generate qr code for attachment tha allow anyone to download it.""" + base_url = self.env['ir.config_parameter'].sudo().get_param( + 'web.base.url') + data = {} + download_url = f"mail/channel/1/attachment/{attach_id}?download=true" + if qrcode and base64: + attach_qr = qrcode.QRCode( + version=3, + error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=4, border=4) + attach_qr.add_data(base_url + download_url) + attach_qr.make(fit=True) + img = attach_qr.make_image() + temp = BytesIO() + img.save(temp, format="PNG") + qr_image = base64.b64encode(temp.getvalue()) + data.update({'image': qr_image, + 'company': self.env.company.name}) + return data diff --git a/chatter_attachments_manager/models/ir_attachment_tag.py b/chatter_attachments_manager/models/ir_attachment_tag.py new file mode 100644 index 000000000..3e78def1b --- /dev/null +++ b/chatter_attachments_manager/models/ir_attachment_tag.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(+ This Module helps to enhance the Attachment Management + capabilities within Odoo.Can easily Edit, Read, Preview your + Documents + inside Odoo. Module works in Discuss, Chat and Chatter of + any record. +
++ Key Highlights +
++ Support front camera and screen recorder.
+User can + record, take picture and attach to chatter +
++ Offline Preview
+Offline preview + is available for Xlsx, Docx, Pdf And Image files + from chatter itself +
++ Image Professional Editor support
+This app + provides a professional image editor, + allowing you to edit and enhance images directly + within your App +
++ QRcode support (for Secured Server)
+QR can be sent + to any employee who can download and open the + file +
+A professional Image Editor is Provided to alter the image, such as + cropping, Resizing, applying a color filter etc.Can load another image and + replace existing one.
+Click on 'Preview Offline' to preview the attachments.Offline preview for only 'docx', 'XLSX', 'webm', 'pdf' is available.
++ + Initial Commit for Chatter Attachment Manager.
++ Related Products
++ Our Services
+ +Odoo + Customization
+Odoo + Implementation
+Odoo + Support
+Hire + Odoo Developer
+Odoo + Integration
+Odoo + Migration
+Odoo + Consultancy
+Odoo + Implementation
+Odoo + Licensing Consultancy
++ Our Industries
+ +Trading
+Easily procure and sell your products
+POS
+Easy configuration and convivial experience
++ Education
+A platform for educational management
++ Manufacturing
+Plan, track and schedule your operations
+E-commerce & + Website
+Mobile friendly, awe-inspiring product pages
+Service + Management
+Keep track of services and invoice
++ Restaurant
+Run your bar or restaurant methodically
+Hotel + Management
+An all-inclusive hotel management application
++ Support
+Got + questions or need help? Get in touch.
+Say hi to + us on WhatsApp!
+