fields_view_get() got an unexpected keyword argument 'submenu'

Asked by Bushair

Hi,
I have installed the fleet_maintenance module .

Naviagtion to
MainMenu->Fleets ->Fleets->NewFleet

But getting the below error whenever i tried to create a newFleet

"fields_view_get() got an unexpected keyword argument 'submenu'"

Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
Operating System Release : 2.6.31-17-generic-pae
Operating System Version : #54-Ubuntu SMP Thu Dec 10 17:23:29 UTC 2009
Operating System Architecture : 32bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.4
OpenERP-Client Version : 5.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/lib/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/openerp-server/service/web_services.py", line 583, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/lib/openerp-server/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/openerp-server/osv/osv.py", line 118, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/openerp-server/osv/osv.py", line 110, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/openerp-server/addons/fleet_maintenance.zip/fleet_maintenance/stock.py", line 41, in fields_view_get
    return super(stock_location, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
TypeError: fields_view_get() got an unexpected keyword argument 'submenu'

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello Bushair,

I think you have not using latest code of fleet_maintenance module so please take this module from following link:

https://code.launchpad.net/~openerp-commiter/openobject-addons/stable_5.0-extra-addons

Hope this will help you.

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#2

Hai, i faced same problem too. using openerp 5.0.6 with fleet maintenance management.
Have tried vra suggestion get the latest code from that url and replaced it. but still error ( with different line reference this time)

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#3

Hello Jones Soh ,

Can you provide the error trace-back which you did get in server terminal so i can easily get whats is the problem?

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#4

since i faced the error, i have uninstall that module, but now i try to install it back ( with the files i get from the launchpad replace into the directory first) and it cannot install with the following error :

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.4/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.4/site-packages/openerp-server/service/web_services.py", line 639, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/usr/lib/python2.4/site-packages/openerp-server/service/web_services.py", line 619, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/usr/lib/python2.4/site-packages/openerp-server/wizard/__init__.py", line 178, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/usr/lib/python2.4/site-packages/openerp-server/wizard/__init__.py", line 74, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/base/module/wizard/wizard_module_upgrade.py", line 92, in _upgrade_module
    db, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/usr/lib/python2.4/site-packages/openerp-server/pooler.py", line 62, in restart_pool
    return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
  File "/usr/lib/python2.4/site-packages/openerp-server/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/__init__.py", line 728, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/__init__.py", line 618, in load_module_graph
    tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs)
  File "/usr/lib/python2.4/site-packages/openerp-server/tools/convert.py", line 885, in convert_xml_import
    obj.parse(xmlstr)
  File "/usr/lib/python2.4/site-packages/openerp-server/tools/convert.py", line 779, in parse
    self._tags[rec.nodeName](self.cr, rec, n)
  File "/usr/lib/python2.4/site-packages/openerp-server/tools/convert.py", line 513, in _tag_menuitem
    menu_parent_id = self.id_get(cr, 'ir.ui.menu', rec.getAttribute('parent'))
  File "/usr/lib/python2.4/site-packages/openerp-server/tools/convert.py", line 761, in id_get
    return int(self.pool.get('ir.model.data').read(cr, self.uid, [result], ['res_id'])[0]['res_id'])
IndexError: list index out of range

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#5

Hello Jones Soh,

May be you had replaced only some limited files instead of hole module,so now you have to replace whole module with newer one instead of limited files and just update the whole database by using following command, This error trace-back only come due to some xml record data misplacement.
./openerp-server.py --addons-path=../../addons-5.0.6/ -u all -d <database-name>.

And if you will steal facing similar problem in the same database so in that time you need to create new database.
Hope this will help you.

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#6

can shed me some light regards to where can i get the latest version of the module? cos the site went is in individual files only....

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#7

Hello Jones Soh,

As I specified the link above that is extra addons:
Stable:
    extra-5.0: https://code.launchpad.net/~openerp-commiter/openobject-addons/stable_5.0-extra-addons.
Trunk :
  trunk-5.0: https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-extra-addons.

Take the extra-addons branch by considering above specified links.
Hope this will help you.

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#8

what i did :

1. i remove the fleet maintenance folder from the add on
2. add in another new DB
3. configure the new db with the modules i want.
4. at another folder i download all the files( from the fleet maintenance) from the above link
5. at that other folder i use the previous downloaded copy ( from the global module index (http://doc.openerp.com/modindex.html) unzip it. then i replace all the files i have downloaded from the link that you have given above.
6. now with the same folder but files from your given link i copy the folder into the add on directory.
7. then using the openerp's administration-> module management - > update module list. i update the module and install it using openerp.
8. the installation was a success and there is no error.
9. but i still receive error when i wan to create a new entry of the new maintenance contract.

the error are as follows : ( HELP!)

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.4/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.4/site-packages/openerp-server/service/web_services.py", line 583, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/lib/python2.4/site-packages/openerp-server/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/openerp-server/osv/osv.py", line 118, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.4/site-packages/openerp-server/osv/osv.py", line 110, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/fleet_maintenance/stock.py", line 160, in fields_view_get
    }) #TODO, we could use product categories to retrieve the maintenance_analytic_id
