Help

7

Internal server error 500 in eCommerce module with payment method Wire Transfer [Odoo V8]

Hey guys

Today I've installed the eCommerce module on Odoo V8 (Version 9.0 Alpha 1) and set up payment methods.
I've installed these two modules:
- eCommerce
- Paypal Payment Acquirer
 

I go to the website, select a product and go to the cart checkout. I then select the payment method 'Wire Transfer' and click on the 'Pay Now' button.
After clicking on this button I get an error message, 500: Internal Server Error

Error message:
""'sale.order' object has no attribute 'validity_date'" while evaluating
'o.validity_date'" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"

QWeb error message:
Could not evaluate expression "translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"

Traceback:
Traceback (most recent call last):
  File "/home/administrator/odoo/addons/website/models/ir_http.py", line 180, in _handle_exception
    response = super(ir_http, self)._handle_exception(exception)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_http.py", line 104, in _handle_exception
    return request._handle_exception(exception)
  File "/home/administrator/odoo/openerp/http.py", line 558, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_http.py", line 131, in _dispatch
    result = request.dispatch()
  File "/home/administrator/odoo/openerp/http.py", line 570, in dispatch
    r = self._call_function(**self.params)
  File "/home/administrator/odoo/openerp/http.py", line 311, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/administrator/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/administrator/odoo/openerp/http.py", line 308, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/administrator/odoo/openerp/http.py", line 685, in __call__
    return self.method(*args, **kw)
  File "/home/administrator/odoo/openerp/http.py", line 360, in response_wrap
    response = f(*args, **kw)
  File "/home/administrator/odoo/addons/website_sale/controllers/main.py", line 741, in payment_validate
    composer_id = request.registry['mail.compose.message'].create(cr, SUPERUSER_ID, composer_values, context=email_ctx)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/mail/mail_message.py", line 801, in create
    newid = super(mail_message, self).create(cr, uid, values, context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/openerp/api.py", line 297, in old_api
    result = method(recs, *args, **kwargs)
  File "/home/administrator/odoo/openerp/models.py", line 3877, in create
    vals = self._add_missing_default_values(vals)
  File "/home/administrator/odoo/openerp/api.py", line 202, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/administrator/odoo/openerp/api.py", line 429, in new_api
    result = method(self._model, cr, uid, *args, **kwargs)
  File "/home/administrator/odoo/openerp/models.py", line 1808, in _add_missing_default_values
    defaults = self.default_get(cr, uid, list(missing_defaults), context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/email_template/wizard/mail_compose_message.py", line 54, in default_get
    res.get('model'), res.get('res_id'), context=context
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/email_template/wizard/mail_compose_message.py", line 101, in onchange_template_id
    values = self.generate_email_for_composer_batch(cr, uid, template_id, [res_id], context=context)[res_id]
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/email_template/wizard/mail_compose_message.py", line 163, 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 "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/email_template/email_template.py", line 488, in generate_email_batch
    result, format = self.pool['report'].get_pdf(cr, uid, [res_id], report_service, context=ctx), 'pdf'
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/report/models/report.py", line 169, in get_pdf
    html = self.get_html(cr, uid, ids, report_name, data=data, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/report/models/report.py", line 154, in get_html
    return self.render(cr, uid, [], report.report_name, docargs, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/report/models/report.py", line 130, in render
    return view_obj.render(cr, uid, template, values, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/website/models/ir_ui_view.py", line 173, in render
    return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_ui_view.py", line 1075, in render
    return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 247, in render
    return self.render_node(self.get_template(id_or_xml_id, qwebcontext), qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 289, in render_node
    result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 287, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 405, in render_tag_call
    d[0] = self.render_element(element, template_attributes, generated_attributes, d)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 287, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 395, in render_tag_foreach
    ru.append(self.render_element(element, template_attributes, generated_attributes, copy_qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 287, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 351, in render_tag_raw
    inner = self.eval_str(template_attributes["raw"], qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 208, in eval_str
    val = self.eval(expr, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 200, in eval
    raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 197, in eval
    return qwebcontext.safe_eval(expr)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 80, in safe_eval
    return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True)
  File "/home/administrator/odoo/openerp/tools/safe_eval.py", line 312, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/home/administrator/odoo/addons/report/models/report.py", line 113, in translate_doc
    return view_obj.render(cr, uid, template, qcontext, context=ctx)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/addons/website/models/ir_ui_view.py", line 173, in render
    return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_ui_view.py", line 1075, in render
    return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context)
  File "/home/administrator/odoo/openerp/api.py", line 204, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 247, in render
    return self.render_node(self.get_template(id_or_xml_id, qwebcontext), qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 289, in render_node
    result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 287, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 405, in render_tag_call
    d[0] = self.render_element(element, template_attributes, generated_attributes, d)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 289, in render_node
    result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 289, in render_node
    result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 310, in render_element
    g_inner.append(self.render_node(current_node, qwebcontext))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 287, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 399, in render_tag_if
    if self.eval_bool(template_attributes["if"], qwebcontext):
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 231, in eval_bool
    return int(bool(self.eval(expr, qwebcontext)))
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 200, in eval
    raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 197, in eval
    return qwebcontext.safe_eval(expr)
  File "/home/administrator/odoo/openerp/addons/base/ir/ir_qweb.py", line 80, in safe_eval
    return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True)
  File "/home/administrator/odoo/openerp/tools/safe_eval.py", line 312, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
QWebException: ""'sale.order' object has no attribute 'validity_date'" while evaluating
'o.validity_date'" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"


Could anybody tell me what is wrong or how I can fix this please? I can't seem to find a direct solution for this problem.

Yenthe

Avatar
Discard
5 Answers
3
Avatar
George Rodopoulos
Best Answer

I followed your steps using the most recent build on runbot and I can reproduce the error you reported. So, this may be a bug which needs to be fixed in source code level.

Maybe somebody should add an issue and/or a pull request on github following these guidelines.   Version 9.0 Alpha 1 is not stable as it is in 'Alpha' state so it is expected to find some bugs.

1 Comment
Avatar
Discard

I've put up a error report on Github at https://github.com/odoo/odoo/issues/1956 Hopefully somebody will fix this soon, as it is a rather big problem.

2
Avatar
Andy Ng
Best Answer

my Contact Us form submission was working until now... I'm getting a similar 500: Internal Error message...

Avatar
Discard
2
Avatar
Sajad KK
Best Answer

Quick Fix:

sale/views/report_saleorder.xml

Comment or Remove

<div t-if="o.validity_date" class="col-xs-3">
        <strong>Validity Date:</strong>
        <p t-field="o.validity_date"/>
 </div>

and upgrade Sale module. Thats it!

Avatar
Discard
0
Avatar
Nathan Hewett
Best Answer

Hello- I'm having a similar issue, but can't seem to find any documentation on it anywhere. I'm currently running Odoo 11 community edition. I followed the link on the paypal acquirer setup page, and completed the instructions 1-by-1 without any issue. When I go to complete a transaction through my website, everything goes fine until the payment has been processed by paypal and it redirects the shopper back to my page. At this point, depending on settings, I've had 2 outcomes: 1 produces a 500 internal server error and the second is where paypal never actually sends the shopper back to my page, and instead just loads for EVER until it finally times out. Either way, the payment is processed but the user never ends up back at my site, nor are they shown a confirmation page, and their cart isn't emptied at all.

Can anyone point me in the right direction? I've seen countless articles regarding similar issues dating back to 2015 and such, but nothing relevant to Odoo v11. Thank you for the help!

-Nate

Avatar
Discard
0
Avatar
Nicolás Visús
Best Answer

Hi Yenthe, did you solve it? I have the same issue

6 Comments
Avatar
Discard

Hi Nicolás, I haven't fixed this personally as this is rather a programming error, made by a developer. Fixing it myself wouldn't help anybody except myself. I've made a Github bug report here: https://github.com/odoo/odoo/issues/1956 So lets hope somebody fixes this soon!

Avatar
Franz Palfrader
-

Please be sure that wkhtmltopdf is: 1) installed 2) in the right folder /usr/bin

Franz, this has nothing to do with wkhtmltopdf. Secondly I have it installed and under the /usr/bin, which double proves this has nothing to do with this error.

Avatar
Franz Palfrader
-

ant the Payment Acquirers Form Button Template is "transfer_acquirer_button" ?

Avatar
M. Höppner
-

same thing here in oddo 8.0 from the bitnami VM, I can't solve it. Any additional hints?

Avatar
James White
-

I found this thread because I was having the 500 error when a client would try to add a payment method.

I tried following Franz Palfrader's advice (which took seconds to try) and installed wkhtmltopdf. That was all it took to solve the problem; , I was getting 500 errors, installed wkhtmltopdf, hit the BACK button and clicked on "ADD PAYMENT METHOD" again - and now it worked.

I am using Centos7 with Odoo 10e and recall that the install instructions had warned that wkhtmltopdf was going to cause strange problems if not installed. These warnings are true ;-)

Thanks Franz!