Mobile app JavaScript
Odoo v10 introduced the Odoo mobile application. It provides a few small utilities to perform mobile actions, such as vibrate phone, show toast message, and scan QR code.
Getting ready
We will be using the my_library
module from the previous library. 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...
Perform the following steps to show a toast message in the Odoo mobile app:
- Import
web_mobile.rpc
infield_widget.js
:var mobile = require('web_mobile.core');
- Modify the
clickPill
method to display the toast when the user changes the color from the mobile device:Â Â Â Â clickPill: function (ev) { Â Â Â Â Â Â Â Â var $target = $(ev.currentTarget); Â Â Â Â Â Â &...