Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Error adding multiple reports when sending an email(attachments)

By
Nacho
on 10/17/16, 3:43 AM 156 views

I'm trying to attach automatically more than one report when sending an email, but I'm facing this error : 

"Invalid value %r in domain term %r" % (right, leaf)AssertionError: Invalid value sale.order(15391,) in domain term ('report_name', '=', sale.order(15391,))

The part of the code where it fails:

for rec in records:
    condition = report_line.condition
               
    if condition and condition.strip():
        condition_result = self.render_template(condition, template.model, rec.id)
                   
        if not condition_result or not safe_eval(condition_result):
            continue
             
   report_name = self.render_template(report_line.report_name, template.model, rec.id)
               
    report = report_line.report_template_id
    report_service = report.report_name
    result = self.env['report'].get_pdf(rec, report_service)

Specifically in the last line (rec).

This module is from OCA, "Email Template Multi Report".

Thanks 



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/17/16, 3:43 AM
Seen: 156 times
Last updated: 10/17/16, 3:52 AM