Before this commit, negative values in a float field interpreted as time
(i.e. unit_amount on analytic lines) were wrongly formatted
After this commit, not only we correct the hr_timesheet qweb templates
but we also correct the qweb widget to handle the case
OPW 1869986
closes#26024
Courtesy of Juan José Scarafía, ADHOC
The quality of the Spanish (Argentina) translations is very poor.
Remove them all and will start from scratch, translating only when needed.
- Go to Timesheets > Add a Line (grid view)
- The view opened is `view_timesheet_form`
- Add a description with several lines
- Go to Project, and display the timesheet entries.
- Print the report "Timesheet Entries"
The lines in the description are merged into one single line.
Since it is possible to write a description on several lines, the report
should keep the formatting.
opw-1830703
The preprocess method checked if the project_id value
was given to determine if it was a timesheet or a normal
analytic line (since a timesheet is an AAL with project_id).
The problem came in the write, when changing only the project
value, the preprocess use the timesheet case, but since the
employee field was not changed, no value was passed, and it
compute the default one. So changing the project of an existing
timesheet reset the employee to the current one.
To correctly fill timesheet from a list
view, an onchange was missing. Indeed, we
want the task to be in the project of the
timesheet, so adding a domain definitely
help the user selecting the task when
setting project first.
- Set an employee in a department A
- Create some timesheet entries for this employee, validate them
- Change the employee to department B
An error arise:
> You cannot modify an entry in a confirmed timesheet.
The field `department_id` on the `account.analytic.line` is a related on
`user.employee_ids.department_id`. By changing the department on the
employee, it changes the department on the analytic line (= timesheet).
There is no real need of a related field. Actually, it makes more sense
to change the department with the user (e.g. at creation or change of
the user), and then do not change it later on. Indeed, a timesheet entry
that was created when the employee was in department A should remain in
department A even if the employee change of department.
opw-1824913
This commit adds 3 indexes targeting project_task which are not only
useful in regular RW use cases, but help tremendously when deleting
tasks.
In a production scenario, deleting a single task record went from 685ms
to 5ms.
Equivalent queries for an existing database:
CREATE INDEX account_analytic_line_task_id_index ON account_analytic_line(task_id);
CREATE INDEX project_task_parent_id_index ON project_task(parent_id);
CREATE INDEX sale_order_line_task_id_index ON sale_order_line(task_id);