it-projects-llc / odoo-saas-tools

Odoo SaaS Tools — tools for SaaS Businesses. Sale and manage Odoo databases.
https://saas.it-projects.info
GNU Lesser General Public License v3.0
543 stars 578 forks source link

V10 OAuth: Portal looses connexion to server #359

Open ygol opened 7 years ago

ygol commented 7 years ago

After installation it's working creating templates, clients but later (maybe after the OAuth expiration 1 hour later) you get error when trying to "Create template DB" (click on button). Also getting errors on any button "Sync server". Furthermore when clicking on menu Saas/SaaS/OAuth Applications; you get error:
Traceback (most recent call last): File "/odoo/odoo-server/odoo/http.py", line 638, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/odoo/odoo-server/odoo/http.py", line 675, in dispatch result = self._call_function(**self.params) File "/odoo/odoo-server/odoo/http.py", line 331, in _call_function return checked_call(self.db, *args, **kwargs) File "/odoo/odoo-server/odoo/service/model.py", line 119, in wrapper return f(dbname, *args, **kwargs) File "/odoo/odoo-server/odoo/http.py", line 324, in checked_call result = self.endpoint(*a, **kw) File "/odoo/odoo-server/odoo/http.py", line 933, in __call__ return self.method(*args, **kw) File "/odoo/odoo-server/odoo/http.py", line 504, in response_wrap response = f(*args, **kw) File "/odoo/odoo-server/addons/web/controllers/main.py", line 804, in search_read return self.do_search_read(model, fields, offset, limit, domain, sort) File "/odoo/odoo-server/addons/web/controllers/main.py", line 826, in do_search_read offset=offset or 0, limit=limit or False, order=sort or False) File "/odoo/odoo-server/odoo/models.py", line 4662, in search_read result = records.read(fields) File "/odoo/odoo-server/odoo/models.py", line 3002, in read values[name] = field.convert_to_read(record[name], record, use_name_get) File "/odoo/odoo-server/odoo/models.py", line 5177, in __getitem__ return self._fields[key].__get__(self, type(self)) File "/odoo/odoo-server/odoo/fields.py", line 868, in __get__ self.determine_value(record) File "/odoo/odoo-server/odoo/fields.py", line 979, in determine_value self.compute_value(recs) File "/odoo/odoo-server/odoo/fields.py", line 934, in compute_value self._compute_value(records) File "/odoo/odoo-server/odoo/fields.py", line 926, in _compute_value getattr(records, self.compute)() File "/odoo/custom/odoo-saas-tools/saas_portal/models/saas_portal.py", line 383, in _get_last_connection to_search = [('application_id', '=', self.id)] File "/odoo/odoo-server/odoo/fields.py", line 2413, in __get__ return record.ensure_one()._ids[0] File "/odoo/odoo-server/odoo/models.py", line 4789, in ensure_one raise ValueError("Expected singleton: %s" % self) ValueError: Expected singleton: oauth.application(1, 2, 3, 4, 5, 6)

Would this be caused by the access token's expiration? What would be the expected behavior?

cc @iledarn ?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38781574-v10-oauth-portal-looses-connexion-to-server?utm_campaign=plugin&utm_content=tracker%2F3643037&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F3643037&utm_medium=issues&utm_source=github).
yelizariev commented 7 years ago

I guess it has to be fixed on all versions

iledarn commented 7 years ago

fixed here https://github.com/it-projects-llc/odoo-saas-tools/pull/362