Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
8024 Представления

I have res_partner field with Many2one relation in my view. I want to show images for the partners in form view.

<field name="partner_ids"  />

Аватар
Отменить
Лучший ответ

you need to declare the following field in the model :
image_id = fields.Image(related='partner_ids.image_1920')
then in the view :


Аватар
Отменить
Лучший ответ

hello,

Your question is not clear, if you want to access partner image in another model with many2one relation to res.partner you can use a related field for it

partner_ids = fields.Many2one('res.partner')

partner_image = fields.binary(related='partner_ids.image_field_name')

<field name="partner_ids" />
<field name="partner_image" widget="image" class="oe_avatar"/>

Аватар
Отменить
Автор Лучший ответ

Thanks for the answer. Your suggestion is useful. But the case is little bit different. The “partner_ids” field is Many2one and the “partner_image” is showing only one image. Is there any many2one image widget.

Аватар
Отменить