" + "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..a660ba30f --- /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. +
++ User can + record, take picture and attach to chatter
++ Offline preview + is available for Xlsx, Docx, Pdf And Image files + from chatter itself
++ This app + provides a professional image editor, + allowing you to edit and enhance images directly + within your App
++ QR can be sent + to any employee who can download and open the + file
++ You can upload from your device, front camera, screencast.You are able + to download all attachments and manage it. Can upload multiple files at + a time. + Attachments can be posted by clicking the '+' icon in the chatter. +
++ Support front camera and screen recorder.
++ Offline preview for Xlsx, Docx, Pdf And Image files.
++ Image Professional Editor support.
++ All Attachments in a record can be downloaded as a Zip file.
++ QRcode support(for secured server).
++ Yes, this restriction applies to all products listed in the + POS system. The module ensures that no item can be checked + out or confirmed with a zero quantity. +
++ Yes, discounts and promotions can be applied as usual. The + module specifically restricts zero quantities for individual + products, not the overall total of the transaction. +
+