Merge lp:~openerp-dev/openobject-server/6.1-opw-579669-nep into lp:openobject-server/6.1
Proposed by
Nehal Panchal (OpenERP)
Status: | Rejected |
---|---|
Rejected by: | Naresh(OpenERP) |
Proposed branch: | lp:~openerp-dev/openobject-server/6.1-opw-579669-nep |
Merge into: | lp:openobject-server/6.1 |
Diff against target: |
13 lines (+4/-0) 1 file modified
openerp/addons/base/ir/ir_attachment.py (+4/-0) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/6.1-opw-579669-nep |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Naresh(OpenERP) (community) | Needs Fixing | ||
Review via email: mp+126935@code.launchpad.net |
Description of the change
Hello,
While creating an attachment by OpenERP, directory specified with resource model should be considered.
Steps to reproduce:
1. Create a directory with resource model for example:Invoice.
2. When you print Invoice report, attachment will be created with Document directory which is wrong.
This fixes the issue.
Thanks
To post a comment you must log in.
Unmerged revisions
- 4282. By Nehal Panchal (OpenERP)
-
[FIX] base : Fixed the issue while creating an attachment by OpenERP,directory specified with resource model should be considered
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