The column parent_id on object hr.department must be set as ondelete='cascade' or 'restrict'

Bug #1253781 reported by Sandy Carter (http://www.savoirfairelinux.com)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP - Human Resources
Fix Released
Undecided
Sandy Carter (http://www.savoirfairelinux.com)

Bug Description

Note: This only happens with hr_department_sequence, error does not appear with hr.

The parent_id field in the hr.department object does not have an on_delete value which causes OpenERP to display the following message when loading records which specify parents through an xml:

ERROR db openerp.osv.orm: The column parent_id on object hr.department must be set as ondelete='cascade' or 'restrict'

Steps to reproduce (Module included as tar.bz2):
 - Create a module which depends on hr_department_sequence
 - To the module, add an hr_data.xml file such as this:

<?xml version = "1.0" encoding="utf-8"?>
<openerp>
  <data noupdate="1">

    <record id="dep_parent" model="hr.department">
      <field name="name">Parent department</field>
    </record>

    <record id="dep_child" model="hr.department">
      <field name="name">Child department</field>
      <field name="parent_id" ref="dep_parent"/>
    </record>

</data>
</openerp>

 - Start OpenERP, installing the module, the message will display

This is not a show stopper: OpenERP will keep running, but it can trigger testing environments.

Related branches

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :
Changed in openerp-hr:
assignee: nobody → Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter)
no longer affects: openerp-travel
Changed in openerp-hr:
status: New → Fix Committed
Changed in openerp-hr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.