TypeError: fields_view_get() got an unexpected keyword argument 'submenu'

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#9

Hello Jones Soh,

Used only stable extra addons:
Stable:
    extra-5.0: https://code.launchpad.net/~openerp-commiter/openobject-addons/stable_5.0-extra-addons.

Please do not use trunk-extra-addons link, it is for trunk-addons branch only.(https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-extra-addons.)

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#10

i am getting the file from the stable one i think :
http://bazaar.launchpad.net/~openerp-commiter/openobject-addons/stable_5.0-extra-addons/files/head:/fleet_maintenance/
please advice if this is the correct one.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#11

Hello Subscribers,

Its the problem of one2many field not finding the proper reference of stock.location.

And one important thing you should take care of:
Use Trunk with trunk-extra-addons.
Use stable with stable extra addons.

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#12

my openerp download from stable version 5.0.6 from the official download.
my fleet maintenance download for global module index (5.0)
the files i get to replace is from http://bazaar.launchpad.net/~openerp-commiter/openobject-addons/stable_5.0-extra-addons/files/head:/fleet_maintenance/ ( stable)

all are stable version......
Please help as i need to use this very urgently....

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#13

Hello Jones Soh ,

Apply the following patch:

=== modified file 'fleet_maintenance/stock.py'
--- fleet_maintenance/stock.py 2009-09-18 13:13:15 +0000
+++ fleet_maintenance/stock.py 2010-02-04 13:20:09 +0000
@@ -16,8 +16,8 @@
             view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','stock.location.fleet.form.fleet_maintenance')])[0]
         elif view_type == 'tree' and context.get('fleet_type', False) == 'sub_fleet':
             view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','sub_fleet.tree')])[0]
- #elif view_type == 'tree' and context.get('fleet_type', False) == 'fleet':
- # pass
+ elif view_type == 'tree' and context.get('fleet_type', False) == 'fleet':
+ pass
         return super(stock_location, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar)

@@ -62,7 +62,7 @@
     _columns = {
         'fleet_type': fields.selection([('none','Not a Fleet'),('fleet','Fleet'),('sub_fleet','Sub Fleet')], 'Fleet type', required=False),
         'partner_id': fields.many2one('res.partner', 'Customer', required = False, ondelete = 'cascade', select = True),
- 'parent_partner_id': fields.related('location_id', 'partner_id', type='many2one', relation='res.partner', string='Customer', store=True),
+ 'parent_partner_id': fields.many2one('res.partner', 'Customer', required = False, ondelete = 'cascade', select = True),
         'sale_order_lines': fields.one2many('sale.order.line', 'fleet_id', 'Sale Order Lines'),
         'fleet_sale_order_lines': fields.one2many('sale.order.line', 'parent_fleet_id', 'Sale Order Lines'),
         'account_invoice_lines': fields.one2many('account.invoice.line', 'fleet_id', 'Invoice Lines

Notify me weather your problem is solved or not .
Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#14

after edit the 2 line , still experience error :

1. install success
2. when click on fleet -> fleet maintenance contract -> new maintenance contract
error as follows :

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.4/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.4/site-packages/openerp-server/service/web_services.py", line 583, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/lib/python2.4/site-packages/openerp-server/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/openerp-server/osv/osv.py", line 118, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.4/site-packages/openerp-server/osv/osv.py", line 110, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/python2.4/site-packages/openerp-server/addons/fleet_maintenance/stock.py", line 160, in fields_view_get
    'account_analytic_id':order_line.product_id.maintenance_analytic_id.id \
TypeError: fields_view_get() got an unexpected keyword argument 'submenu'

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#15

Hello Jones Soh,

This module contains some errors and incomplete code so this is needed to fix. So better you will subscribe a bug for this and assign it to Raphaël Valyi who is created this module.He will definitely solve all problem regarding to this module.

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#16

thank you so much everyone here, i have submit a bugs report assing to Raphaël Valyi. hope to hear from him soon....
Need advice from everyone here, beside this module is there any other modules that can help managing the yearly service contract:

1. Need to have a main contract template
2. tracking of monthly invoicing of the maintenance contract.
3. advance notification of contract expiry.

thank you

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#17

Hello Jones Soh,

There is not any other related module exist regarding to your requirement.

Thanks.

Revision history for this message
Jones Soh (kao-suk) said :
#18

have submitted the bugs report still no reply....I ran into another trouble regarding quotation. is it possible to discuss it here or shall i open another thread? anyone can help?

Donwload linux version 5.0.6 installed on centos 5.4,

with the basic modules : service industry, try to create a new quotation but when click on the right hand tab [report] "quotation/order", error as below occurs :

unicode() argument 2 must be string, not None

Please help.... i am in desperate situation here.... first the fleet now even the core... sales management....

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#19

Hello Jones Soh,

I think you need to update your database completely , before update you need to uninstall the fleet_maintenance module completely.
If you will face similar problem again you need to create new database.
Regarding fleet maintenance module bug set its priority high if it is urgent.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#20

Hi Jones,
For the unicode issue, set your focus on https://bugs.launchpad.net/bugs/523975.
It will be fixed soon.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Bushair for more information if necessary.

To post a message you must log in.