Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,21 @@
from odoo.http import request
from odoo.addons.mail.controllers.discuss import DiscussController
class AttachmentController(DiscussController):
def mail_attachment_upload(
self, ufile, thread_id, thread_model, is_pending=False, **kwargs
):
response = super().mail_attachment_upload(
ufile, thread_id, thread_model, is_pending=is_pending, **kwargs
)
attachment_id = response.json.get("id")
if not attachment_id:
return response
# Update attachment data
attachmentData = {**response.json}
attachment = request.env["ir.attachment"].sudo().browse(attachment_id).exists()
if attachment:
attachmentData.update(**attachment.get_additional_data())
return request.make_json_response(attachmentData)