I have a problem with my odoo14 system, so the problem is when I try to download more than 1 file in my system , it always display error message
ValueError("Expected singleton: %s" % self)
ValueError: <class 'ValueError'>: "Expected singleton: account.invoice(35579, 35578)" while evaluating
'action = records.download_efaktur()'
I have try so many changes, but still error, I need help. thankyou :)
here is the details of the error message
Error:
Flectra Server Error
Traceback (most recent call last):
File "C:\Users\IT UW\odoo14\flectra\flectra\models.py", line 4434, in ensure_one
_id, = self._ids
ValueError: too many values to unpack (expected 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\IT UW\odoo14\flectra\flectra\tools\safe_eval.py", line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "c:\users\it uw\odoo14\mspcustomaddons\l10n_id_efaktur\models\account_move.py", line 138, in download_efaktur
self._generate_efaktur(',')
File "c:\users\it uw\odoo14\mspcustomaddons\l10n_id_efaktur\models\account_move.py", line 302, in _generate_efaktur
output_head = self._generate_efaktur_invoice(delimiter)
File "c:\users\it uw\odoo14\mspcustomaddons\l10n_id_efaktur\models\account_move.py", line 150, in _generate_efaktur_invoice
company_id = self.company_id
File "C:\Users\IT UW\odoo14\flectra\flectra\fields.py", line 947, in __get__
record.ensure_one()
File "C:\Users\IT UW\odoo14\flectra\flectra\models.py", line 4437, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: account.invoice(35579, 35578)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 658, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "C:\Users\IT UW\odoo14\flectra\flectra\tools\pycompat.py", line 87, in reraise
raise value
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 700, in dispatch
result = self._call_function(**self.params)
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\Users\IT UW\odoo14\flectra\flectra\service\model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 944, in __call__
return self.method(*args, **kw)
File "C:\Users\IT UW\odoo14\flectra\flectra\http.py", line 522, in response_wrap
response = f(*args, **kw)
File "c:\users\it uw\odoo14\flectra\addons\web\controllers\main.py", line 1387, in run
result = request.env['ir.actions.server'].browse([action_id]).run()
File "c:\users\it uw\odoo14\flectra\flectra\addons\base\ir\ir_actions.py", line 558, in run
res = func(action, eval_context=eval_context)
File "c:\users\it uw\odoo14\flectra\flectra\addons\base\ir\ir_actions.py", line 434, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "C:\Users\IT UW\odoo14\flectra\flectra\tools\safe_eval.py", line 373, in safe_eval
pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
File "C:\Users\IT UW\odoo14\flectra\flectra\tools\pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "C:\Users\IT UW\odoo14\flectra\flectra\tools\safe_eval.py", line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "c:\users\it uw\odoo14\mspcustomaddons\l10n_id_efaktur\models\account_move.py", line 138, in download_efaktur
self._generate_efaktur(',')
File "c:\users\it uw\odoo14\mspcustomaddons\l10n_id_efaktur\models\account_move.py", line 302, in _generate_efaktur
output_head = self._generate_efaktur_invoice(delimiter)
File "c:\users\it uw\odoo14\mspcustomaddons\l10n_id_efaktur\models\account_move.py", line 150, in _generate_efaktur_invoice
company_id = self.company_id
File "C:\Users\IT UW\odoo14\flectra\flectra\fields.py", line 947, in __get__
record.ensure_one()
File "C:\Users\IT UW\odoo14\flectra\flectra\models.py", line 4437, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: <class 'ValueError'>: "Expected singleton: account.invoice(35579, 35578)" while evaluating
'action = records.download_efaktur()'
I have try this
- Iterate over the recordset
- Using ensure_one()
but the error message is still showing up.