Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 171 |
Technical Name |
mn_audio_field_widget |
License | OPL-1 |
Website | https://www.linkedin.com/in/alazaly |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 171 |
Technical Name |
mn_audio_field_widget |
License | OPL-1 |
Website | https://www.linkedin.com/in/alazaly |
Audio Field Widget User Guide
This module supports both the Odoo Community and Enterprise versions.
Step 1: Install the Module
First, install the custom audio field widget module. Navigate to the Apps menu, search for the module, and click on the 'Install' button as shown below:

Step 2: Create a Binary Field
Next, create a binary field in the model where you want to use the audio widget. You can do this by adding a field definition in your model file. The field should look like this:
class YourModel(models.Model):
_name = 'your.model'
_description = 'Your Model'
name = fields.Char(string="Name")
audio_file = fields.Binary(string="Audio File")

Step 3: Add the Widget in Code
Now, add the custom audio widget to the field in your view file. This should be done in the XML file defining the view. Here’s how you can do it:
<record id="view_your_model_form" model="ir.ui.view">
<field name="name">your.model.form</field>
<field name="model">your.model</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
<field name="audio_file" widget="audio_field"/>
</group>
</sheet>
</form>
</record>

Step 4: Final UI Result
After following the previous steps, the final UI result should look like this. You will see an audio player in the form view where you can upload and play audio files:

Contact Information
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module