Merge lp:~vauxoo/openerp-mexico-localization/jose-ir-atachment into lp:openerp-mexico-localization/7.0

Status: Merged
Merged at revision: 293
Proposed branch: lp:~vauxoo/openerp-mexico-localization/jose-ir-atachment
Merge into: lp:openerp-mexico-localization/7.0
Diff against target: 15 lines (+3/-2)
1 file modified
l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py (+3/-2)
To merge this branch: bzr merge lp:~vauxoo/openerp-mexico-localization/jose-ir-atachment
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Nhomar - Vauxoo Pending
Review via email: mp+185689@code.launchpad.net

Description of the change

When you try delete an atachment from any model you can't do it because in the method unlink you set that for you can delete an atachment you must have electronic invoice access rule is why that set the super user id tin the search method for you can read in any model and delete atachments if you can do it

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py'
2--- l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-08-31 00:55:00 +0000
3+++ l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-09-15 23:41:27 +0000
4@@ -508,8 +508,9 @@
5 _inherit = 'ir.attachment'
6
7 def unlink(self, cr, uid, ids, context=None):
8- attachments = self.pool.get('ir.attachment.facturae.mx').search(cr, uid, ['|', '|', (
9- 'file_input', 'in', ids), ('file_xml_sign', 'in', ids), ('file_pdf', 'in', ids)])
10+ attachments = self.pool.get('ir.attachment.facturae.mx').search(cr, SUPERUSER_ID, ['|',
11+ '|', ( 'file_input', 'in', ids), ('file_xml_sign', 'in', ids), ('file_pdf', 'in',
12+ ids)])
13 if attachments:
14 raise osv.except_osv(_('Warning!'), _(
15 'You can not remove an attachment of an invoice'))