You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restore a copy of the database where this singleton error would occur
We don't know cause yet so can't prescribe how to set this up, but we do have a database that has this issue, but don't want to identify it in a public place such as this.
Internally, see T15292 for more context info on which database this refers to.
Install account_mtd_vat
Add group MTD/Administrator and MTD/User to admin account
Refresh browser window
Click Accounting -> Making Tax Digital -> MTD Set-up -> Accounting Set-up -> Create
What should happen
Should not have an error, so we can fill in fields.
What happens
In the GUI we see Odoo Warning dialogue with body Expected singleton: account.account.type(25, 37)
In the logs, we see this:
openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 546, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 583, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 319, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 316, in checked_call
return self.endpoint(*a, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 812, in __call__
return self.method(*args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 412, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 944, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 399, in old_api
result = method(recs, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5998, in onchange
newval = record[name]
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5654, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 838, in __get__
self.determine_draft_value(record)
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 946, in determine_draft_value
self._compute_value(record)
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 885, in _compute_value
self.compute(records)
File "/mnt/extra-addons-bundles/OpusVL_mtd/account_mtd_vat/models/hmrc_posting_configuration.py", line 39, in _compute_company_id
('name', '=', 'Output Tax')])
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 851, in __set__
value = self.convert_to_cache(value, record)
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 1051, in convert_to_cache
return int(value or 0)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5624, in __int__
return self.id
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 1909, in __get__
return record.ensure_one()._ids[0]
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5320, in ensure_one
raise except_orm("ValueError", "Expected singleton: %s" % self)
except_orm: ('ValueError', 'Expected singleton: account.account.type(25, 37)')
The text was updated successfully, but these errors were encountered:
but when assigning to a many2one there can only be zero or one records (this makes sense if you think about it).
There's a possibility the line below it might also suffer the same fate, which does similar in the same way but looks for Input Tax.
We need to decide if it's a data bug or it's reasonable to have this situation and therefore should handle it in the code. If it's a data bug, we could at least trap the >2 matches case and throw a more user-friendly error message.
How to reproduce
account_mtd_vat
MTD/Administrator
andMTD/User
to admin accountWhat should happen
Should not have an error, so we can fill in fields.
What happens
In the GUI we see
Odoo Warning
dialogue with bodyExpected singleton: account.account.type(25, 37)
In the logs, we see this:
The text was updated successfully, but these errors were encountered: