" + "No preview available
") + text = "Cant Preview" + return text + + @api.model + def save_edited_image(self, attach_id, image): + """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(attach_id) + file.write({'datas': image.strip('data:image/png;base64')}) + return file + + @api.model + def generate_qr_code(self, attach_id): + """Generate qr code for attachment that 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: + 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()).decode('utf-8') + 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..db9a4b914 --- /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 manage Attachments in Chatter, Chat and in Discuss
+ +
+ 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.
+
+ You can upload file from your device by clicking on 'My device'. +
++ Can select files from device and posted on attachments. +
++ Can upload file from 'Front Cam'. +
++ It will open a window to take picture.Click on 'Capture' to capture the photo or cancel it. +
++ You can see the captured photo in chatter +
++ The "Record Screen" button allows you to upload recorded screens. +
++ On click on 'Share' button, the screen is recorded. +
++ Screen Recorder can be stopped on clicking 'Stop sharing'. Recorder video will be saved there. +
++ All uploaded attachments can be viewed. +
++ Click on 'cog' icon, it will list some items.Click on 'Image Editor' to edit the image. +
++ 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 'Save' to update the changes. +
++ You can see the edited image in the chatter +
+Click on 'Preview Offline' to preview the attachments.Offline preview for only 'docx', 'XLSX', 'webm', 'pdf' is available.
+Easily procure and + sell your products
+Easy configuration and convivial experience
+A platform for educational management
+Plan, track and schedule your operations
+Mobile friendly, awe-inspiring product pages
+Keep track of services and invoice
+Run your bar or restaurant methodically
+An all-inclusive hotel management application
+