Merge lp:~openerp-dev/openobject-addons/6.1-opw-579669-nep into lp:openobject-addons/6.1

Proposed by Nehal Panchal (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 7096
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579669-nep
Merge into: lp:openobject-addons/6.1
Diff against target: 23 lines (+7/-3)
1 file modified
document/ (+7/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579669-nep
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email:

Description of the change


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, type:Folders per resource, and Resource Model:account.invoice.
2. When you print Invoice report, attachment will be created with Document directory which is wrong.

This fixes the issue.


To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :


This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Naresh Soni

Unmerged revisions

7096. By Nehal Panchal (OpenERP)

[FIX] document:Fixed the issue while creating an attachment by OpenERP,directory specified with resource model should be considered

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'document/'
2--- document/ 2012-08-22 09:10:40 +0000
3+++ document/ 2012-12-07 12:43:22 +0000
4@@ -267,12 +267,16 @@
5 if context is None:
6 context = {}
7 vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False)
8+ if not vals.get('res_model', False) and context.get('default_res_model', False):
9+ vals['res_model'] = context.get('default_res_model', False)
10 if not vals['parent_id']:
11- vals['parent_id'] = self.pool.get('')._get_root_directory(cr,uid, context)
12+ parent_id = self.pool.get('').search(cr, uid, [('ressource_type_id','=',vals['res_model'])])
13+ if parent_id and parent_id[0]:
14+ vals['parent_id'] = parent_id[0]
15+ else:
16+ vals['parent_id'] = self.pool.get('')._get_root_directory(cr,uid, context)
17 if not vals.get('res_id', False) and context.get('default_res_id', False):
18 vals['res_id'] = context.get('default_res_id', False)
19- if not vals.get('res_model', False) and context.get('default_res_model', False):
20- vals['res_model'] = context.get('default_res_model', False)
21 if vals.get('res_id', False) and vals.get('res_model', False) \
22 and not vals.get('partner_id', False):
23 vals['partner_id'] = self.__get_partner_id(cr, uid, \