error on displaying functional fields

Bug #416016 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
Invalid
Undecided
Unassigned

Bug Description

       'current_artist' : fields.function(_current_artist, method=True,string='Current Artist',type='selection',
                                             selection=[('current','Current'),('unused','Unused')],
                                             Help="Person is part of the current Album/Track",
                                             store=True),

the data are stored correctly (in a text field ?) in the database
web browser works, GTK seems to have a similar problem

Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/TreeWidget.py", line 269, in open
    self.executeAction( 'tree_but_open', id )
  File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/TreeWidget.py", line 262, in executeAction
    Api.instance.executeKeyword(keyword, {'model':self.model, 'id':id, 'report_type':report_type, 'ids': [id]})
  File "./koo.py", line 127, in executeKeyword
    return Koo.Actions.executeKeyword( keyword, data, context )
  File "/usr/lib64/python2.6/site-packages/Koo/Actions/Actions.py", line 224, in executeKeyword
    Api.instance.executeAction(action, data, context=context)
  File "./koo.py", line 124, in executeAction
    Koo.Actions.executeAction( action, data, context )
  File "/usr/lib64/python2.6/site-packages/Koo/Actions/Actions.py", line 173, in executeAction
    target=target )
  File "./koo.py", line 133, in createWindow
    view_type, window, context, mode, name, autoReload, target )
  File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/WindowService.py", line 51, in createWindow
    context=context, name=name )
  File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/FormWidget.py", line 108, in __init__
    self.screen.setupViews( view_type, view_ids )
  File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 142, in setupViews
    self.switchView()
  File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 361, in switchView
    self.setView( self.currentView() )
  File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 610, in currentView
    self.addViewByIdAndType( id, type )
  File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 383, in addViewByIdAndType
    return self.addView( view['arch'], view['fields'], display, toolbar=view.get('toolbar', False), id=view.get('view_id',False) )
  File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 449, in addView
    view = ViewFactory.create(id, self, self.resource, dom, self.fields)
  File "/usr/lib64/python2.6/site-packages/Koo/View/ViewFactory.py", line 73, in create
    return parser.create(viewId, parent, model, node, fields)
  File "/usr/lib64/python2.6/site-packages/Koo/View/Tree/Parser.py", line 95, in create
    fields[fname]['readonly'] = bool(int(node_attrs['readonly']))
ValueError: invalid literal for int() with base 10: 'True'

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote : Re: [Bug 416016] [NEW] error on displaying functional fields

A Dimecres, 19 d'agost de 2009, Ferdinand @ ChriCar va escriure:
> Public bug reported:
>
> 'current_artist' : fields.function(_current_artist,
> method=True,string='Current Artist',type='selection',
> selection=[('current','Current'),('unused','Unused')], Help="Person is part
> of the current Album/Track", store=True),

Can you send the description of the view? Simply the <field
name="current_artist" ...> would be enough.

>
> the data are stored correctly (in a text field ?) in the database
> web browser works, GTK seems to have a similar problem
>
> Traceback (most recent call last):
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/TreeWidget.py", line
> 269, in open self.executeAction( 'tree_but_open', id )
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/TreeWidget.py", line
> 262, in executeAction Api.instance.executeKeyword(keyword,
> {'model':self.model, 'id':id, 'report_type':report_type, 'ids': [id]}) File
> "./koo.py", line 127, in executeKeyword
> return Koo.Actions.executeKeyword( keyword, data, context )
> File "/usr/lib64/python2.6/site-packages/Koo/Actions/Actions.py", line
> 224, in executeKeyword Api.instance.executeAction(action, data,
> context=context)
> File "./koo.py", line 124, in executeAction
> Koo.Actions.executeAction( action, data, context )
> File "/usr/lib64/python2.6/site-packages/Koo/Actions/Actions.py", line
> 173, in executeAction target=target )
> File "./koo.py", line 133, in createWindow
> view_type, window, context, mode, name, autoReload, target )
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/WindowService.py",
> line 51, in createWindow context=context, name=name )
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/FormWidget.py", line
> 108, in __init__ self.screen.setupViews( view_type, view_ids )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 142,
> in setupViews self.switchView()
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 361,
> in switchView self.setView( self.currentView() )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 610,
> in currentView self.addViewByIdAndType( id, type )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 383,
> in addViewByIdAndType return self.addView( view['arch'], view['fields'],
> display, toolbar=view.get('toolbar', False), id=view.get('view_id',False) )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 449,
> in addView view = ViewFactory.create(id, self, self.resource, dom,
> self.fields) File
> "/usr/lib64/python2.6/site-packages/Koo/View/ViewFactory.py", line 73, in
> create return parser.create(viewId, parent, model, node, fields)
> File "/usr/lib64/python2.6/site-packages/Koo/View/Tree/Parser.py", line
> 95, in create fields[fname]['readonly'] = bool(int(node_attrs['readonly']))
> ValueError: invalid literal for int() with base 10: 'True'
>
> ** Affects: openobject-client-kde
> Importance: Undecided
> Status: New

