OpenERP版本6,我的Timesheet表单在继承后崩溃了

时间:2013-10-25 06:48:27

标签: openerp

在OpenERP第6版中,在我的自定义模块中,我通过继承下面的自定义视图更改了Timesheet表单视图:

<record id="oit_hr_timesheet_sheet_form" model="ir.ui.view">
        <field name="name">oit.hr.timesheet.sheet.form</field>
        <field name="model">hr_timesheet_sheet.sheet</field>
        <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
        <field name="type">form</field>
        <field name="arch" type="xml">
            <data>
                <button name="sign_in" position="replace"/>
                <button name="sign_out" position="replace"/>
                <field name="state_attendance" position="after">
                    <field name="day_attendance"/>
                </field>
                <field name="total_attendance_day" position="replace"/>
                <field name="total_difference_day" position="replace"/>
                <field name="total_timesheet_day" position="replace"/>
                <field name="timesheet_ids" position="after">
                    <field name="day_difference"/>
                <field name="day_timesheet"/>
                </field>
                <page string="By Day" position="replace" />
                <notebook position="inside">
                    <page string="Time balance">
                        <group colspan="4" col="2" width="600">
                            <field name="time_account_balance"/>
                            <field name="working_hour"/>
                            <field name="attendance_hour"/>
                            <separator string="Timesheet numbers until the viewed working period." colspan="4" />
                            <field name="total_time_account_balance"/>
                            <field name="total_working_hour"/>
                            <field name="total_attendance_hour"/>
                        </group>
                    </page>
                  </notebook>
            </data>
        </field>
    </record>

然后人力资源/时间跟踪/我的时间表表格全部崩溃。但是当我进入管理/自定义/用户界面/菜单项时,我选择&#34;我的时间表&#34;菜单项来修复其动作来自&#34; ir.actions.server&#34; to&#34; ir.actions.act_window&#34;然后选择对象&#34; hr_timesheet_sheet.sheet&#34;,然后选择我的视图&#34; oit.hr.timesheet.sheet.form&#34;对于对象的表单视图,选择我的视图&#34; oit.hr.timesheet.sheet.tree.simplified&#34;对象的树视图。

然后我有&#34;我的时间表&#34;表格显示正确。 这是为什么?我认为我的视图代码中有些东西不适用于&#34;我的时间表&#34;菜单和&#34; ir.actions.server&#34;在文件hr_timesheet_sheet / hr_timesheet_sheet_data.xml中定义,在这里我将openerp6代码粘贴到hr_timesheet_sheet_data.xml中:

<record id="ir_actions_server_timsheet_sheet" model="ir.actions.server">
        <field eval="5" name="sequence"/>
        <field eval="&quot;&quot;&quot;code&quot;&quot;&quot;" name="state"/>
        <field eval="&quot;&quot;&quot;ir.actions.server&quot;&quot;&quot;" name="type"/>
        <field name="model_id" ref="model_hr_timesheet_current_open"/>
        <field eval="[(6,0,[])]" name="child_ids"/>
        <field eval="&quot;&quot;&quot;action = self.pool.get('hr.timesheet.current.open').open_timesheet(cr, uid, object.id, context)&quot;&quot;&quot;" name="code"/>
        <field eval="&quot;&quot;&quot;True&quot;&quot;&quot;" name="condition"/>
        <field eval="&quot;&quot;&quot;My Timesheet&quot;&quot;&quot;" name="name"/>
    </record>
    <record id="menu_act_hr_timesheet_sheet_form_my_current" model="ir.ui.menu">
        <field name="name">My Timesheet</field>
        <field eval="1" name="sequence"/>
        <field name="parent_id" ref="hr_attendance.menu_hr_time_tracking"/>
        <field name="icon">STOCK_JUSTIFY_FILL</field>
        <field name="action" ref="ir_actions_server_timsheet_sheet"/>
    </record>

请帮助我提供正确的观看代码或解决方案,以便我不需要更改菜单的信息&#34;我的时间表&#34;升级我的自定义模块后!非常感谢!

0 个答案:

没有答案