Dunning email table not shown for ONE customer, only text body shown

Hi Tryton community,

Problem: Dunning email table not shown for ONE customer only (works perfectly for all others same day).

Details:

  • Customer: party 2 (companyx)
  • Dunning ID: 267 → line=16770 → move=5768 → invoice X-20252232
  • Invoice state: ‘posted’ (NOT paid)
  • Query: SELECT * FROM account_dunning WHERE id=267 shows:

Line 16770: debit=€654.40 | party=2 | maturity_date=2025-12-10 (overdue)

Key Facts:

  • :white_check_mark: Same day: Other customers → Table shows perfectly in the body email
  • :white_check_mark: Same customer: Previous dunnings → Table worked
  • :cross_mark: ONLY this dunning 267 → No table rows shown on body email
  • :cross_mark: Dunning state=‘waiting’ (others with ‘waiting’ work and show table in the body email sent)
  • :cross_mark: Invoice X-20252232 state=‘posted’ (not paid)

html code of the table

    <table style="width: 100%;">
        <thead>
            <tr>
                <th id="description">Description</th>
                <th id="reference">Rechnungs Nr.</th>
                <th id="date">Date</th>
                <th id="amount">Amount</th>
                <th id="due-date">Due Date</th>
            </tr>
        </thead>
        <tbody>
            <tr py:for="dunning in letter.dunnings">
                <td headers="description" style="text-align: left;" width="250">
                    ${dunning.line.description if dunning.line else ''}
                </td>
                <td headers="reference" style="text-align: center;" width="70">
                    ${dunning.line.number if dunning.line else ''}
                </td>
                <td headers="date" style="text-align: center;" width="70">
                    ${format_date(
                    dunning.line.date, data['language']) if dunning.line else ''}
                </td>
                <td headers="amount" style="text-align: center;" width="70">
                    ${format_currency(
                    dunning.amount_second_currency, data['language'],
                    dunning.second_currency) if dunning.amount_second_currency else ''}
                </td>
                <td headers="due-date" style="text-align: center;" width="60">
                    ${format_date(
                    dunning.maturity_date, data['language']) if dunning.maturity_date else ''}
                </td>
            </tr>
        </tbody>
    </table>

any help will be appreciated, Thanks.

For a dunning to appear in the letter, it must not be blocked.

Hi, Mr.@ced,

I have did already sql query

SELECT id, blocked, line, state, level
FROM account_dunning
WHERE id = 267;

id | blocked | line | state | level
-----±--------±------±--------±------
267 | f | 16770 | waiting | 3
(1 row)

as you see, field blocked here is false already.

Then it is in a level that is not set to be printed on letter.

Yes already Print on Letter=false has been set for a long time and always showed the table for others.
I mean Other customers with level where Print on Letter=false → Table shows (description, date etc.)
This dunning 267: Only text body, no table.

If a party has at least one dunning to be print on letter than all the dunning of this party are printed. But if the party has only dunning not to print on letter than no letter will be printed.

I have already Previous 3 dunnings with same party showed table correctly.
only new dunning 267 shows email text body without table.
Same party 2(companyx). Same print_on_letter=false across all 4 dunnings.

I will try to set the 4 levels with print_on_letter=true but i don’t know if this the real cause and if it will be fixed until again i will process the dunning in next days and send email to the customer, as i said from a long time it works normaly with other parties and with same party also , just with this Line it doesn’t show me the table