如何在odoo中扩展goup中的以下字段?

时间:2016-06-23 05:57:44

标签: python xml openerp

enter image description here

在上图中,它已分组但无法扩展。

我有以下课程。它可以通过表单正常工作,但是当我按folio_num进行分组时,它会分组,但无法扩展。 folio num实际上是由另一个模块自动填充的。其他分组工作正常。

class data_value(osv.Model):
    _name = "data.value"
    _rec_name = "mega_wat"
    _columns = {
        'company_id1':fields.char('Comapny'),
        'Hours':fields.char('Folio',store=True,),
        'time_read':fields.related('combine', 'date_of1',type="datetime", string="Your Field Name",store=True,),
        'current':fields.float('Current',),
        'mega_wat':fields.float('Mega Watts'),
        'wt':fields.float('Winding Temperature'),
        'ot':fields.float('Oil Temperature'),
        'tp':fields.char('Tap Position'),
        #'Max':fields.char('Maximum'),
        'combine':fields.many2one('feeder.data','details'),
    }

    def _default_company(self, cr, uid, context=None):
        user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
        if user.company_id:
                return user.company_id.id
        return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]

    _defaults = {
        'company_id1': _default_company,
    }

视图定义如下:

<record id="feeder_filter" model="ir.ui.view">
    <field name="name">data.value</field>
    <field name="model">data.value</field>
    <field name="arch" type="xml">
        <search string="Feedback">
            <group expand="0" string="Group By">
                <filter string="Day" icon="terp-personal" domain="[]" context="{'group_by':'time_read:day'}"/>
                <filter string="Week" icon="terp-personal" domain="[]" context="{'group_by':'time_read:week'}"/>
                <filter string="Month" icon="terp-personal" domain="[]" context="{'group_by':'time_read:month'}"/>
                <filter string="Mega Wat" icon="terp-personal" domain="[]" context="{'group_by':'mega_wat'}"/>
                <filter string="Folio Num" icon="terp-personal" domain="[]" context="{'group_by':'Hours'}"/>
                <!--<filter string="Feeder" icon="terp-personal" domain="[]" context="{'group_by':'folio_num1'}"/>
                <filter string="MAX" icon="terp-personal" domain="[]" context="{'group_by':'max_mw'}"/>-->
                <!--<filter string="Folio Number" icon="terp-personal" domain="[]" context="{'group_by':'folio_number'}"/>-->
            </group>
        </search>
    </field>
</record>

0 个答案:

没有答案