v7.0: unable to share portal

Bug #1093038 reported by Markus Bala
198
This bug affects 31 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 1

Bug Description

lient Traceback (most recent call last):
  File "/home/odoo/source/web/addons/web/http.py", line 195, in dispatch
Step To Reproduce:
1. select customer
2. Click "More" > "Embed"
3. Click "Share"

Below is the result:

    response["result"] = method(self, **self.params)
  File "/home/odoo/source/web/addons/web/controllers/main.py", line 1082, in call_button
    action = self._call_kw(req, model, method, args, {})
  File "/home/odoo/source/web/addons/web/controllers/main.py", line 1070, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/home/odoo/source/web/addons/web/session.py", line 40, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/home/odoo/source/web/addons/web/session.py", line 28, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/home/odoo/source/web/addons/web/session.py", line 101, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/home/odoo/source/web/addons/web/session.py", line 87, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/odoo/source/server/openerp/netsvc.py", line 281, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/odoo/source/server/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/home/odoo/source/server/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/odoo/source/server/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/odoo/source/server/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/odoo/source/server/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/odoo/source/addons/share/wizard/share_wizard.py", line 696, in go_step_2
    self._check_preconditions(cr, uid, wizard_data, context=context)
  File "/home/odoo/source/addons/portal/wizard/share_wizard.py", line 56, in _check_preconditions
    return super(share_wizard_portal, self)._check_preconditions(cr, uid, wizard_data, context=context)
  File "/home/odoo/source/addons/share/wizard/share_wizard.py", line 663, in _check_preconditions
    self._assert(self.has_share(cr, uid, context=context),
TypeError: has_share() takes at least 4 arguments (4 given)

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Atul Patel(OpenERP) (atp-openerp) wrote :

Hello,

It has been fixed into https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1093038-atp branch,

with Revision ID: <email address hidden>
Revision No:8482

it will be merged soon in trunk..

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Michael Karrer (michaelkarrer81) wrote :
Download full text (3.4 KiB)

This fix is NOT fully working in the current 7.0 stable release!
After applying the patch every user gets this error message after the login and after clicking on a menu item like "project" or "sales":

OpenERP Server Error
Client Traceback (most recent call last):
  File "/opt/openerp/11069-lightbase/web/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/openerp/11069-lightbase/web/addons/web/controllers/main.py", line 1078, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/opt/openerp/11069-lightbase/web/addons/web/controllers/main.py", line 1070, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/openerp/11069-lightbase/web/addons/web/session.py", line 43, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/openerp/11069-lightbase/web/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/openerp/11069-lightbase/web/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/openerp/11069-lightbase/web/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp/11069-lightbase/server/openerp/netsvc.py", line 289, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/11069-lightbase/server/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/11069-lightbase/server/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/11069-lightbase/server/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/11069-lightbase/server/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/11069-lightbase/server/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/11069-lightbase/addons/share/wizard/share_wizard.py", line 73, in has_share
    return self.has_group(cr, uid, module='share', group_xml_id='group_share_user', context=context)
  File "/opt/openerp/11069-lightbase/addons/share/wizard/share_wizard.py", line 70, in has_group
    return group_id in self.pool.get('res.users').read(cr, uid, uid, ['groups_id'], context=context)['groups_id']
  File "/opt/openerp/11069-lightbase/server/openerp/addons/base/res/res_users.py", line 793, in read
    res = super(users_view, self).read(cr, uid, ids, fields, context=context, load=load)
  File "/opt/openerp/11069-lightbase/server/openerp/addons/base/res/res_users.py", line 268, in read
    result = super(res_users, self).read(cr, uid, ids, fields=fields, context=context, load=load)
  File "/opt/openerp/11069-lightbase/server/openerp/osv/orm.py", line 3606, in read
    result =...

Read more...

Revision history for this message
Paul Korotkov (korotkov-paul) wrote :

Confirm, that fix is not working with latest 7.0 branch. It leads to error.

Revision history for this message
Egor Tsinko (etsinko) wrote :

Michael,
note that after patching and having this error message pop up both "Share" and "Embed" buttons disappear.

Revision history for this message
Atul Patel(OpenERP) (atp-openerp) wrote :

hello,
now it has been fixed on same branch https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1093038-atp branch, with new

Revision Id: <email address hidden>
Revision NO: 8484

it will be merged soon on addons..

Thanks

Revision history for this message
Paul Korotkov (korotkov-paul) wrote :

After applying latest patch rev 8484 it still not working!

Revision history for this message
Egor Tsinko (etsinko) wrote :

Paul,
what are the symptoms?

Revision history for this message
Paul Korotkov (korotkov-paul) wrote :

Symptoms of bug in share wizard 7.0

Steps to reproduce bug in latest 7.0 with latest patch 8484
I create new database with demo data.
Install hr module, select employee.
In form view of employee select share from menu.
Choose sharing method - existing groups, choose portal group, then press share.
Result - error below.

Client Traceback (most recent call last):
  File "/home/kpi/openerp/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/home/kpi/openerp/openerp/addons/web/controllers/main.py", line 1083, in call_button
    action = self._call_kw(req, model, method, args, {})
  File "/home/kpi/openerp/openerp/addons/web/controllers/main.py", line 1071, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/home/kpi/openerp/openerp/addons/web/session.py", line 43, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/home/kpi/openerp/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/home/kpi/openerp/openerp/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
  File "/home/kpi/openerp/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/kpi/openerp/openerp/netsvc.py", line 295, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/kpi/openerp/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/home/kpi/openerp/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/kpi/openerp/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/kpi/openerp/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/kpi/openerp/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/kpi/openerp/openerp/addons/share/wizard/share_wizard.py", line 699, in go_step_2
    group_id, new_ids, existing_ids = self._create_share_users_group(cr, uid, wizard_data, context=context)
  File "/home/kpi/openerp/openerp/addons/portal/wizard/share_wizard.py", line 129, in _create_share_users_group
    self._create_shared_data_menu(cr, uid, wizard_data, group.id, context=context)
  File "/home/kpi/openerp/openerp/addons/portal/wizard/share_wizard.py", line 95, in _create_shared_data_menu
    root_menu_id = self._sharing_root_menu_id(cr, uid, portal, context=context)
  File "/home/kpi/openerp/openerp/addons/portal/wizard/share_wizard.py", line 84, in _sharing_root_menu_id
    parent_menu_id = self._create_or_get_submenu_named(cr, uid, portal.parent_menu_id.id, SHARED_DOCS_MENU, context=context)
AttributeError: 'int' object has no attribute 'parent_menu_id'

Revision history for this message
Felix Schubert (input-fescon) wrote :

Still having the problem while trying to share a project:

Client Traceback (most recent call last):
  File "/srv/openerp7/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/srv/openerp7/openerp/addons/web/controllers/main.py", line 1083, in call_button
    action = self._call_kw(req, model, method, args, {})
  File "/srv/openerp7/openerp/addons/web/controllers/main.py", line 1071, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/srv/openerp7/openerp/addons/web/session.py", line 43, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/srv/openerp7/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/srv/openerp7/openerp/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
  File "/srv/openerp7/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/srv/openerp7/openerp/netsvc.py", line 295, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/srv/openerp7/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/srv/openerp7/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/srv/openerp7/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/srv/openerp7/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/srv/openerp7/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/srv/openerp7/openerp/addons/share/wizard/share_wizard.py", line 696, in go_step_2
    self._check_preconditions(cr, uid, wizard_data, context=context)
  File "/srv/openerp7/openerp/addons/portal/wizard/share_wizard.py", line 56, in _check_preconditions
    return super(share_wizard_portal, self)._check_preconditions(cr, uid, wizard_data, context=context)
  File "/srv/openerp7/openerp/addons/share/wizard/share_wizard.py", line 663, in _check_preconditions
    self._assert(self.has_share(cr, uid, context=context),
TypeError: has_share() takes at least 4 non-keyword arguments (3 given)

Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

The cause of what Paul noticed in comment #8 is that portals are now just groups with a field is_portal set to True.

- first, on line 129 in portal/share_wizard.py a 'group.id' is passed to the method '_create_shared_data_menu'. I think that needs to be 'group' instead of 'group.id'
- second, when passed via method ' _create_shared_data_menu' to method '_sharing_root_menu' an attempt is made to access 'portal.parent_menu_id.id' but the portal (= res.groups) object does not have a 'parent_menu_id' anymore, this is a leftover when portal objects were ' res.portal'

Quite a bit of the code in portal/share_wizard still thinks the portal object *does* have the parent_menu id.

I'm not sure what the fix should be here, but it looks as if a whole piece of the wizard needs reviewing.

Changed in openobject-addons:
status: Fix Committed → New
status: New → Confirmed
Revision history for this message
Paul Korotkov (korotkov-paul) wrote :

Seems this bug will never be fixed...

Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

Could anyone from OpenERP please comment on this issue? It's not trivial and it looks the bug is not getting the attention it deserves. My apologies if I'm just impatient and the bug is getting attention.

Revision history for this message
Onur Başer - openerp.biz.tr (onur-bit) wrote :

same problem with v7

Revision history for this message
Paul Korotkov (korotkov-paul) wrote :

Share wizard is still not working on rev 8836 addons/7.0.

Revision history for this message
Onur Başer - openerp.biz.tr (onur-bit) wrote :

looks like it is working as of today. I got the latest revision. I can get embed code. No more error page.

Revision history for this message
Onur Başer - openerp.biz.tr (onur-bit) wrote :

oops customers are not working but quoatations and offers are OK.

Revision history for this message
Andreas Brueckl (andreas-brueckl) wrote :

I applied the patch. Then I shared a sale.oder to a certain email address. The mail has been generated and the user was able to login with his email address and password.

However on his screen he did not see any menu nor the shared objects.

Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

Repeated request: Can anyone from OpenERP assess this bug please!! We're 5 months in without any response.

Revision history for this message
Gilles Major (OpenERP) (gim-openerp) wrote :

I've reported this bug again in an internal task.

Revision history for this message
Benjamin Smith (smith-benjamin-j) wrote :

This bug is still not fixed; Version 7.0-20130508-231028

Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

Repeated request: Can anyone from OpenERP assess this bug please!! We're 12 months in without any response, other than confirmation it is an internal task now (comment #19). What gives?

Revision history for this message
Michael Karrer (michaelkarrer81) wrote :

14 Months to fix such a bug seems pretty long - Any update on this?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.