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

ODOO : How to use a field as an attribute to another field

By
Ashwin Mahajan
on 11/24/16, 4:17 AM 115 views

Hi,

I am trying to display an image in the xml. I have file path and name as individual fields but I want to use them as the src attribute of the image tag. I have used the following code to display image but it only works when we create a new record and not after saving it.

<field name="file" filename="file_name" attrs="{'readonly':[('state', '!=', 'new')]}" />

<field name="file_name" invisible="1"/>


So, is there a way to point an attribute to another field? Or how can I make the above code work?

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/24/16, 4:17 AM
Seen: 115 times
Last updated: 11/24/16, 4:59 AM