Reference attribute not displayed in the email dunning

Hi;
Recently , I had perceive that in dunning email , the data that should be displayed under the column "reference" is missing otherwise i have put it.

about the attribute "reference" i filled it by going to (Finance)>(invoices)>(Customer invoices)

Here i was filled out the attribute “reference” —>after saving that, i had go to the wizardcreate dunningand choose theLinethat i had recently create it (withreference`).As it is shown in the picture, the attribute reference is filled out :

image

this is the line code of the reference: :

<td headers="reference">

${dunning.line.origin.rec_name if dunning.line and dunning.line.origin else ''}

</td>

But the column of reference is empty in the email :

So i want just to verify is the attribute “reference”(displayed in the email) is supposed to take the data of the attribute “reference” that i had create in the menu (invoices)>(Customer invoices)(the steps that i have described above) or there was another field i should filled it out ?

Ps : I was given a try and change the code line of the attribute reference like that:
${dunning.line.reference if dunning.line else ''}

But it keeping give me this error:

  File "/tmp/trytond_drozwkqz.html", line 36, in <Expression "dunning.line.reference if dunning.line else ''">
    ${dunning.line.reference if dunning.line else ''}
  File "/site-packages/genshi/template/eval.py", line 326, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/site-packages/genshi/template/eval.py", line 414, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: Pool().get('account.move.line')(559) has no member named "reference"  File "/tmp/trytond_drozwkqz.html", line 36, in <Expression "dunning.line.reference if dunning.line else ''">
    ${dunning.line.reference if dunning.line else ''}
  File "/site-packages/genshi/template/eval.py", line 326, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/site-packages/genshi/template/eval.py", line 414, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: Pool().get('account.move.line')(559) has no member named "reference"

Indeed the dunning’s reports are displaying only the record name of the origin of the line but for an invoice the lines to pay have no origin. So we should fix it with Issue 10751: Dunning reference is always empty - Tryton issue tracker

Hi M@Ced , Thanks for the quick response , I saw The Tryton issue tracker that you filled it , you say that we should use the move origin if the line origin is empty

Just for verifying did you mean that i should let the origin field empty and use the Move origin, I have did that in the Line field of the dunning.

this is my example described the field Line:
origin field of the Line is empty;
Move origin : invoice and the reference
image

Is that what you mean?!
but still give me an empty column in the email dunning.

I can not say, I do not understand (your text formatting is very confusing).

I have let the origin attribute "empty" in Line field of the dunning as shown in this picture because i was understand from your words( we should use the move origin if the **line origin is empty**) , that we should let the field “origin” empty(We don’t choose anything else like Account Move Line, Invoice Line) to solve that! ?.

I still do not understand you.
The bug report explain how we should fix the code to work so I do not see what you try to do by editing data when it is the code that is not working.