← Back to team overview

openerp-india team mailing list archive

[Bug 1111836] [NEW] [7.0] Share and Embed options not working

 

Public bug reported:

Whenever I try to "share" or "embed" a document in OpenERP 7.0 it throws
this on the server:

2013-01-31 20:52:00,236 28993 ERROR openerp7 openerp.netsvc: has_share() takes at least 4 arguments (4 given)
Traceback (most recent call last):
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/netsvc.py", line 289, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 697, in go_step_2
    self._check_preconditions(cr, uid, wizard_data, context=context)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/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 "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 664, in _check_preconditions
    self._assert(self.has_share(cr, uid, context=context),
TypeError: has_share() takes at least 4 arguments (4 given)

I checked the code and seems that the function "has_share" has a weird
variable called "unused_param", here is the function:

    def has_share(self, cr, uid, unused_param, context=None):
        return self.has_group(cr, uid, module='share', group_xml_id='group_share_user', context=context)

So when it calls has_group I added a variable to fill that gap, so that
the context is recieved properly in has_share, but now the problem is
this:


2013-01-31 21:24:49,961 29778 ERROR openerp7 openerp.addons.share.wizard.share_wizard: Failed to create share access
Traceback (most recent call last):
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 653, in _create_indirect_sharing_rules
    rule_name=rule_name, restrict=True, context=context)
  File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 617, in _create_or_combine_sharing_rule
    org_domain = expression.normalize(eval(rule.domain_force, eval_ctx))
AttributeError: 'module' object has no attribute 'normalize'
2013-01-31 21:24:49,962 29778 ERROR openerp7 openerp.netsvc: No se ha podido crear el acceso compartido.

So it seems that "expression", that is imported from openerp.osv does
not have a "normalize" function, and dunno where that might be fixed.

** Affects: openobject-server
     Importance: Undecided
         Status: New


** Tags: 7.0

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1111836

Title:
  [7.0] Share and Embed options not working

Status in OpenERP Server:
  New

Bug description:
  Whenever I try to "share" or "embed" a document in OpenERP 7.0 it
  throws this on the server:

  2013-01-31 20:52:00,236 28993 ERROR openerp7 openerp.netsvc: has_share() takes at least 4 arguments (4 given)
  Traceback (most recent call last):
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/netsvc.py", line 289, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/service/web_services.py", line 614, in dispatch
      res = fn(db, uid, *params)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 169, in execute_kw
      return self.execute(db, uid, obj, method, *args, **kw or {})
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 123, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 179, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/osv/osv.py", line 166, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 697, in go_step_2
      self._check_preconditions(cr, uid, wizard_data, context=context)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/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 "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 664, in _check_preconditions
      self._assert(self.has_share(cr, uid, context=context),
  TypeError: has_share() takes at least 4 arguments (4 given)

  I checked the code and seems that the function "has_share" has a weird
  variable called "unused_param", here is the function:

      def has_share(self, cr, uid, unused_param, context=None):
          return self.has_group(cr, uid, module='share', group_xml_id='group_share_user', context=context)

  So when it calls has_group I added a variable to fill that gap, so
  that the context is recieved properly in has_share, but now the
  problem is this:

  
  2013-01-31 21:24:49,961 29778 ERROR openerp7 openerp.addons.share.wizard.share_wizard: Failed to create share access
  Traceback (most recent call last):
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 653, in _create_indirect_sharing_rules
      rule_name=rule_name, restrict=True, context=context)
    File "/Users/guerrerocarlos/Repositorios/openerp-7.0-20130129-000102/openerp/addons/share/wizard/share_wizard.py", line 617, in _create_or_combine_sharing_rule
      org_domain = expression.normalize(eval(rule.domain_force, eval_ctx))
  AttributeError: 'module' object has no attribute 'normalize'
  2013-01-31 21:24:49,962 29778 ERROR openerp7 openerp.netsvc: No se ha podido crear el acceso compartido.

  So it seems that "expression", that is imported from openerp.osv does
  not have a "normalize" function, and dunno where that might be fixed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1111836/+subscriptions


Follow ups

References