Git Product home page Git Product logo

Comments (10)

lmignon avatar lmignon commented on August 19, 2024

@invitu thank you for the report. Is'it possible to have the html content of your mail? We encountered some troubles in the past because Odoo has changed the way they format the url to reference an ir.attachment.

from acsone-addons.

cvinh avatar cvinh commented on August 19, 2024

hi laurent, (impossible to put some html stuff here...) I send you a private email...
cyril

from acsone-addons.

lmignon avatar lmignon commented on August 19, 2024

@invitu
The problem come from the way we find the URLs in the document for the ir.attachement referenced in the document.
In your message URLs looks like

<img src="http://localhost:8069/website/image/ir.attachment/27_f345651/datas" style="display:block;border:none;min-height:50px" width="175">
<img src="http://localhost:8069/website/image/ir.attachment/28_aa2e3f0/datas" style="display:block;border:none;min-height:50px" width="175">
<img src="http://localhost:8069/website/image/ir.attachment/29_a265d8f/datas" style="display:block;border:none;min-height:50px" width="175">

In the code we expect that the part after 'ir.attachment' contains only figures since it should be the id of the attachement. (https://github.com/acsone/acsone-addons/blame/8.0/html_widget_embedded_picture/ir_mail_server.py#L49)

/ir.attachment/29_a265d8f/datas

In your case, the attachment also contains others chars. Therefore, the code is not able to find the attachment since 29_a265d8f is not a valid Id. The change in the way odoo build the id of the attachement in the url has been introduced by odoo/odoo@bc5e6fa.
We need to fix the code.

Regards,

lmi

from acsone-addons.

cvinh avatar cvinh commented on August 19, 2024

hello, thanks for analysing

i think odoo still takes the id of the attachment in the first part of the URL :
/ir.attachment/29_a265d8f/datas --> 29 is the attachment id
so your code still fits the case because matching_buffer.keys() still are the attachment ids

I think the problem might be in the missing multipart/related which should be in the beginning of the mail

By the way, it should also be a thunderbird bug... https://bugzilla.mozilla.org/show_bug.cgi?id=61815

from acsone-addons.

cvinh avatar cvinh commented on August 19, 2024

dear laurent
I got it work with multipart/related in the email building :

diff --git a/openerp/addons/base/ir/ir_mail_server.py b/openerp/addons/base/ir/ir_mail_server.py
@@ -303,7 +303,7 @@ class ir_mail_server(osv.osv):

     email_body_utf8 = ustr(body).encode('utf-8')
     email_text_part = MIMEText(email_body_utf8, _subtype=subtype, _charset='utf-8')
  •    msg = MIMEMultipart()
    
  •    msg = MIMEMultipart(_subtype='related',)
    
     if not message_id:
    

    I guess this is related to the difficulty to have embedded images with "cid" working in most of the email clients...

Is there a way to include that in your module ?

from acsone-addons.

lmignon avatar lmignon commented on August 19, 2024

@invitu thank you for your work. I'm on vacation and I'll be back at work next monday.

from acsone-addons.

cvinh avatar cvinh commented on August 19, 2024

hello jonathan, it works with your branch 8.0-fix_63_mail_related_multipart-jne

from acsone-addons.

ysantiago avatar ysantiago commented on August 19, 2024

Hello @invitu @lmignon

Can you please give me orientation about how can I do to obtain the image attachment id 27_f345651, to do the following:

<img src="http://localhost:8069/website/image/ir.attachment/27_f345651/datas">

Thanks a lot

from acsone-addons.

flotho avatar flotho commented on August 19, 2024

Hi @ysantiago , personnaly I succeed in making it work and readable in my webmail by using the ckeditor widget and choosing my full URL with attachment URL copy pasted from the drop down attachment menu.

from acsone-addons.

github-actions avatar github-actions commented on August 19, 2024

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

from acsone-addons.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.