Odoo Help

Welcome!

This community 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.

0

Refreshing one2many after file upload

By
Odooveloper (by Rui Franco)
on 11/4/16, 2:54 AM 96 views

Cheers!


I've created a One2many field to connect a product to its attachments and show them inside the product form.


image_ids = fields.One2many('ir.attachment', 'product_tmpl_id', string='Files')


However, the form field does not get refreshed when the attachments are saved. I can see attachments in the drop down list but, unless I reload the whole page, I won't be able to see them in the form.


I've tried a few combinations, namely the way the one2many is created but nothing worked so, I guess I'm stuck with JavaScript which, unfortunately, I do not... ehem... understand that much.


Does anyone know how could the Javascript (if possible at all), affect the One2many field so that attaching a file would also refresh the form?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/4/16, 2:54 AM
Seen: 96 times
Last updated: 11/4/16, 2:54 AM