在OpenERP上删除有关模块升级的记录

yuc*_*cer 1 openerp

我有一个应用程序模块,该模块在以前的模块发行版中已加载了用于使用自定义数据进行数据库初始化的员工:

<?xml version="1.0"?>
<openerp>
    <data>
        ....
        <!-- John Smith -->
        <record id="emp_john_smith" model="hr.employee">
            <field name="name">John Smith</field>
            <field name="company_id" ref="base.main_company"/>
            <field name="department_id" ref="dp_production"/>
            <field name="job_id" ref="jb_production_officer"/>
            <field name="work_email">john@company.com</field>
            <field name="begin_date">2012-01-01</field>
            <field name="gender">male</field>
            <field name="work_location">Madrid</field>
            <field name="lang">es_ES</field>            
        </record>
    ....
    <record id="ctr_john_smith_hr" model="hr.contract">
        <field name="name">John Smith Production Contract</field>
        <field name="employee_id" ref="emp_john_smith"/>
        <field name="job_id" ref="jb_production_officer"/>
        <field name="email">john@company.com</field>
        <field name="date_start">2012-01-01</field>
        <field name="wage">0</field>
        <field name="percent_working_hours">15</field>
        <field name="working_hours" ref="spain_calendar"/>
    </record>
    </data>
</openerp>
Run Code Online (Sandbox Code Playgroud)

但是这些记录必须在该模块的下一个发行版中删除。我应该在下一个发行版的XML数据文件上使用哪个记录元素来擦除这些记录?

Oma*_*maL 6

您可以在xml中使用delete标记。不要删除在xml文件中创建的xml数据记录。在新版本中,只需在文件末尾添加delete标记即可。

<delete id="module_name.xml_record_id" model="hr.employee"/>
Run Code Online (Sandbox Code Playgroud)

或者您可以像Yucer所说的那样使用功能标签