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
=== modified file 'hr_timesheet/hr_timesheet.py'
--- hr_timesheet/hr_timesheet.py 2012-02-14 12:25:20 +0000
+++ hr_timesheet/hr_timesheet.py 2012-11-21 10:20:23 +0000
@@ -74,9 +74,7 @@
74 toremove = {}74 toremove = {}
75 for obj in self.browse(cr, uid, ids, context=context):75 for obj in self.browse(cr, uid, ids, context=context):
76 toremove[obj.line_id.id] = True76 toremove[obj.line_id.id] = True
77 self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)77 return self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)
78 return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context)
79
8078
81 def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None):79 def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None):
82 res = {'value':{}}80 res = {'value':{}}
8381
=== modified file 'hr_timesheet/security/ir.model.access.csv'
--- hr_timesheet/security/ir.model.access.csv 2011-12-19 16:54:40 +0000
+++ hr_timesheet/security/ir.model.access.csv 2012-11-21 10:20:23 +0000
@@ -1,14 +1,14 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2access_hr_analytic_timesheet,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_hr_user,1,1,1,12access_hr_analytic_timesheet,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_hr_user,1,1,1,1
3access_hr_analytic_timesheet_employee,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_user,1,1,1,03access_hr_analytic_timesheet_employee,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_user,1,1,1,1
4access_hr_account_analytic_line,account.account.analytic.line,account.model_account_analytic_line,base.group_hr_user,1,1,1,14access_hr_account_analytic_line,account.account.analytic.line,account.model_account_analytic_line,base.group_hr_user,1,1,1,1
5access_hr_account_analytic_line_employee,account.account.analytic.line employee,account.model_account_analytic_line,base.group_user,1,1,1,05access_hr_account_analytic_line_employee,account.account.analytic.line employee,account.model_account_analytic_line,base.group_user,1,1,1,1
6access_account_analytic_journal,account.account.analytic.journal,account.model_account_analytic_journal,base.group_hr_user,1,1,1,16access_account_analytic_journal,account.account.analytic.journal,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1
7access_product_product_user,product.product user,product.model_product_product,base.group_hr_user,1,1,1,17access_product_product_user,product.product user,product.model_product_product,base.group_hr_user,1,1,1,1
8access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,18access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,1
9access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,19access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,1
10access_account_fiscalyear_hr_user,account.account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,110access_account_fiscalyear_hr_user,account.account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,1
11hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,011hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,0
12hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,012hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,0
13access_hr_analytic_timesheet_user,hr.analytic.timesheet.user,model_hr_analytic_timesheet,base.group_user,1,1,1,013access_hr_analytic_timesheet_user,hr.analytic.timesheet.user,model_hr_analytic_timesheet,base.group_user,1,1,1,0
14access_account_analytic_journal_user,account.account.analytic.journal.user,account.model_account_analytic_journal,base.group_user,1,0,0,014access_account_analytic_journal_user,account.account.analytic.journal.user,account.model_account_analytic_journal,base.group_user,1,0,0,0