Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][MIG] web_access_rule_buttons #1243

Merged
merged 18 commits into from
May 15, 2019

Conversation

espo-tony
Copy link

Standard migration

guewen and others added 11 commits April 10, 2019 09:18
Disable buttons which lead to action disallowed by record rules.
Fix:

Traceback (most recent call last):
  File "/opt/odoo/src/openerp/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/src/openerp/http.py", line 680, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/src/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/src/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/src/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/src/openerp/http.py", line 959, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/src/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/src/addons/web/controllers/main.py", line 893, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/src/addons/web/controllers/main.py", line 885, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/odoo/src/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/src/openerp/api.py", line 381, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/external-src/web/web_access_rule_buttons/models.py", line 24, in check_access_rule_all
    result[operation] = True
  File "/opt/odoo/src/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/src/openerp/api.py", line 574, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **old_kwargs)
  File "/opt/odoo/src/openerp/models.py", line 3554, in check_access_rule
    WHERE id IN %%s""" % self._table, (tuple(ids),))
  File "/opt/odoo/src/openerp/sql_db.py", line 139, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/src/openerp/sql_db.py", line 218, in execute
    res = self._obj.execute(query, params)
ProgrammingError: syntax error at or near ")"
LINE 3:                           WHERE id IN ()
* [MIG] Migration from 9.0 to 10.0

* Refactoring javascript code
@pedrobaeza pedrobaeza added this to the 11.0 milestone Apr 10, 2019
@espo-tony
Copy link
Author

@simahawk , @tarteo ,
please, can you review this?

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the lint errors. Tested it on Runbot and works perfectly.

@simahawk simahawk changed the title 11.0 mig web access rule buttons [11.0][MIG] web_access_rule_buttons Apr 10, 2019
Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core review only: seems good.
Can you squash your commits?

web_access_rule_buttons/models/models.py Outdated Show resolved Hide resolved
Copy link

@CasVissers-360ERP CasVissers-360ERP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Functional test.

Co-Authored-By: espo-tony <espo-tony@users.noreply.github.com>
@tarteo
Copy link
Member

tarteo commented May 7, 2019

Can you please increase the test coverage.

…' into 11.0-mig-web_access_rule_buttons

# Conflicts:
#	web_access_rule_buttons/models/models.py
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza pedrobaeza merged commit 857e66c into OCA:11.0 May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet