Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
10253 Lượt xem

hi, in my view their is an image field. so i copied it form res.partneras like below.

 <field name="image" widget='image' class="oe_left oe_avatar" options='{"preview_image": "image_medium", "size": [90, 90]}'/>

it generates an error.

but when i am using the code with no class as like below

 <field name="image" widget='image' options='{"preview_image": "image_medium", "size": [90, 90]}'/>

it will not generates any error. what is the difference and how to include that class to may view?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

use only this ...... <field name="image" widget="image" class="oe_left oe_avatar"/>

Let me know if it help ....

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

It will not generate any error because tag class allows you to set the position and other data on the image field. For example if you set oe_right it's going to appear on the right side. It depends on containers and other data to work.

Everything is set by the css files, it's not going to affect the funcionality it's just helping you to have a nice form view.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Make sure the version is 7.0, just like this: <form string="Employee" version="7.0"> <sheet> <field name="image_medium" widget="image" class="oe_left oe_avatar"/>

Ảnh đại diện
Huỷ bỏ