← Back to team overview

openerp-india team mailing list archive

[Bug 1080536] Re: many2one functional field not supported in view

 

Hello Kyle Waid,

I have checked your issue with latest trunk, but I did not face any issue. So would you please provide a proper steps to
reproduce the bug.

For more information:

You can see the many2one function field defined in the
account/account_bank_statement.py(line no: 128):

'currency': fields.function(_currency, string='Currency',
type='many2one', relation='res.currency'),

and corresponding in the account/account_view.xml(line no: 564), remove the invisible="1" and you can see the 'Currency' field in the following form view:
Invoicing -> Bank and Cash -> Bank Statements.

By seeing the traceback it seems that problem is in the function you
defined.

Thanks,
Divyesh


** Changed in: openobject-server
       Status: New => Incomplete

-- 
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/1080536

Title:
  many2one functional field not supported in view

Status in OpenERP Server:
  Incomplete

Bug description:
  I tried to create a many2one functional field

          'refund_ids_list': fields.function(_get_payments_for_refund,
  type='many2one', relation='account.voucher', string="stuff",
  method=True,  store=False)

  I put this field in the view.

  I cannot load the view. It appears that these types of fields are not
  supported in a view

  Server Traceback (most recent call last):
    File "/usr/local/openerp/web/addons/web/common/http.py", line 593, in send
      return openerp.netsvc.dispatch_rpc(service_name, method, args)
    File "/usr/local/openerp/openerp-server/openerp/netsvc.py", line 360, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "/usr/local/openerp/openerp-server/openerp/service/web_services.py", line 586, in dispatch
      res = fn(db, uid, *params)
    File "/usr/local/openerp/openerp-server/openerp/osv/osv.py", line 167, in execute_kw
      return self.execute(db, uid, obj, method, *args, **kw or {})
    File "/usr/local/openerp/openerp-server/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/local/openerp/openerp-server/openerp/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/local/openerp/openerp-server/openerp/osv/osv.py", line 164, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/usr/local/openerp/openerp-server/openerp/osv/orm.py", line 3416, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "/usr/local/openerp/openerp-server/openerp/osv/orm.py", line 3542, in _read_flat
      record[f] = res2[record['id']]
  KeyError: 13

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


References