【问题标题】:grouping two field record into one label on tree view OpenERP 7在树视图 OpenERP 7 上将两个字段记录分组为一个标签
【发布时间】:2016-09-23 08:57:48
【问题描述】:

openerp 可以在树视图上创建一列有两个标题标签或一列有两个记录字段,或者从一些记录字段中创建组列。

这是在树视图上将两个字段记录分组到一个标签的示例。

http://s22.postimg.org/jxql4ylr5/colspan.jpg

任何评论和帮助将不胜感激。

谢谢。

【问题讨论】:

  • 恐怕你不能在OpenERP框架中做到这一点。但是如果你愿意,你可以覆盖创建表格的小部件(我认为这不值得)
  • 感谢 ChesuCR 的回复,是的,我想是的。有人对这个问题有好的解决方案吗?

标签: treeview multiple-columns openerp-7


【解决方案1】:

我有一个解决方案如下:

XML 代码:

<group col="6" colspan="6" string="Tổng quan nhân lực toàn viện">
    <div>
        <table class="tbl_fake_header tbl_nhan_luc_kham_chua_benh">
            <thead>
                <tr>
                    <th class="hr_department" rowspan="2">Phòng\khoa</th>
                    <th class="tong_so_can_bo" rowspan="2">Tổng số cán bộ</th>
                    <th colspan="4">Chức danh</th>
                </tr>
                <tr>
                    <th class="bs">BS</th>
                    <th class="dd">ĐD</th>
                    <th class="nhs_ys_ktv">NHS,YS,KTV</th>
                    <th class="hl_ks_khac">HL,KS,Khác</th>
                </tr>
            </thead>
        </table>
        <field name="tong_quan_nhan_luc" string="Tổng quan nhân lực toàn việc">
            <tree editable="bottom" version="7.0" class="tong_quan_nhan_luc">
                <field name="hr_department"/>
                <field name="tong_so_can_bo"/>
                <field name="bs"/>
                <field name="dd"/>
                <field name="nhs_ys_ktv"/>
                <field name="hl_ks_khac"/>
            </tree>
        </field>
    </div>
</group>

CSS 代码:

/* FAKE HEADER
==================
*/
.tbl_fake_header{
    float: left;
    width: 100%;
    padding-right: 10px;
    z-index: 1;
    position: relative;
    border: none;
    margin-bottom: -25px;
}

.tbl_fake_header thead {
  border: none !important;
}
.tbl_fake_header thead  tr th{
  text-align: center !important;
  min-height: 24px;
  padding-top: 5px;
  padding-bottom: 5px;
  border: 1px solid #dfdfdf;
}


/*tong_quan_nhan_luc
===========================
*/
.tong_quan_nhan_luc{
  margin-top: -12px;
}
.tong_quan_nhan_luc [data-id="hr_department"],
.tbl_nhan_luc_kham_chua_benh thead tr th.hr_department{
    width: 24% !important;
}

.tong_quan_nhan_luc [data-id="tong_so_can_bo"],
.tbl_nhan_luc_kham_chua_benh thead tr th.tong_so_can_bo{
    width: 15% !important;
}

.tong_quan_nhan_luc [data-id="bs"],
.tbl_nhan_luc_kham_chua_benh thead tr th.bs{
    width: 13% !important;
}

.tong_quan_nhan_luc [data-id="dd"],
.tbl_nhan_luc_kham_chua_benh thead tr th.dd{
    width: 13% !important;
}

.tong_quan_nhan_luc [data-id="nhs_ys_ktv"],
.tbl_nhan_luc_kham_chua_benh thead tr th.nhs_ys_ktv{
    width: 18% !important;
}

.tong_quan_nhan_luc [data-id="hl_ks_khac"],
.tbl_nhan_luc_kham_chua_benh thead tr th.hl_ks_khac{
    width: 17% !important;
}

.tong_quan_nhan_luc thead{
  background: none !important;
}
.tong_quan_nhan_luc thead th{
    font-size: 0px !important;
    z-index: 0;
    border: none;
    height: 0px;
}

结果:

enter image description here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-29
    相关资源
    最近更新 更多