[FIX] sale_timesheet: Sales user not allowed to create invoice linked to timesheets
Steps to reproduce: - Create a service product P with invoicing policy = Timesheets on tasks, Service Tracking = Create a task in a new project and Re-Invoice Policy = No. - Create a SO with P and confirm it - Go to the task created for the SO and assign an employee on it. - Valide the related analytic line in the timesheet module - Create a user U with the following rights: Sales: 'User: all documents', Project: 'Manager' and no right in Employee. - Log as U and try to invoice the SO Bug: An access rights error was raised opw:2044659 closes odoo/odoo#35656 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
@@ -61,7 +61,7 @@ class AccountInvoiceLine(models.Model):
|
||||
sale_line_delivery = invoice_line.sale_line_ids.filtered(lambda sol: sol.product_id.invoice_policy == 'delivery' and sol.product_id.service_type == 'timesheet')
|
||||
if sale_line_delivery:
|
||||
domain = self._timesheet_domain_get_invoiced_lines(sale_line_delivery)
|
||||
timesheets = self.env['account.analytic.line'].search(domain)
|
||||
timesheets = self.env['account.analytic.line'].search(domain).sudo()
|
||||
timesheets.write({
|
||||
'timesheet_invoice_id': invoice_line.invoice_id.id,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user