account_cash_discount_61-7.0.0.7 leaves discount balance open

Asked by E.R. Spada II on 2014-01-08

Hello,
I loaded account_cash_discount_61-7.0.0.7 and the entries seem to be correct but the invoice (Customer or Supplier) remains as an open balance? Also since we define the income and expense account for the term discount, why is the write off account need to be specified? It should happen automatically based upon the account defaults set up in the cash discount? Please help.
TX,
ER, OPENERP Partner

Question information

E.R. Spada II (er-k) said : #1

OK, so a manual reconsiliation removes the balance from the invoice. After processing two invoices I receive this error from a Supplier payment when I try to make a payment:
2014-01-08 04:59:06,246 36240 ERROR ChrisCoffee_11_6 openerp.tools.safe_eval: Cannot eval u'proforma_voucher()'
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAF2014-01-08 04:59:06,246 36240 ERROR ChrisCoffee_11_6 openerp.tools.safe_eval: Cannot eval u'proforma_voucher()'
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher
    self.action_move_line_create(cr, uid, ids, context=context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 50, in action_move_line_create
    move_line_obj.reconcile_cash_discount(cr, uid, ids, voucher.move_id.id, lines, None, context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 271, in reconcile_cash_discount
    raise osv.except_osv (_('Error !'), _('No write off account defined.'))
except_osv: (u'Error !', u'No write off account defined.')
2014-01-08 04:59:06,248 36240 ERROR ChrisCoffee_11_6 openerp.netsvc: Error !
No write off account defined.
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/v7/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/v7/addons/audittrail/audittrail.py", line 514, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 932, in button_proforma_voucher
    wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
  File "/opt/openerp/v7/server/openerp/workflow/wkf_service.py", line 119, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/opt/openerp/v7/server/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/opt/openerp/v7/server/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/opt/openerp/v7/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher
    self.action_move_line_create(cr, uid, ids, context=context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 50, in action_move_line_create
    move_line_obj.reconcile_cash_discount(cr, uid, ids, voucher.move_id.id, lines, None, context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 271, in reconcile_cash_discount
    raise osv.except_osv (_('Error !'), _('No write off account defined.'))
except_osv: (u'Error !', u'No write off account defined.')
2014-01-08 04:59:06,246 36240 ERROR ChrisCoffee_11_6 openerp.tools.safe_eval: Cannot eval u'proforma_voucher()'
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher
    self.action_move_line_create(cr, uid, ids, context=context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 50, in action_move_line_create
    move_line_obj.reconcile_cash_discount(cr, uid, ids, voucher.move_id.id, lines, None, context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 271, in reconcile_cash_discount
    raise osv.except_osv (_('Error !'), _('No write off account defined.'))
except_osv: (u'Error !', u'No write off account defined.')
2014-01-08 04:59:06,248 36240 ERROR ChrisCoffee_11_6 openerp.netsvc: Error !
No write off account defined.
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/v7/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/v7/addons/audittrail/audittrail.py", line 514, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 932, in button_proforma_voucher
    wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
  File "/opt/openerp/v7/server/openerp/workflow/wkf_service.py", line 119, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/opt/openerp/v7/server/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/opt/openerp/v7/server/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/opt/openerp/v7/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher
    self.action_move_line_create(cr, uid, ids, context=context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 50, in action_move_line_create
    move_line_obj.reconcile_cash_discount(cr, uid, ids, voucher.move_id.id, lines, None, context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 271, in reconcile_cash_discount
    raise osv.except_osv (_('Error !'), _('No write off account defined.'))
except_osv: (u'Error !', u'No write off account defined.')
E_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher
    self.action_move_line_create(cr, uid, ids, context=context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 50, in action_move_line_create
    move_line_obj.reconcile_cash_discount(cr, uid, ids, voucher.move_id.id, lines, None, context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 271, in reconcile_cash_discount
    raise osv.except_osv (_('Error !'), _('No write off account defined.'))
except_osv: (u'Error !', u'No write off account defined.')
2014-01-08 04:59:06,248 36240 ERROR ChrisCoffee_11_6 openerp.netsvc: Error !
No write off account defined.
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/v7/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/v7/addons/audittrail/audittrail.py", line 514, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 932, in button_proforma_voucher
    wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
  File "/opt/openerp/v7/server/openerp/workflow/wkf_service.py", line 119, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/opt/openerp/v7/server/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/opt/openerp/v7/server/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/opt/openerp/v7/server/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/opt/openerp/v7/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/v7/addons/account_voucher/account_voucher.py", line 936, in proforma_voucher
    self.action_move_line_create(cr, uid, ids, context=context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 50, in action_move_line_create
    move_line_obj.reconcile_cash_discount(cr, uid, ids, voucher.move_id.id, lines, None, context)
  File "/opt/openerp/v7/server/openerp/addons/account_cash_discount_61/account.py", line 271, in reconcile_cash_discount
    raise osv.except_osv (_('Error !'), _('No write off account defined.'))
except_osv: (u'Error !', u'No write off account defined.')

E.R. Spada II (er-k) said : #2

Hello again,
I have confirmed that the error - "bug" above is created when you try to pay a supplier invoice with a discount. Customer invoices are not affected by this.

Can you help with this problem?

Provide an answer of your own, or ask E.R. Spada II for more information if necessary.

To post a message you must log in.