Skip to content

Commit

Permalink
Merge pull request #10 from odoo-brazil/8.0
Browse files Browse the repository at this point in the history
Correções de email de odoo-brazil
  • Loading branch information
danimaribeiro committed Feb 12, 2016
2 parents b79e196 + aa79e40 commit dcc5776
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion nfe/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

{
'name': 'NFE',
'version': '0.1',
'version': '8.0.1.0.0',
'category': 'Generic Modules',
'description': """Implementa a exportação de notas fiscais através de
arquivos XML""",
Expand Down
2 changes: 1 addition & 1 deletion nfe_attach/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

{
'name': 'NFE XML',
'version': '0.1',
'version': '8.0.1.0.0',
'category': 'Generic Modules',
'description': """Salva o danfe e xml em anexo a fatura e permite o
envio dos documentos anexados para o email do cliente""",
Expand Down
15 changes: 9 additions & 6 deletions nfe_attach/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def attach_file_event(self, cr, uid, ids, seq, att_type, ext, context):
obj_attachment.create(cr, uid, {
'name': str_aux.format(key),
'datas': base64.b64encode(attc),
'datas_fname': '.' + ext,
'datas_fname': str_aux.format(key),
'description': '' or _('No Description'),
'res_model': 'l10n_br_account.invoice.invalid.number',
'res_id': obj.id
Expand Down Expand Up @@ -127,7 +127,7 @@ def attach_file_event(self, cr, uid, ids, seq, att_type, ext, context):
obj_attachment.create(cr, uid, {
'name': str_aux.format(nfe_key),
'datas': base64.b64encode(attc),
'datas_fname': '.' + ext,
'datas_fname': str_aux.format(nfe_key),
'description': '' or _('No Description'),
'res_model': 'account.invoice',
'res_id': inv.id
Expand Down Expand Up @@ -190,18 +190,21 @@ def action_invoice_sent(self, cr, uid, ids, context=None):
class email_template(osv.Model):
_inherit = 'email.template'

def generate_email(self, cr, uid, template_id, res_id, context=None):
def generate_email_batch(self, cr, uid, template_id, res_id,
context=None, fields=None):
context = context or {}
values = super(
email_template,
self).generate_email(
self).generate_email_batch(
cr,
uid,
template_id,
res_id,
context)
context,
fields,
)
if context.get('default_model') == 'account.invoice':
values['attachment_ids'] = context.get('attachment_ids')
values[res_id[0]]['attachment_ids'] = context.get('attachment_ids')
return values


Expand Down
2 changes: 1 addition & 1 deletion nfe_mde/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

{
'name': 'Manifesto Destinatário NFe',
'version': '0.1',
'version': '8.0.1.0.0',
'category': 'NFE',
'description': """Implementa a consulta de nfe periodicamente no SEFAZ""",
'author': 'Danimar Ribeiro',
Expand Down

0 comments on commit dcc5776

Please sign in to comment.