account invoice odoo

Asked by Jose Loureiro on 2015-05-11

Hi.
I have a problem in account_invoice when the state is open i have a button send email.
The button loads the email information but after that gives error that is:

File "/opt/odoo/odoo/addons/email_template/wizard/mail_compose_message.py", line 54, in default_get
    res.get('model'), res.get('res_id'), context=context
  File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/email_template/wizard/mail_compose_message.py", line 103, in onchange_template_id
    values = self.generate_email_for_composer_batch(cr, uid, template_id, [res_id], context=context)[res_id]
  File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/email_template/wizard/mail_compose_message.py", line 167, in generate_email_for_composer_batch
    template_values = self.pool.get('email.template').generate_email_batch(cr, uid, template_id, res_ids, fields=fields, context=ctx)
  File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/email_template/email_template.py", line 514, in generate_email_batch
    result, format = self.pool['report'].get_pdf(cr, uid, [res_id], report_service, context=ctx), 'pdf'
  File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/addons/base_report_to_printer/report.py", line 32, in get_pdf
    context=context)
  File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/report/models/report.py", line 193, in get_pdf
    save_in_attachment = self._check_attachment_use(cr, uid, ids, report)
  File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/report/models/report.py", line 340, in _check_attachment_use
    pdf = base64.decodestring(pdf)
  File "/usr/lib/python2.7/base64.py", line 321, in decodestring
    return binascii.a2b_base64(s)
TypeError: must be string or buffer, not None

How can i solve it?
Best regards,
Miguel

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
2015-05-11
Last reply:
2015-05-11
Anand (browseinfo) said : #1

Hello,

I think here you need to validate the code for the values like None.
it finds some value as none and it try to cat it and raise the problem.

On Mon, May 11, 2015 at 3:21 PM, Jose Loureiro <
<email address hidden>> wrote:

> New question #266767 on Odoo Addons:
> https://answers.launchpad.net/openobject-addons/+question/266767
>
> Hi.
> I have a problem in account_invoice when the state is open i have a button
> send email.
> The button loads the email information but after that gives error that is:
>
> File
> "/opt/odoo/odoo/addons/email_template/wizard/mail_compose_message.py", line
> 54, in default_get
> res.get('model'), res.get('res_id'), context=context
> File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
> return old_api(self, *args, **kwargs)
> File
> "/opt/odoo/odoo/addons/email_template/wizard/mail_compose_message.py", line
> 103, in onchange_template_id
> values = self.generate_email_for_composer_batch(cr, uid, template_id,
> [res_id], context=context)[res_id]
> File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
> return old_api(self, *args, **kwargs)
> File
> "/opt/odoo/odoo/addons/email_template/wizard/mail_compose_message.py", line
> 167, in generate_email_for_composer_batch
> template_values =
> self.pool.get('email.template').generate_email_batch(cr, uid, template_id,
> res_ids, fields=fields, context=ctx)
> File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
> return old_api(self, *args, **kwargs)
> File "/opt/odoo/odoo/addons/email_template/email_template.py", line 514,
> in generate_email_batch
> result, format = self.pool['report'].get_pdf(cr, uid, [res_id],
> report_service, context=ctx), 'pdf'
> File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
> return old_api(self, *args, **kwargs)
> File "/opt/odoo/addons/base_report_to_printer/report.py", line 32, in
> get_pdf
> context=context)
> File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
> return old_api(self, *args, **kwargs)
> File "/opt/odoo/odoo/addons/report/models/report.py", line 193, in
> get_pdf
> save_in_attachment = self._check_attachment_use(cr, uid, ids, report)
> File "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper
> return old_api(self, *args, **kwargs)
> File "/opt/odoo/odoo/addons/report/models/report.py", line 340, in
> _check_attachment_use
> pdf = base64.decodestring(pdf)
> File "/usr/lib/python2.7/base64.py", line 321, in decodestring
> return binascii.a2b_base64(s)
> TypeError: must be string or buffer, not None
>
> How can i solve it?
> Best regards,
> Miguel
>
> --
> You received this question notification because you are a member of
> OpenERP Committers, which is an answer contact for Odoo Addons.
>

--

*Thanks,Anand Patel+91 9601663735*

Can you help with this problem?

Provide an answer of your own, or ask Jose Loureiro for more information if necessary.

To post a message you must log in.