Sale not defined in custom Sale Report

Hi,

when I try to use my custom report template for the sale model, I get the following error when trying to export the report:

genshi.template.eval.UndefinedError: "sale" not defined

However, when I remove all “sale” elements and e.g. try company.rec_name in the template, everything works. Do you have any idea what could be the problem here?
Thanks

I think it will make it easier to find the problem if you write exactly what you attempted to do, and where.

The problem is clear: sale is not defined where it is being accessed.

In beginning of the report you have the following:

<for each="sale in records">

So perhaps you are trying to access sale outside of this <for></for> block?

Thanks, that was it. I was missing that the template is defined for multiple records over which I have to iterate.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.