Merge lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_ir_attachment_facturae-add_button_forward_email-dev_carlos into lp:openerp-mexico-localization/7.0

Proposed by Juan Carlos Hernandez
Status: Merged
Merged at revision: 313
Proposed branch: lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_ir_attachment_facturae-add_button_forward_email-dev_carlos
Merge into: lp:openerp-mexico-localization/7.0
Diff against target: 64 lines (+24/-5)
2 files modified
l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py (+23/-5)
l10n_mx_ir_attachment_facturae/ir_attachment_facturae_view.xml (+1/-0)
To merge this branch: bzr merge lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_ir_attachment_facturae-add_button_forward_email-dev_carlos
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Isaac López Zúñiga Pending
OpenERP Mexico Maintainer Pending
Review via email: mp+189987@code.launchpad.net

Description of the change

se agrego botón para reenviar el adjunto por correo otra vez

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

Levanta un runbot con este branch, por favor.

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-10-08 21:32:07 +0000
3+++ l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-10-08 23:06:28 +0000
4@@ -385,6 +385,11 @@
5 else:
6 msj = _('Email Send Successfully.Attached is sent to %s for Outgoing Mail Server %s') % (
7 partner_mail, server_name)
8+ self.write(cr, uid, ids, {
9+ 'msj': msj,
10+ 'last_date': time.strftime('%Y-%m-%d %H:%M:%S')})
11+ wf_service.trg_validate( uid, self._name, ids[0], 'action_send_customer', cr)
12+ return True
13 else:
14 raise osv.except_osv(
15 _('Warning'), _('This user does not have mail'))
16@@ -397,11 +402,6 @@
17 else:
18 raise osv.except_osv(_('Warning'), _('Not Found\
19 outgoing mail server.Configure the outgoing mail server named "FacturaE"'))
20- self.write(
21- cr, uid, ids, {'msj': msj, 'last_date': time.strftime('%Y-%m-%d %H:%M:%S')})
22- wf_service.trg_validate(
23- uid, self._name, ids[0], 'action_send_customer', cr)
24- return True
25 except Exception, e:
26 error = tools.ustr( traceback.format_exc() )
27 self.write(cr, uid, ids, {'msj': error}, context=context)
28@@ -524,6 +524,24 @@
29 wf_service.trg_create(uid, self._name, row, cr)
30 return True
31
32+ def forward_email(self, cr, uid, ids, context=None):
33+ if context is None:
34+ context = {}
35+ ids = isinstance(ids, (int, long)) and [ids] or ids
36+ try:
37+ self.signal_send_customer(cr, uid, ids, context=context)
38+ msj = _('Forward Email')
39+ self.write(cr, uid, ids, {'msj': msj,
40+ 'last_date': time.strftime('%Y-%m-%d %H:%M:%S')
41+ }, context=context)
42+ status_forward = True
43+ except Exception, e:
44+ error = tools.ustr( traceback.format_exc() )
45+ self.write(cr, uid, ids, {'msj': error}, context=context)
46+ _logger.error( error )
47+ status_forward = False
48+ return status_forward
49+
50
51 class ir_attachment(osv.Model):
52 _inherit = 'ir.attachment'
53
54=== modified file 'l10n_mx_ir_attachment_facturae/ir_attachment_facturae_view.xml'
55--- l10n_mx_ir_attachment_facturae/ir_attachment_facturae_view.xml 2013-09-25 02:14:46 +0000
56+++ l10n_mx_ir_attachment_facturae/ir_attachment_facturae_view.xml 2013-10-08 23:06:28 +0000
57@@ -31,6 +31,7 @@
58 <button name="signal_done" states="sent_backup" string="Done" type="object" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
59 <button name="signal_cancel" states="draft,confirmed,signed,printable,sent_backup,sent_customer,done" string="Cancel" type="object" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
60 <button name="reset_to_draft" states="cancel" string="Reset to Draft" type="object" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_manager"/>
61+ <button name="forward_email" states="sent_customer,sent_backup,done" string="Forward Email" type="object" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
62 <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,signed,printable,sent_customer,sent_backup,done,cancel" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'/>
63 </header>
64 <sheet string="Attachment Factura-E">