Kirti Savalia(OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/6.1-opw-576610-ksa into
lp:openobject-server/6.1.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.1-opw-576610-ksa/+merge/114143
Hello,
Fixed the issue when attched the invoice at that time got the error bool object
is unscriptable.
--
https://code.launchpad.net/~openerp-dev/openobject-server/6.1-opw-576610-ksa/+merge/114143
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/6.1-opw-576610-ksa.
=== modified file 'openerp/addons/base/ir/ir_attachment.py'
--- openerp/addons/base/ir/ir_attachment.py 2012-03-09 10:04:29 +0000
+++ openerp/addons/base/ir/ir_attachment.py 2012-07-10 09:46:27 +0000
@@ -63,17 +63,14 @@
if count:
return 0
return []
-
# For attachments, the permissions of the document they are attached to
# apply, so we must remove attachments for which the user cannot access
# the linked document.
targets = super(ir_attachment,self).read(cr, uid, ids, ['id', 'res_model', 'res_id'])
model_attachments = {}
- for target_dict in targets:
- if not (target_dict['res_id'] and target_dict['res_model']):
- continue
- # model_attachments = { 'model': { 'res_id': [id1,id2] } }
- model_attachments.setdefault(target_dict['res_model'],{}).setdefault(target_dict['res_id'],set()).add(target_dict['id'])
+ if targets:
+# # model_attachments = { 'model': { 'res_id': [id1,id2] } }
+ model_attachments.setdefault(targets[0]['res_model'],{}).setdefault(targets[0]['res_id'],set()).add(targets[0]['id'])
# To avoid multiple queries for each attachment found, checks are
# performed in batch as much as possible.
@@ -92,8 +89,6 @@
for res_id in disallowed_ids:
for attach_id in targets[res_id]:
ids.remove(attach_id)
- if count:
- return len(ids)
return ids
def read(self, cr, uid, ids, fields_to_read=None, context=None, load='_classic_read'):
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp