module fms - error to create Fuellog

Bug #1046832 reported by oldbay on 2012-09-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP modules by Vertel
High
Anders Wallenquist

Bug Description

openerp v6.1 (bazaar version)
Install module fms
When trying to create fuel log(FLEET MANAGER ->Operations Managment->Fuel Log-> click to "Create"), getting error:

Client Traceback (most recent call last):
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/web/controllers/main.py", line 1065, in default_get
    return Model.default_get(fields, req.session.eval_context(req.context))
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/osv/orm.py", line 1503, in default_get
    defaults[f] = self._defaults[f](self, cr, uid, context)
  File "/home/oldbay/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/addons/fms/fms_fuellog.py", line 185, in <lambda>
    'general_account_id': lambda obj,cr,uid,context: obj._get_type(cr,uid,context).account_id.id,
AttributeError: 'NoneType' object has no attribute 'id'

Anders Wallenquist (aw) on 2012-09-18
Changed in openerp-vertel:
status: New → Confirmed
importance: Undecided → High
Anders Wallenquist (aw) wrote :

This is corrected in release # 95, soon in apps.openerp.com

Changed in openerp-vertel:
status: Confirmed → Fix Released
assignee: nobody → Anders Wallenquist (aw)
Anders Wallenquist (aw) wrote :

You have to add a standard account for Fuel Log for the company

oldbay (old-bay) wrote :

in web interface OK!
in GTK Openerp Client: click to "FLEET MANAGER ->Operations Managment->Fuel Log" and "FLEET MANAGER ->Operations Managment->Fleet Card Expenses",getting error:

File "/home/admin/Dropbox/workspace/OpenERP/src/OpenERP/6.1/site-packages/openerp/wsgi/core.py", line 80, in xmlrpc_return
    response = xmlrpclib.dumps((result,), methodresponse=1, allow_none=False, encoding=None)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1085, in dumps
    data = m.dumps(params)
  File "/usr/lib/python2.7/xmlrpclib.py", line 632, in dumps
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 735, in dump_struct
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 735, in dump_struct
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 658, in dump_nil
    raise TypeError, "cannot marshal None unless allow_none is enabled"
TypeError: cannot marshal None unless allow_none is enabled

This is a GTK Client error only, as https://answers.launchpad.net/openobject-server/+question/201487

Anders Wallenquist (aw) wrote :

Tank you oldbay for the heads up on the GTK-client problem.

I have added a new bug report for this. https://bugs.launchpad.net/openerp-vertel/+bug/1053230

You also added a nice tip for the solution. It seems if I change the behaivor of onchange this bug could be solved. Do you now any example of code that demonstrates this solution?:
"""
Using "onchange( parameter or False )" constructs, you can prevent this.
"""

oldbay (old-bay) wrote :

Editinng rpc.py file in GTK Client (add "allow_none=True" to all xmlrpclib.ServerProxy calls in rpc.py), the problem is not fixed.

Problem is fixed edit wsgi/core.py file in openerp-server (edit all "xmlrpclib.dumps(fault, allow_none=False, encoding=None)" to "xmlrpclib.dumps(fault, allow_none=True, encoding=None)" ), so works.
I do not know - whether it is correct.

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

Other bug subscribers