Mobile app JavaScript
Odoo v10 introduced the Odoo mobile application. It provides a few small utilities to perform mobile actions, such as vibrating the phone, showing a toast message, and scanning QR codes.
Getting ready
We will be using the my_hostel
module from the previous recipe. We will show you the toast when we change the value of the color field from the mobile app.
Warning
The Odoo mobile app only supports the Enterprise Edition, so if you don’t have the Enterprise Edition, then you cannot test it.
How to do it…
Follow these steps to show a toast message in the Odoo mobile app:
import mobile from "@web_mobile/js/services/core"; clickPill(value) { if (mobile.methods.showToast) { mobile.methods.showToast({ 'message': 'Color changed' }); } this.props.record.update({ [this.props.name]: value }); ...