Merge lp:~openerp-dev/openobject-addons/6.1-opw-580642-cbi into lp:openobject-addons/6.1

Proposed by Chris Biersbach (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-580642-cbi
Merge into: lp:openobject-addons/6.1
Diff against target: 47 lines (+15/-17)
2 files modified
hr_timesheet/hr_timesheet.py (+1/-3)
hr_timesheet/security/ir.model.access.csv (+14/-14)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-580642-cbi
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+135355@code.launchpad.net

Description of the change

The issue that was encountered: With hr_timesheet_sheet and project installed, employees were not able to delete their own timesheet lines due to an access rule problem.

The reason: A super call in an unlink method tried to delete the record when it was already gone because of a cascading delete.

The fix: I removed the super call, since it is useless. I also included the changes to the access rights from trunk, which would otherwise still prevent employees from deleting their own timesheet lines.

To post a comment you must log in.

Unmerged revisions

7075. By Chris Biersbach (OpenERP)

[FIX] Employees can now delete their own timesheet lines. The access rights are a backport from trunk, the rest removes an unnecessary super call that caused an access rule to incorrectly not pass

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet/hr_timesheet.py'
2--- hr_timesheet/hr_timesheet.py 2012-02-14 12:25:20 +0000
3+++ hr_timesheet/hr_timesheet.py 2012-11-21 10:20:23 +0000
4@@ -74,9 +74,7 @@
5 toremove = {}
6 for obj in self.browse(cr, uid, ids, context=context):
7 toremove[obj.line_id.id] = True
8- self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)
9- return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context)
10-
11+ return self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)
12
13 def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None):
14 res = {'value':{}}
15
16=== modified file 'hr_timesheet/security/ir.model.access.csv'
17--- hr_timesheet/security/ir.model.access.csv 2011-12-19 16:54:40 +0000
18+++ hr_timesheet/security/ir.model.access.csv 2012-11-21 10:20:23 +0000
19@@ -1,14 +1,14 @@
20-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
21-access_hr_analytic_timesheet,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_hr_user,1,1,1,1
22-access_hr_analytic_timesheet_employee,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_user,1,1,1,0
23-access_hr_account_analytic_line,account.account.analytic.line,account.model_account_analytic_line,base.group_hr_user,1,1,1,1
24-access_hr_account_analytic_line_employee,account.account.analytic.line employee,account.model_account_analytic_line,base.group_user,1,1,1,0
25-access_account_analytic_journal,account.account.analytic.journal,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1
26-access_product_product_user,product.product user,product.model_product_product,base.group_hr_user,1,1,1,1
27-access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,1
28-access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,1
29-access_account_fiscalyear_hr_user,account.account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,1
30-hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,0
31-hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,0
32-access_hr_analytic_timesheet_user,hr.analytic.timesheet.user,model_hr_analytic_timesheet,base.group_user,1,1,1,0
33-access_account_analytic_journal_user,account.account.analytic.journal.user,account.model_account_analytic_journal,base.group_user,1,0,0,0
34+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
35+access_hr_analytic_timesheet,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_hr_user,1,1,1,1
36+access_hr_analytic_timesheet_employee,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_user,1,1,1,1
37+access_hr_account_analytic_line,account.account.analytic.line,account.model_account_analytic_line,base.group_hr_user,1,1,1,1
38+access_hr_account_analytic_line_employee,account.account.analytic.line employee,account.model_account_analytic_line,base.group_user,1,1,1,1
39+access_account_analytic_journal,account.account.analytic.journal,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1
40+access_product_product_user,product.product user,product.model_product_product,base.group_hr_user,1,1,1,1
41+access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,1
42+access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,1
43+access_account_fiscalyear_hr_user,account.account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,1
44+hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,0
45+hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,0
46+access_hr_analytic_timesheet_user,hr.analytic.timesheet.user,model_hr_analytic_timesheet,base.group_user,1,1,1,0
47+access_account_analytic_journal_user,account.account.analytic.journal.user,account.model_account_analytic_journal,base.group_user,1,0,0,0