TypeError: 'int' object is not callable

Good afternoon for all
;
when i press in the menu action “Process Dunning” in the module "Financial" menu Dunnings, there was an error tell me :

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 104, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 48, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 72, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 197, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/wizard/wizard.py", line 284, in execute
    return wizard._execute(state_name)
  File "/trytond/wizard/wizard.py", line 315, in _execute
    result = self._execute(transition())
  File "/trytond/wizard/wizard.py", line 315, in _execute
    result = self._execute(transition())
  File "/trytond/wizard/wizard.py", line 315, in _execute
    result = self._execute(transition())
  File "/trytond/modules/account_dunning_email/account.py", line 103, in transition_send_email
    log = dunning.send_email(datamanager=datamanager)
  File "/trytond/modules/account_dunning_email/account.py", line 143, in send_email
    msg = self._email(from_, to, cc, bcc, languages)
  File "/trytond/modules/account_dunning_email/account.py", line 153, in _email
    msg, title = get_email(self.level.email_template, self, languages)
  File "/trytond/report/report.py", line 412, in get_email
    'language': language,
  File "/trytond/modules/account_dunning_letter/dunning.py", line 57, in execute
    return super(Letter, cls).execute(ids, data)
  File "/trytond/report/report.py", line 191, in execute
    oext, content = cls._execute(records, data, action_report)
  File "/trytond/report/report.py", line 217, in _execute
    return cls.convert(action, cls.render(action, report_context))
  File "/trytond/report/report.py", line 317, in render
    data = rel_report(**report_context).render()
  File "/site-packages/genshi/core.py", line 184, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/site-packages/genshi/output.py", line 57, in encode
    return _encode(''.join(list(iterator)))
  File "/site-packages/genshi/output.py", line 241, in __call__
    for kind, data, pos in stream:
  File "/site-packages/genshi/output.py", line 671, in __call__
    for kind, data, pos in stream:
  File "/site-packages/genshi/output.py", line 776, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/site-packages/genshi/output.py", line 596, in __call__
    for ev in stream:
  File "/site-packages/genshi/core.py", line 292, in _ensure
    for event in stream:
  File "/site-packages/genshi/core.py", line 292, in _ensure
    for event in stream:
  File "/site-packages/genshi/filters/i18n.py", line 691, in __call__
    for kind, data, pos in stream:
  File "/site-packages/genshi/template/base.py", line 638, in _include
    for event in stream:
  File "/site-packages/genshi/template/markup.py", line 327, in _match
    for event in stream:
  File "/site-packages/genshi/template/base.py", line 598, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/site-packages/genshi/template/base.py", line 289, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/site-packages/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/tmp/trytond_5btqf63i.html", line 17, in <Expression "', '.join(format_currency(amount, data['language'], cur)\n        for cur, amount in letter.fees.iteritems())">
    ${', '.join(format_currency(amount, data['language'], cur)
TypeError: 'int' object is not callable

It looks like you have customized the letter report template with instruction that does not work.
Normally the evaluated statement should be: ', '.join(format_currency(amount, party.lang, cur) for cur, amount in letter.fees.iteritems())

in letter.fodt i have putted it like that , but it doesn’t,’ work and show me the same error :

<text:p text:style-name="P11"><text:span text:style-name="T2">Fees: </text:span><text:placeholder text:placeholder-type="text">&lt;&apos;, &apos;.join(format_currency(amount, party.lang, cur) for cur, amount in letter.fees.iteritems())&gt;</text:placeholder></text:p>

Hi again , i think the wrong statement is here in the method transition_send_email but i do no where exaclty !!

    def transition_send_email(self):
        pool = Pool()
        Dunning = pool.get('account.dunning')
        Log = pool.get('account.dunning.email.log')
        datamanager = SMTPDataManager()
        if not pool.test:
            Transaction().join(datamanager)
        dunnings = Dunning.browse(Transaction().context['active_ids'])
        logs = []
        for dunning in dunnings:
            if dunning.level.send_email:
                log = dunning.send_email(datamanager=datamanager)
                if log:
                    logs.append(log)
        if logs:
            Log.create(logs)
        return self.next_state('send_email')

i have tried made it like that :

def transition_send_email(self):
        pool = Pool()
        Log = pool.get('account.dunning.email.log')
        datamanager = SMTPDataManager()
        if not pool.test:
            Transaction().join(datamanager)
        logs = []
        for dunning in self.records:
            if dunning.level.send_email:
                log = dunning.send_email(datamanager=datamanager)
                if log:
                    logs.append(log)
        if logs:
            Log.create(logs)
        return self.next_state('send_email')

but it give me an error has no attribut "records"

any help will be appreciated , is there any wrong instruction here

def transition_send_email(self):
        pool = Pool()
        Dunning = pool.get('account.dunning')
        Log = pool.get('account.dunning.email.log')
        datamanager = SMTPDataManager()
        if not pool.test:
            Transaction().join(datamanager)
        dunnings = Dunning.browse(Transaction().context['active_ids'])
        logs = []
        for dunning in dunnings:
            if dunning.level.send_email:
                log = dunning.send_email(datamanager=datamanager)
                if log:
                    logs.append(log)
        if logs:
            Log.create(logs)
        return self.next_state('send_email')