Odoo Help

0

Odoo 8: Manage Exception in website

By
Claudio Ponziani
on 9/5/16, 9:34 AM 568 views

I have defined a constraint on model "sale.order". On the backend, I raise a warning (exceptions.Warning) message when a condition is not satisfied: there it works fine. The problem come on the website: when the warning's condition is not satisfied odoo raise the classical 500 page error. How can I manage this error through show an alert window or a message for the user in a pretty way? I suppose I can re-define the structure of 500 page error, but I want to manage this error like other classical error(field required, ....). Thanks

0
Annadurai
On 4/27/17, 6:45 AM

Checkout Website_payment module controller. or in login


Sample code: 

pass the error msg in controller

{

                    'error': {},

                    'error_message': [],

                    'return_url': return_url,

                    'json': False,

                    'bootstrap_formatting': True

                }


and in XML template

        <xpath expr="//div[@class='clearfix']"

            position="before">

            <div>

                <p class="alert alert-danger" t-if="error">

                    <t t-esc="error"/>

                </p>

            </div>

        </xpath>

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 9/5/16, 9:34 AM
Seen: 568 times
Last updated: 4/27/17, 6:45 AM