← Back to team overview

savoirfairelinux-openerp team mailing list archive

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

 

Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade into lp:openerp-hr.

Requested reviews:
  Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903)
Related bugs:
  Bug #1253781 in OpenERP - Human Resources: "The column parent_id on object hr.department must be set as ondelete='cascade' or 'restrict'"
  https://bugs.launchpad.net/openerp-hr/+bug/1253781

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 Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade.
=== 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),
     }


Follow ups