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

Status: Merged
Merged at revision: 73
Proposed branch: lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade
Merge into: lp:openerp-hr
Diff against target: 11 lines (+1/-0)
1 file modified
hr_department_sequence/hr_department.py (+1/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openerp-hr/department_parent_cascade
Reviewer Review Type Date Requested Status
Daniel Reis Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve
Review via email: mp+196199@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (code review)
Revision history for this message
Daniel Reis (dreis-pt) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_department_sequence/hr_department.py'
2--- hr_department_sequence/hr_department.py 2013-09-23 13:55:07 +0000
3+++ hr_department_sequence/hr_department.py 2013-11-21 21:57:47 +0000
4@@ -29,6 +29,7 @@
5 _columns = {
6 'code': fields.char('Code', size=64),
7 'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of departments."),
8+ 'parent_id': fields.many2one('hr.department', 'Parent Department', select=True, ondelete='cascade'),
9 'parent_left': fields.integer('Left Parent', select=1),
10 'parent_right': fields.integer('Right Parent', select=1),
11 }