--
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18

Revision history for this message
Ferdinand (office-chricar) wrote :

see attachment

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote :

Right, you don't need readonly=True in functional fields, it's implied.

A Dimecres, 19 d'agost de 2009, Ferdinand @ ChriCar va escriure:
> Public bug reported:
>
> 'current_artist' : fields.function(_current_artist,
> method=True,string='Current Artist',type='selection',
> selection=[('current','Current'),('unused','Unused')], Help="Person is part
> of the current Album/Track", store=True),
>
> the data are stored correctly (in a text field ?) in the database
> web browser works, GTK seems to have a similar problem
>
> Traceback (most recent call last):
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/TreeWidget.py", line
> 269, in open self.executeAction( 'tree_but_open', id )
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/TreeWidget.py", line
> 262, in executeAction Api.instance.executeKeyword(keyword,
> {'model':self.model, 'id':id, 'report_type':report_type, 'ids': [id]}) File
> "./koo.py", line 127, in executeKeyword
> return Koo.Actions.executeKeyword( keyword, data, context )
> File "/usr/lib64/python2.6/site-packages/Koo/Actions/Actions.py", line
> 224, in executeKeyword Api.instance.executeAction(action, data,
> context=context)
> File "./koo.py", line 124, in executeAction
> Koo.Actions.executeAction( action, data, context )
> File "/usr/lib64/python2.6/site-packages/Koo/Actions/Actions.py", line
> 173, in executeAction target=target )
> File "./koo.py", line 133, in createWindow
> view_type, window, context, mode, name, autoReload, target )
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/WindowService.py",
> line 51, in createWindow context=context, name=name )
> File "/usr/lib64/python2.6/site-packages/Koo/Dialogs/FormWidget.py", line
> 108, in __init__ self.screen.setupViews( view_type, view_ids )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 142,
> in setupViews self.switchView()
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 361,
> in switchView self.setView( self.currentView() )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 610,
> in currentView self.addViewByIdAndType( id, type )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 383,
> in addViewByIdAndType return self.addView( view['arch'], view['fields'],
> display, toolbar=view.get('toolbar', False), id=view.get('view_id',False) )
> File "/usr/lib64/python2.6/site-packages/Koo/Screen/Screen.py", line 449,
> in addView view = ViewFactory.create(id, self, self.resource, dom,
> self.fields) File
> "/usr/lib64/python2.6/site-packages/Koo/View/ViewFactory.py", line 73, in
> create return parser.create(viewId, parent, model, node, fields)
> File "/usr/lib64/python2.6/site-packages/Koo/View/Tree/Parser.py", line
> 95, in create fields[fname]['readonly'] = bool(int(node_attrs['readonly']))
> ValueError: invalid literal for int() with base 10: 'True'
>
> ** Affects: openobject-client-kde
> Importance: Undecided
> Status: New

--
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote : Re: [Bug 416016] Re: error on displaying functional fields

A Dimecres, 19 d'agost de 2009, Ferdinand @ ChriCar va escriure:
> see attachment
>
> ** Attachment added: "koo_person_view_def.txt"
> http://launchpadlibrarian.net/30512543/koo_person_view_def.txt

Can you please try r1016 and see if it fixes your problem?

--
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18

Revision history for this message
Ferdinand (office-chricar) wrote :

seems to be a serverside problem

after some reloading of some variants of the code, finally everything everything works now

sorry for inconvenience

Changed in openobject-client-kde:
status: New → Invalid
Revision history for this message
Ferdinand (office-chricar) wrote :

I saw one difference
the functional field had "readonly true" in the xml - which might have caused the error.

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote :

A Dimecres, 19 d'agost de 2009, Ferdinand @ ChriCar va escriure:
> I saw one difference
> the functional field had "readonly true" in the xml - which might have
> caused the error.

That indeed caused the problem. That is due to OpenERP not having a standard
way of setting boolean values in views. In the 4.2 days it used to be 1 or 0,
and now it seems True / False is the standard. However, given that this
parameter is usually only used in forms, it didn't work in trees.. The patch I
commited should make it work for trees as well.

--
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18

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.