Form 视图
Form 结构
1、header 用来存放button
<header>
<button type="object" name="open_commercial_entity"
string="Open commercial partner"class="btn-primary" />
</header>
2、sheet
表单元素被呈现为样式化的表单,最重要的字段应该是用户在查看表单时首先看到的内容。
2.1 div button_box
<div class="oe_button_box" name="button_box">
<button type="object" class="oe_stat_button"
icon="fa-pencil-square-o"name="action_view_partner_invoices">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="total_invoiced"/>
</span>
<span class="o_stat_text">Invoiced</span>
</div>
</button>
</div>
2.2 label h1 h2 h3
<div class="oe_left oe_title">
<label for="name" />
<h1><field name="name" /></h1>
</div>
2.3 group 属性col=‘2’,一个字段默认占据2列
<group col="6">
<field name="category_id" widget="many2many_tags" />
<field name="email"/>
<field name="mobile"/>
</group>
2.4 notebook page
<notebook groups="base.group_no_one">
<page string="Registration Mails">
<field name="mail_registration_ids">
<tree string="Registration mail" editable="bottom">
<field name="registration_id"/>
<field name="scheduled_date"/>
<field name="mail_sent"/>
</tree>
</field>
</page>
</notebook>
3、chatter 聊天插件
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>