Module 'document' contains invalid relational field 'user'

Bug #1175984 reported by Karel Marissens
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
7.0
Fix Released
Low
OpenERP Publisher's Warranty Team
Trunk
Confirmed
Medium
OpenERP R&D Addons Team 1

Bug Description

OpenERP version: 7.0-20130429-232454

Relevant code of 'report.document.user':
        'user_id':fields.integer('Owner', readonly=True),
        'user': fields.related('user_id', 'name', type='char', size=64, readonly=True),

'user_id' is an integer, so it's impossible to follow the related field 'user'.

This problem was discovered by running the 'general_read_test.yml' from the smile_test module (https://github.com/Smile-SA/smile_openerp_test), which is how it's reproducable.

Note that the error was very cryptic:
        TypeError: 'int' object has no attribute '__getitem__'

Maybe some better error handling could be added to the relational field class in fields.py (in the method '_fnct_read'). The 'path' of the related field is followed, but there's no check if the path is actually browsable.

Tags: maintenance

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Ravi Gohil (OpenERP) (rgo-openerp) wrote :

Hi Karel Marissens,

For V7, this issue has been fixed in the,
Branch: lp:~openerp-dev/openobject-addons/7.0-opw-592256-rgo
Rev Id: <email address hidden>
Rev #: 9099

>Note that the error was very cryptic:
> TypeError: 'int' object has no attribute '__getitem__'
>
>Maybe some better error handling could be added to the relational field class in fields.py (in the method '_fnct_read'). The 'path' of the related field is followed, but there's no check if the path is actually browsable.

This should be considered as an improvement suggestion and should be targeted for trunk version, so, I will open it for trunk.

Thanks.

Revision history for this message
Xavier ALT (dex-phx) wrote :

Hi,

Fix merged in stable 7.0 addons with following revision:

revno: 9708 [merge]
revision-id: <email address hidden>

Regards,

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.