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

Hello, so I'm in the chapter 7 of odoo dev, I know how I can show the fields, but the problem is I'm having a difficulty on styling it. 

I tried copying this kind of style.


I'm having difficulty on how can I properly arrange my fields, This is what my form looks like. 



This is my xml file.

https://codeshare.io/RbRopL

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

Hi

Try this code,

<record id="test_model_view_form" model="ir.ui.view" style="color:rgb(56,58,66);background-color:rgb(250,250,250);font-size:11pt;">>
<field name="name">test_model.view.form</field>
<field name="model">test_model</field>
<field name="arch" type="xml">
   <form string="Test">
       <sheet>
           <div class="oe_title">
               <h1 class="d-flex flex-row">
                   <field name="name" placeholder="Name"
                          required="True"
                          style="font-size: min(4vw, 2.6rem);"/>
               </h1>
           </div>
           <group>
               <group>
                   <field name="last_seen"/>
                   <field name="postcode"/>
                   <field name="date_availability"/>
                   <field name="expected_price"/>
                   <field name="selling_price"/>
                   <field name="bedrooms"/>
                   <field name="living_area"/>
               </group>
               <group>
                   <field name="facades"/>
                   <field name="garage"/>
                   <field name="garden"/>
                   <field name="garden_area"/>
                   <field name="garden_orientation"/>
                   <field name="active"/>
                   <field name="state"/>
               </group>
           </group>
           <notebook>
               <page name="description" string="Description">
                   <group>
                       <field name="description"/>
                   </group>
               </page>
           </notebook>
       </sheet>
   </form>
</field>
</record>


Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you, can I ask where can I learn Odoo styling, can I apply normal css style on it?

What's the difference between, sheet, group, notebook and page?

Câu trả lời hay nhất

for grouping fields left and right side you can use separate group tags , you want to group left side and right side.

use notebook page  to add field inside the page (like  description)


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

Hi Emman


In the code you shared please the class.

Please find code in comment. 

In case if you have any query regarding this please reach out to us.

Feel free to contact us for further assistance

Hope this answer helps you.

Thanks & Regards,
Email: odoo@aktivsoftware.com     

Skype: kalpeshmaheshwari

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

Please find code here :-

In the group which you want on the left side add this to your group tag <group class="oe_left">.
And the group you want on the right side add this to your group tag <group class="oe_right">

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 23
9774
1
thg 4 22
4085
0
thg 10 21
2566
4
thg 12 19
6704
3
thg 4 24
10811