Skip to Content
Menu
This question has been flagged

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 



Avatar
Discard
Related Posts Replies Views Activity
0
Oct 15
2707
4
Sep 15
4942
2
Jul 15
4573
2
Oct 22
26719
1
Mar 18
2839