Code review comment for lp:~openerp-dev/openobject-server/6.1-opw-579669-nep

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

I think this is not the right place to fix this.
The issue should be fixed from class document_file's create defined in document.py as this inherits ir_attachment

Secondly the main root of the problem is that in create we already check for the directory context and vals dict if we didn't find any we use the default one i.e the root directory. In your case the ir_attachment create is triggered from the report engine which will never set this field in context nor in vals which in turn pop's up this bug.

So as a solution make changes in the create overridden in document.py something like
if document not in context nor in vals:
     if type in vals and type == folder per resource
             search the directory based on the resource and use.

Note: its just a snippet

Thanks,
Naresh

review: Needs Fixing

« Back to merge proposal