← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade into lp:openerp-hr

 

You have been requested to review the proposed merge of lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade into lp:openerp-hr.

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-hr/department_parent_cascade/+merge/196199

Fixes Bug #1253781

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'

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

-- 
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-hr/department_parent_cascade/+merge/196199
Your team HR Core Editors is requested to review the proposed merge of lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade into lp:openerp-hr.
=== modified file 'hr_department_sequence/hr_department.py'
--- hr_department_sequence/hr_department.py	2013-09-23 13:55:07 +0000
+++ hr_department_sequence/hr_department.py	2013-11-21 21:57:47 +0000
@@ -29,6 +29,7 @@
     _columns = {
         'code': fields.char('Code', size=64),
         'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of departments."),
+        'parent_id': fields.many2one('hr.department', 'Parent Department', select=True, ondelete='cascade'),
         'parent_left': fields.integer('Left Parent', select=1),
         'parent_right': fields.integer('Right Parent', select=1),
     }