83 Commits
Author SHA1 Message Date
sofiagvaladze bf696b054e [FIX] hr_recruitment_survey: correct the rule
The survey.survey_user_input_rule_survey_user_read rule is
override in both hr_appraisal_survey and in hr_recruitment_survey.

The problem arises when both modules are installed. If so, the domain
is taken from the module that is installed the last.

This should not be case, instead domain should be combined.

On top of it, the domain is not corrected when the app is unistalled.
This commit fixes that too

task - 3597033

closes odoo/odoo#163138

X-original-commit: 5d4b5175855041efd6174fe5e35f06ede3b62818
Related: odoo/enterprise#61363
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-25 11:21:53 +00:00
sofiagvaladze c02eb17aae [FIX] hr_recruitment: blacklist providers properly
In https://github.com/odoo/odoo/pull/126065 we introduced
the feature, that blacklists providers.

The issue with it, is that even if we only provide email_from
once we check it's not blacklisted [1], when we call the super method,
email_from is still filled in [2]

In order to correct it, we also delete blacklisted mail from msg_dict

[1] - https://github.com/odoo/odoo/blob/aed0e74462b15085c09d9ab5ff029810f1238aeb/addons/hr_recruitment/models/hr_applicant.py#L615-L616
[2] -https://github.com/odoo/odoo/blob/aed0e74462b15085c09d9ab5ff029810f1238aeb/addons/mail/models/mail_thread.py#L1388-L1390

task-3793345

closes odoo/odoo#157107

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-03-22 13:02:00 +00:00
sofiagvaladze 9b851eabe7 [FIX] hr_expense: fix action
In odoo/odoo#93802 some filters (including submitted) were removed from
hr.expense.sheet view in favor of the side panel.

Meanwhile, action_hr_expense_sheet_department_to_approve
was not adjusted and was still using the removed filter.

This commit changes the action to also use panel view.

task - 3578235

closes odoo/odoo#157109

X-original-commit: 664442e75787b9c61dcfbeea56c2bab071c2fa7a
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-03-08 21:21:59 +00:00
sofiagvaladze 743e59d666 [FIX] hr_gamification: allow granting badges to user without employee
When hr_gamification is installed, it's not possible to grant badges to
users that don't have associated employees.

Expected behavior: we should be able to grant badges to any users.

This is because user_id was related field with employee_id.
We remove that dependency.

task - 3593382

closes odoo/odoo#155007

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-02-27 09:35:45 +00:00
sofiagvaladze 8c2be69b84 [FIX] hr_applicant: keep refused mails in batch
When HR refuses applicants in batch and sends mails,
the mails are removed, because auto_delete_keep_log
is set to false.
It gives to HR wrong understanding that mails have
not been send.

Expected behavior;
	Don't remove refused mails, when sent in batch

closes odoo/odoo#154720

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-02-20 14:57:32 +00:00
sofiagvaladze 9b33797811 [FIX] hr_holidays: fix public holidays collision
In demo/data some places public holidays are fixed, and at
some places they are "moving" like - datetime.today() + relativedelta(days=+x)).

 On 06-01-2024 the following error occurred -
Two public holidays cannot overlap each other for the same working hours

This happened because the Indian public holiday - Makar Sakranti -
 is set on %Y-01-14 [1]

And the company is not set on it straight away. It is set in demo [2]

That leave overlapped with -Public Time Off [3] which is set as datetime.today() + relativedelta(days=+8)).
The public Time off, when server runs 06-01-2024, makes 14-01-2024.

As we can't set two public holidays on the same day, we got an error.

Note that this issue can be fixed in two ways:
 - either move Indian public holidays in demo data and assign company
   on creation,
 - or fix date_from of generic public holidays.

For now, we choose to fix generic public holidays, as it's demo data and
less important.

[1] https://github.com/odoo/enterprise/blob/fcc15c438a2bdb22f4dc7bcd33bbe78ce4f83246/l10n_in_hr_payroll/data/resource_calendar_leaves_data.xml#L23-L29
[2] https://github.com/odoo/enterprise/blob/fcc15c438a2bdb22f4dc7bcd33bbe78ce4f83246/l10n_in_hr_payroll/demo/l10n_in_hr_payroll_demo.xml#L13-L15
[3] https://github.com/odoo/odoo/blob/762b087aeeaea6e9bbea98795294503f21856ae2/addons/hr_holidays/data/hr_holidays_demo.xml#L451-L457

closes odoo/odoo#148424

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-01-10 05:04:40 +00:00
sofiagvaladze 5faa73427f [FIX] hr_holidays: fix activity creation for second approval
Prior, if the time off type needed second approval, there was no activity generated for the responsible.

This commit fixes that. Moreover we also organize the code by taking
references out of the loop.

task - 3584190

closes odoo/odoo#142327

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-12-28 09:40:09 +00:00
sofiagvaladze f2516a2e73 [FIX] hr_holidays: allow message _subscribe to work in batch
In case more that one leave record in passed to message _subscribe
in will throw "Expected singleton" ValueError.

This commit fixed the issue.

Part-of: odoo/odoo#142327
2023-12-28 09:40:08 +00:00
sofiagvaladze 755a3aae1b [FIX] resource: do not update attendance_ids when there is no company
On the 'resource.calendar', attendance_ids is a computed field and
computation is triggered when company_id is changed.

Now, if we remove company_id, attendance_ids are left empty.
Instead, attendance_ids should be updated only when there is a new company set.

task - 3451264

closes odoo/odoo#141433

X-original-commit: af3bff0c578fdbd47a3584cf9e25f3e558cdefc0
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-11-08 04:09:45 +00:00
sofiagvaladze 61d24eb270 [FIX] hr_skills: add text in openSkillsReport link for clarity
Prior, there was only icon and it was not clear enough.

closes odoo/odoo#141132

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-11-06 13:58:45 +00:00
sofiagvaladze 20d87404db [FIX] hr_holidays: align buttons on time off popup
Correct the view. Prior to this commit the buttons on the time off
popup are not alligned.

closes odoo/odoo#140284

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-10-30 16:41:49 +00:00
sofiagvaladze 65c9ed39b2 [FIX] hr_holidays: remove archived active_test=False on employee field
In odoo/odoo#135245 we added context={'active_test': False}
on the all_employee_ids on hr.leave model.

While it might have sounded like a good idea on the first glance
(we see the avatar of the archived employees), it will potentially
cause more side effects than bring good.

For example, for the employees that left the company and came back,
if might cause issues when we are trying to create time off for them.
It also introduced noise in the views.

Here we alter this change.

closes odoo/odoo#138686

X-original-commit: 9c09272f28aac4e66e3343a0e397540e222336fb
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-10-17 08:53:07 +00:00
sofiagvaladze 0525c5b847 [FIX] hr_skills_survey: UX changes
Prior to this commit the required employee field was hidden
on hr.resume.line form view. Which lead to validation error.

Moreover, on the same form view, on create the survey_id field was not
certification by default. The survey_id field has the
domain [('certification', '=', True)] on this view and this caused
inconsistency. The survey that we created from this form, was
not listed as one of the options.

After this commit the employee_id field is shown on hr.resume.line
form view and the survey_id, created from this view, will be
certification by default.

task-3522917

closes odoo/odoo#136751

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-10-11 17:01:59 +00:00
sofiagvaladze 3b3eb8f4db [IMP] hr_holidays: UX changes to increase usability
In this commit, next to UX changes, we make some changes in order to
increase time off dashboard usability.
In particular, - New Allocation Request - was moved to Time Off Card.
Now user can also ask for specific time off type allocation from
the time-off-card-popover.

Moreover, we fix the following issue:
Previously allocation name was not computed on create. We also fix the
computation of the name, in case time of type is not filled in yet.

With the later change, test_allocation_request test was failing as
first the name field was assigned, then holiday_status_id;
Which caused for the name field to be recomputed and assigned to False.
As the field is required, leave_form.save() was raising an error.

task - 3389144

closes odoo/odoo#132187

Related: odoo/enterprise#47651
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-21 16:52:07 +00:00
sofiagvaladze 597c9fd854 [IMP] hr_recruitment: sanitize applicant's phone/mobile and normalize email
In order to have faster and more reliable search for similar applicants,
1 - we add normalized email and sanitized phone and mobile fields on hr.applicant.
2 - we use those fields for a search of similar applicants.

task - 3282883

closes odoo/odoo#120521

Related: odoo/upgrade#4977
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-15 12:15:12 +00:00
sofiagvaladze 7e20111e48 [FIX] hr_homeworking: show location correctly
current behavior:
If you have a weekly location defined on the employee,
and a exeptional, location for that day defined on the Calendar,
the presnece icon shows weekly and not the exceptional.

Expected behavior:
Presence icon should be based on the exceptional location,
and if there are none, take the weekly one.

task-3482527

closes odoo/odoo#135191

X-original-commit: cbb4d588e3a1dd1f89f19ac3a413bd531f8a5729
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-13 04:37:01 +00:00
sofiagvaladze 4a80e6e922 [IMP] hr: refine simple user form view
When we go to the simple user view, no need to show "Create Employee"
option unless we are inviting a new user. Also, to standardize the
behavior, we remove the context that conditionally used to hide the option.

Moreover, we add smartbutton leading to the related employees' view to the
simple user form view.

task-3334739

closes odoo/odoo#122870

Related: odoo/enterprise#41646
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-08 08:29:53 +00:00
sofiagvaladze 24abddacda [FIX] hr_homeworking: fix adding/removing weekly location
This commit fixes 3 bugs

------
Prior:
Deleting a weekly record from the calendar didn't remove it from the
employee's profile
Steps:
• Have a weekly location for the employee for Wednesday
• Go to the calendar and remove Wednesday location and choose that it's
  removed for everyweek
• Check employee card
Current behavior: The weekly location for Wednesday still appears on the
employee profile.
Expected: The weekly location for Wednesday is empty

------
Prior:
Deleting a weekly record from the employee's profile removed all records
from the calendar.
Expected behavior: When a weekly location is removed from the employee's
profile only future records should be removed, the past records should
stay untouched.

------
Prior:
When hr_homeworking is installed, if there is a work location set for
the day it is shown on the employee's kanban card, but when it's not
specified it shows nothing, which can be confusing.
Expected: Show 'Unspecified' when location is not set.

task - 3439421

closes odoo/odoo#133671

X-original-commit: 9212e2ff95be61528cc9d249e6f2baec770b8907
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-31 06:16:05 +00:00
sofiagvaladze 3faad0a7a0 [IMP] hr_recruitment(_skills/_survey): grant interviewer more rights
Purpose: In order to increase visibility of the interviewer group,
it is moved from hidden group, to recruitment group.

Moreover, we grant the interviewer additional rights in order to manage
the application process properly and be able to execute following actions
• Send an interview
• Check interview results
• Add/delete/modify skills
• Create a meeting

In order to allow above mentioned actions on skills to the interviewer,
we grant them all the rights to the hr_applicant_skill.

In order to let the interviewer send the survey we grant them access to
the private addresses and now recruitment-interviewer implies
survey-officer group as well.

Additionally, for the security purposes, we make a change, so that
the survey officer is not able to read recruitment interview results
unless they are also an interviewer for a specific applicant.

task - 3179332

closes odoo/odoo#118897

Related: odoo/enterprise#40696
Related: odoo/upgrade#4624
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-27 17:33:02 +02:00
sofiagvaladze 4a68ec46ec [IMP] hr_recruitment: avoid sending stage change message to unarchived applicants
Purpose:
When the applicant is unarchived, they are automatically set back to
first stage. This is done automatically. In case there is automated
message post configured for that stage change, it will send the mail to
the applicant. We want to avoid this.

After this commit, the automated message related to the stage change
will not be posted in case the applicant has been just unarchived,
even if it is configured for the stage.

task - 3267915

closes odoo/odoo#120506

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-06 09:19:23 +02:00
sofiagvaladze 2332624ca4 [IMP] hr_holidays: allow quick approval on dashboard
Purpose: HR can view employee leave records from the calendar but can
not approve, validate or refuse it from there.
In case they want to make action, they have to go through
menu < time off < approvals < time off < find the employee
< find the requested time off < open it < approve.

In this commit the action buttons are added on the dashboard.

task - 3175495

closes odoo/odoo#116342

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-03 12:39:22 +02:00
sofiagvaladze 012a5e761d [FIX] hr_recruitment: simplify application_count computation
Prior, application_count was computed in batch. In order to do
so, the complex query was used, which can be error prone.

As the field is only used for smart button on the form, we can assume
that the method will be called for one record at a time, thus using ORM
methods will not make big difference in terms of speed, while it is more
elegant and secure.

Note: that we still need to have _compute_application_count in batch,
as it is a compute method.

task - 3266694

closes odoo/odoo#119373

X-original-commit: 8480a6a6da8ef319047d11be489f546d368dfc56
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-22 05:52:31 +02:00
sofiagvaladze faf0f0130b [FIX] hr_recruitment: correctly count the number of applications
Previously, the "Other applications" smartbutton was incorrectly
matching with the applicants with '' on the fields. We don't want
applicants to match if both of them has '' on the matching fields.
Moreover, record rules were not correctly applied for application_count
calculation, as current record will not match with similar record
which has no company defined on it.

This commit fixes the above mentioned issues.

task - 3266694

closes odoo/odoo#118805

X-original-commit: e8263e56423432e9465f70d26fce60c021eabaa2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-17 18:01:26 +02:00
sofiagvaladze cad6ac3c3f [IMP] hr_work_entry: UX changes
For more clarity, we added some fields on the list view of work entry.

task - 3264920

closes odoo/odoo#118050

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-14 11:49:15 +02:00
sofiagvaladze 7ca2d7dbd6 [IMP] base: UX improvement
Remove an option used by the phone widget in the res_user view.

task - 3246848

closes odoo/odoo#117805

X-original-commit: a998437ed465f1a2a0aaee3651472ff8c58ba067
Related: odoo/enterprise#39387
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-05 17:31:49 +02:00
sofiagvaladze 94bbffe46b [IMP] add domain to select current company calendar
Before this commit user was able to select calendars from
differant companies even though user is not allowed to read
that companies record.

This commit add field related to country company and use
it in a domain to restrict user to select on availble
calendars.

task-3078009

closes odoo/odoo#109904

Related: odoo/enterprise#37334
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-21 18:55:55 +01:00
sofiagvaladze 630f13fb1d [IMP] *: manage smartbuttons on employee form view
*: hr_attendance,hr_skills_slides,hr_timesheet,hr_work_entry

Don't show smartbuttons that lead to a view without records

task - 3134772

closes odoo/odoo#113105

Related: odoo/enterprise#37274
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 11:20:38 +01:00
sofiagvaladze 2a4795d3e2 [FIX] hr_contract: proceed cron action even when ValidationError occurs
The method update_state is called from cron. When the contracts are
updated couple things are checked. There are constraints set that can
throw ValidationError. As a result, none of the contract states are updated.

In this PR we do the following:
In case the ValidationError occurs when we run the cron, we update
contracts that can be updated, and silently pass the invalid contracts.

task - 3069480

bloupbloup

closes odoo/odoo#114566

X-original-commit: bce0d7d0f11d46c671bc2b902d17d80febeefa5f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-07 18:03:19 +01:00
sofiagvaladze 2810aa3422 [IMP] hr_recruitment: rename the search field
task - 3203196

closes odoo/odoo#113653

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-27 12:54:45 +01:00
sofiagvaladze 14d97ec28a [IMP] base,auth_password_policy: add form view for changing password
Purpose: The form view is more intuitive then list view in case
user wants to change the password only for one user.

task - 3105178

closes odoo/odoo#109869

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-07 14:35:33 +01:00
sofiagvaladze 93ad98bc6f [IMP] hr_holidays,hr_work_entry_holidays: change responsible_id from ma2o to m2m
task - 3060720

closes odoo/odoo#107804

Related: odoo/upgrade#4128
Related: odoo/enterprise#34926
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-25 17:50:05 +01:00
sofiagvaladze 262c0ad84f [IMP] hr_holidays: send time off cancellation notification to manager
Purpose:

User should be abled to delete him time off (time off that needs to be
validated by both, manager and time off officer), if it has not been validated
by officer yet.

The manager that validated the time off, should be notified
if/when the time off is canceled by the user.

Both manager and user should be notified if officer refused time off,
validated by manager.

This commit also fixes traceback on time off form in development mode.

If there is

<field name="A"/>
<label for="A"/>

we get traceback in dev mode.

Instread it should be

<label for="A"/>
<field name="A"/>

task - 2857233

closes odoo/odoo#94533

Related: odoo/upgrade#3809
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-10 15:43:00 +01:00
sofiagvaladze 58b7d309ce [FIX] hr_expense: correctly update tax_ids after splitting the expense
The - Split Expense - feature was introduced in odoo/odoo#90770

In this commit we fix the following bug, related to it:

Steps to reproduce:
	- Create expense with tax_ids.
	- Click on - Split expense on the expense form. From the first
      hr.expense.split line remove the tax_ids. Rename it as '1',
      so that it is easier to find it back for checking later on.
 	- Click on - Expense split on the wizard.

Check the resulting expenses. Specifically, the one with the name '1'.

Current behavior - The tax_ids field for the first expense
(with the name '1') is still populated.
Expected - The tax_ids field for the first expense should be empty.

On top of that, we introduce the tests that check Split Expense flow.

task - 2831024

closes odoo/odoo#108049

X-original-commit: 3aaf4f1ee2967793c9a4c29766cec63d2c6e3cf4
Related: odoo/enterprise#35005
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-15 14:43:54 +01:00
sofiagvaladze 7a6b903830 [FIX] hr_expense: set 'name' and 'expense_line_ids' during report creation
Steps to reproduce
- Install Accounting
- Create user and employee, "user_acc", with Accounting-Accounting and no Expense rights
- Take the expense in "To Submit" state for the employee different than user_acc and create report
- Save the report.

Bug - We get the error that required field 'name' is not set and expense lines disappear.

task - 3099142

closes odoo/odoo#107903

X-original-commit: c5765be58dcdb3f6d766e6ce409a6e0f8a82e45b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-14 09:34:55 +01:00
sofiagvaladze bfa7a47c86 [IMP] hr_holidays: hinder allocation date_to to precede date_from
Purpose: In order to reduce the possibility to make errors, make the end
date of the validity period always come after the start date.

task - 3069666

closes odoo/odoo#106966

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-02 14:40:28 +01:00
sofiagvaladze 470674ead4 [FIX] hr_holidays: correct the dashboard validity date
Prior to this fix, closest_allocation_to_expire was the upcoming allocation regardless
whether there were remaining leaves on it or not.

That lead to misleading information on the dashboard.
For example, let's say user has two allocations and used up the first allocation
and has X days left on the second allocation. Still, the user will see that they have
left X days (Valid until -- the first allocation expiration date --). Which is misleading,
Instead they should see X days (Valid until -- the second allocation expiration date --).

task - 2978789

closes odoo/odoo#103813

X-original-commit: dee3552659bec78fbbce4e8af155b3259e721dbd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-21 18:10:54 +02:00
sofiagvaladze b7eaff5ecd [FIX] hr_holidays: show delete button on wizard in validate and refuse states
One should be able to delete time off from the calendar view in validate
and refuse states.

task - 2857233

closes odoo/odoo#102938

X-original-commit: d8d4f2d39658c1a2dc24510e9e3f0bf75f590663
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-10 18:09:00 +02:00
sofiagvaladze 81f9416596 [FIX] hr_recruitment: add running Applicants filter
Purpose: The number of 'Late activities' are displayed on the kanban card.
The number excludes the activities for the hired applicants. Yet, once we
click on it, we are redirected to the activity view, which included the
later activities. On the one hand, this is not consistent, but on the
other hand, one might still be interested in those activities later on.

Thus the best way out is to put the filter for the "Running Applicants".
This filter will filter out the applicants in hired stage, but if we are
interested in them, one could just remove the filter.

task - 3001375

closes odoo/odoo#102691

X-original-commit: 16e025de14be3ace07191ab153259ed17b174748
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Gvaladze Sopiko (sgv) <sgv@odoo.com>
2022-10-10 10:53:51 +02:00
sofiagvaladze 6e5dc0b570 [FIX] hr_expense: introduce analytic changes to hr.expense.split
The following PR - odoo/odoo#98914 introduced changes in
accounting analytic.
The changes were applied to 'hr.expense' but they were not applied to 'hr.expense.split'.
Which lead to traceback.

task - 2997510

closes odoo/odoo#101997

X-original-commit: 4f5c531b854271284238b5a13f95d66eb2e12f93
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-06 16:59:53 +02:00
sofiagvaladze 39c14368a2 [FIX] hr: hide create_employee on create user form
Set the default value for create_employee to False.

When coming from employee form, hide the create_employee field.

task - 2990426

closes odoo/odoo#100661

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-03 17:18:18 +02:00
sofiagvaladze 39efb6116a [FIX] hr_skills: Skill history report
Prior, by default Skill history report goes to stacked view.
Which is not informative for the kind of information that is displayed.

task - 2993831

closes odoo/odoo#101656

X-original-commit: 1951b56d91dc17ec8d81257e8c431f7a24420e2b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-30 09:31:45 +02:00
sofiagvaladze 70c953c26a [IMP] hr_contract: Contracts smartbutton
purpose:
Contract management is a prior thing on an employee profile;
Thus, Contract smartbutton should be in the second position,
after Documents smartbutton, in case documents_hr is installed.

task - 2984690

closes odoo/odoo#100532

Related: odoo/enterprise#31481
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-27 11:41:36 +02:00
sofiagvaladze 4993034dd5 [IMP] fleet: add search to the fleet.vehicle.model list view
task - 2990118

closes odoo/odoo#100643

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-23 22:04:07 +02:00
sofiagvaladze 40a82e1fe4 [IMP] hr_expense,sale_expense: UX improvements
Major changes:
	- converted list view to owl
	- merged menus
	- added CREATE REPORT button on hr.expense that reports either
      ticked draft expenses, or all the draft expenses for the user
	- added dynamic buttons on expense.sheet list view
	- added searchpanel on expense.sheet for team approvers and above
	- moved (and changed) expense categories from demo to data
	- added support on drag'n'drop while in list and kanban view of
      expense for quick upload

task - 2831036

closes odoo/odoo#93802

Related: odoo/enterprise#28474
Related: odoo/upgrade#3778
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-27 03:32:54 +02:00
sofiagvaladze 6106f2eb9a [FIX] hr_contract: fix access error when archiving employee
Scenario:
hr_contract is installed and employee/officer without rights on contract
tries to archive an employee.

Before the fix:
An employee/officer without rights on contract gets the following access error:
Due to security restrictions, you are not allowed to access 'Employee Contract' (hr.contract) records.
THis is because the action tries to access employee's contract and set
date_end on it.

After the fix an employee/officer without rights on contract can archive
an employee without access error.

task - 2811165

closes odoo/odoo#98648

X-original-commit: c7ff577053a120f8f961642891d3a0ec0c960ae8
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-23 16:29:29 +02:00
sofiagvaladze 19364c79d7 [FIX] hr_expense: add default_partner_bank_id in context
The mistake was made in odoo#81904

Instead of 'default_partner_bank_id' we have 'partner_bank_id' in the
context of action_register_payment.

In this commit, we undo that mistake and also backport the change to v15.

task - 2774594

closes odoo/odoo#97886

X-original-commit: 5c8b74bb3bddd67b5a76d37f7d97a1d5d77c00c4
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-10 16:08:18 +02:00
sofiagvaladze aa8bfeca0c [IMP] sale_expense_margin: set purchase_price on sale.order.line for expense
Purpose: When re-invoicing the expense on the SO, the cost (purchase_price)
is not correctly set. For expenses with zero product it is set to zero,
and for the expenses with price on it, it is set to unit_price of the product.
As a result, the margin is calculated incorrectly on SO.

It should be set to the untaxed_amount of the expense in case of zero
product, or untaxed_amount of the product in case of a product with
price defined on it.

task - 2867723

closes odoo/odoo#96981

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-10 16:08:06 +02:00
sofiagvaladze 7abf1b33f0 [FIX] sale: always round price_unit
In case there is no need for currency conversion, the return value of
 _sale_get_invoice_price is not rounded. While, when currency conversion
takes place, the return value is rounded. First of all, the behavior is
not universal, It should be the same across these cases.
Secondly, not rounding the return value causes discrepancy when computing
margin (in the sale_margin module) for expense products; as price_unit
is not rounded (in the first case), while purchase_price is rounded.

task - 2867723

Part-of: odoo/odoo#96981
2022-08-10 16:08:06 +02:00
sofiagvaladze edcda35087 [FIX] hr_expense: set quantity to 1 when choosing 0-cost-product
Scenario:

Open expense, choose product with cost, set quantity to 5, now choose
any 0-cost product. Save the expense.

Behavior: quantity is 5

Expected behavior: quantity should be set to 1

Implications: As a result, in the list view on expenses, we see incorrect quantity.
Moreover, in SO, price_unit will be incorrectly computed.

task - 2867723

closes odoo/odoo#96732

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-07-28 09:14:47 +02:00
sofiagvaladze 32633e3087 [IMP] hr_expense: add can_be_expensed field in product view
Purpose: Allow users to make product 'expense available'
(or the opposite, unset them as expense products) by making the
field 'can_be_Expensed' available in the base product view.

task - 2909067

closes odoo/odoo#96619

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-07-27 04:52:49 +02:00
sofiagvaladze 102136f2ae [IMP] hr_expense: prevent change of employee on line sheet
In case we change the employee on an expense and  in case expense has
sheet which has only one expense_line_ids, then changing the
expense.employee_id triggers changing the sheet.employee_id too.

In case there are more than one expense linked to the report, then we
unlink the expense line from sheet, (so that the user can create a new report).

task - 2890095

closes odoo/odoo#94424

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-07-06 10:36:22 +02:00
sofiagvaladze bcea427c02 [IMP] hr_expense: use all taxes as price_included
In expense flow the taxes are calculated as included in price.
Prior, to guarantee it, we had domain - ('price_include', '=', True) on taxes.
That could be inconvenient from user's point of view, as they first needed to
define taxes with price_include = True. That led to users duplicating taxes
between included/excluded just so that they could use taxes in expense.

Now we force taxes to act like price_include = True. This way, user does not
need to define taxes just for expense's purposes and still taxes will be calculated
as it supposed to be - included in price.

task - 2850882

closes odoo/odoo#94392

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-29 12:19:18 +02:00
sofiagvaladze f938dc397d [FIX] board: filter records according to selected companies
Before, when we added view to the dashboard, context was saved too,
including allowed_company_ids. As a result when we checked the same view
from the dashboard, the displayed records corresponded to the active companies
during the time the view was saved and not the current ones - the companies
that are currently ticked from the multi-company widget.

After the fix, the displayed records in dashboard, correspond to the currently active companies.

task - 2809597

closes odoo/odoo#94105

X-original-commit: 9f854262a197782793d329487792a09a101a1a38
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-21 10:17:41 +02:00
sofiagvaladze cef01fa521 [IMP] mail, hr_expense: show expense attachments on sheet
Purpose: Before it was hard to view expense attachments from sheet record.
To do so, the user should have gone through clicking on each expense first and
checking attachments, or could have clicked on a attachments smart button on embedded
expense table, which is redirecting to another view that only displays attachments for the one expense only.
Thus, checking all the attachments from sheet was an tedious task.

After this commit, the user can see in the sheet attachment preview all the associated expenses' attachments.

To make it possible, we ovveride 'mail.thread' method that is called to
fetch the data for the chatter. In the override, we fetch extra, associated expenses' attachments.

task - 2320177

closes odoo/odoo#92724

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 16:54:22 +02:00
sofiagvaladze be3d76a95a [FIX] hr_expense: fix 'hr.expense' has no attribute 'attach_document'​
In case hr_expense_extract is not installed and we click
'Attach Receipt' on hr_expense form view, we get a traceback.

task - 2870500

closes odoo/odoo#92761

X-original-commit: 8593decb2fe6820cfc6f043cb3458f43dd635c87
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 15:51:04 +02:00
sofiagvaladze d70000bf21 [IMP] hr_expense/sale_expense: allow splitting an expense
Purpose: Sometimes, taxes are distinct on parts of the expense
(for example alcohol and food).
Therefore the expense should be split in two.

In order to split the expense, we added an wizard.
When creating a new expense from the split, we also
copy the attachments.

'hr.expense.split' has to have the similar logic and dependencies between
the fields as 'hr.expense' does. For example, in case we change the
product_id to the product that has cost defined on it, it should have
the same behavior as expense has. In particular, the 'total_price'
will be set and the user should not be able to modify the amount.

Similarly, if we change the product_id to the one that has no tax defined
on it, then split tax_ids should be cleared out and be set to readonly.
Similar logic goes to sale_order_id (Customer to Reinvoice'),
we should not be able to set it, in case the product can not be re-invoiced.

All of the above constraints leads to the amount of similar code to to the 'hr.expense.split' side.
But it could not have been avoided, if we want the smooth flow.

task - 2831024

closes odoo/odoo#90770

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 08:02:04 +02:00
sofiagvaladze 09609889e3 [FIX] hr_expense: fix updating the unit amount on the expense form
The unit_amount should be updated when product changes, in case the product
has price defined on it.

task - 2831024

Part-of: odoo/odoo#90770
2022-06-02 08:02:04 +02:00
sofiagvaladze 0476f084a1 [IMP] fleet: add category_id to the vehicle from model
category_id field is populated from the model, but it can be edited.

task - 2828459

closes odoo/odoo#89282

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-11 19:46:00 +02:00
sofiagvaladze be49740169 [IMP] hr: make Launch Plan multi-employee action
Purpose:
    Increase usability of the Plan feature

This change implies changing 'hr.plan.wizard' m2o employee_id
field into m2m employee_ids field.

task - 2797331

closes odoo/odoo#88119

Related: odoo/enterprise#26264
Related: odoo/upgrade#3439
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-03 06:44:51 +02:00
sofiagvaladze 5dca077c68 [IMP] hr_recruitment: Improve multi applicant count
Purpose:
At the moment, you can only find multi applications for the same applicant
based on the similar email.
Not every application comes through the same email.

We want to find same applicants based on the same email, phone or
mobile phone.

task - 2701472

closes odoo/odoo#86428

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-29 11:01:15 +02:00
sofiagvaladze afbc213e2c [IMP] hr_skills: add _order fields on models
task - 2687370

closes odoo/odoo#81836

Related: odoo/enterprise#22723
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-03-14 17:27:57 +00:00
sofiagvaladze 3840959acf [FIX] hr_expense,sale_expense: make expense_line_ids editable
Related PR - odoo/odoo#84978

task - 2768700

closes odoo/odoo#85619

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-03-04 12:16:35 +00:00
sofiagvaladze ae687dadc0 [FIX] hr_expense: to give report manager rights and make expense_line_ids editable
1) Now report manager (user_id) (with Team Approver rights) can't see the report.
Here we grant him the same rights as the manager (on employee app)
of the employee will have. Moreover, he can approve the report as well.

2) Purpose: accountant, manager, should be able to edit expense_line_ids
for expense report not only in draft, but also for submitted and approved states.

On the other hand, employee can only edit his expense report only in draft state.

task - 2768700

closes odoo/odoo#84978

Related: odoo/upgrade#3274
Related: odoo/enterprise#24579
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-24 11:26:43 +00:00
sofiagvaladze eee7067a3f [FIX] hr_expense: Fix traceback caused by empty currency_id
When we are setting currency_id, if we delete it altogether,
we get a traceback.

Task - 2704297

closes odoo/odoo#84741

X-original-commit: 870577981e02fce4a3b1b1df200d2a81c814f5e8
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-17 07:21:43 +00:00
sofiagvaladze f6030aeecc [FIX] iap_mail: Remove messageIsHtml from IAP failure notification
Before the fix:
When we don't have enough credits for Bill Digitalization,
try to scan expense from expense app (or upload bill from billing).
Instead of getting 'Not enough credits for Bill Digitalization',
we are getting 'Odoo Client Error'.

That is because messageIsHtml is no more prop to component 'Notification'.

closes odoo/odoo#84701

Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-02-16 16:57:20 +00:00
sofiagvaladze 41ad15b761 [FIX] web: fix the traceback
Problem occurs when we try to export report data and click
'I want to update data (import-compatible export)'.
We might end up exporting data when only field to export
is - External ID (id).

To reproduce an issue (for example):
Go to Time Off/Reporting/by Type; Remove filters from search.
Select couple records, then Action/Export.
On the wizard, click on 'I want to update data (import-compatible export)'.
Click on External ID from 'Available fields' to add it to 'Fields to export'.
Click export.

It gives traceback -
File "/data/build/odoo/addons/web/controllers/main.py", line 710,
 in write_header self.worksheet.set_column(0, i, 30) # around 220 pixels
UnboundLocalError: local variable 'i' referenced before assignment

task - 2687370

closes odoo/odoo#84191

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-02-11 13:21:02 +00:00
sofiagvaladze 26a5653f48 [IMP] hr_expense, sale_expense: improve UX (back2basics)
Enterprise PR - odoo/enterprise#23980
Upgrade PR - odoo/enterprise#3206

- UI improvements/changes

- Taxes

    Before this commit, in case taxes were defined on expense,
    the tax amount was added on top of a product price.
    For example, in case product price was 100$, and tax - 15%,
    then expense.total_amount would be 115$.

    Now, tax amount is included in expense.total_amount. To accommodate
    this change, we set following domain - ('price_include', '=', True)
    on tax_ids on expense.

    For the same example, expense.total_amount would be 100$, tax amount
    would be 13.04$ and untaxed amount - 86.96$.

    But, tax amount can be set for non-zero expenses (in case expense.product_id.standard_price !=0).
    For the above example, one could set tax amount to 15$.
    As a result untaxed amount will be 85$ and total amount - 1OO$.

- Journal entry

    Previously, in case journal entry was reset to draft, canceled,
    reversed - it changed the state of the linked expense report.
    Now, actions done on accounting by accountant does not impact expense reports.

task - 2687999

closes odoo/odoo#81904

Related: odoo/upgrade#3206
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-04 10:23:43 +00:00
sofiagvaladze 3bcac60f4b [FIX] hr_recruitment_survey: fix creation of an empty registration
To reproduce an issue:
    Open Recruitment Form from Surveys app. Share it with a recipient.
    For example with Azure Interior.

Current behavior:
    2 registrations are created, including an empty one.

Expected behavior:
    Only 1 registration (for Azure Interior) should be created.

Task-2694600
Partial rewrite of odoo/odoo#81851

closes odoo/odoo#81903

X-original-commit: a0a626253b62f01d6bbfe56b98fdedb2317b9598
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-25 02:26:44 +00:00
sofiagvaladze 3018a91eaa [FIX] hr_recruitment: correct smart button display info
It is more intuitive that application_count smartbutton has
the label 'x Other applications'.

task - 2695252

closes odoo/odoo#80551

X-original-commit: f1a2f51fec0a31b80a20c78a5b3d11561dce7164
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-03 08:55:43 +00:00
sofiagvaladze 704ad908a1 [FIX] hr_holidays: restrict creation of allocations
Purpose: It does not make much sense to create allocations of such an
Time Off Types that don't require allocation.

task - 2658250

closes odoo/odoo#80541

X-original-commit: 69cee9c13b1d5267b74a9f107bae85ea1c42aa38
Related: odoo/enterprise#22589
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-29 16:28:05 +00:00
sofiagvaladze 415ab27126 [IMP] hr_holidays: Time Off smartbutton
task - 2634892

closes odoo/odoo#75941

Related: odoo/upgrade#2852
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-29 08:32:44 +00:00
sofiagvaladze 2341087469 [IMP] hr_holidays: Validity date on dashboard
After this commit, in the Time Off dashboard, the user can see the validity
period of the available days in case if the related allocation
has a validity end.

If the time off has more than one allocation, we display the validity of the closest one.

task - 2636403

closes odoo/odoo#76257

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-20 16:39:54 +00:00
sofiagvaladze 42089cb78c [IMP] hr_holidays: Time Off dashboard information tag popover
Purpose: From the dashboard, the user sees the number of left time offs,
but does not have an information regarding how it is calculated.

In this task, we add an information tag on the Time Off dashboard
next to each Time Off type that requires allocation.
When we hover over the tag, we see how is the number calculated.

For example, it could look the following way:

Allocated : 20 days
Approved: 5 days
Planned: 3 days
-----------------
Left: 12 days

task - 2643115

closes odoo/odoo#76682

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-20 10:53:49 +00:00
sofiagvaladze b320c789a0 [IMP] hr:revert plan automation on triggers
task - 2628793

closes odoo/odoo#75528

Related: odoo/enterprise#20430
Related: odoo/upgrade#2776
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-27 17:43:23 +00:00
sofiagvaladze 08ed9a0ebb [IMP] hr_recruitment: UX improvements
Multi-Application Management and UX improvements.

Improve in Recruitment app Job Positions Kanban view;
It is more intuitive if list is applications default view; improve the applications form;

Task - 2404610

closes odoo/odoo#63946

Related: odoo/enterprise#15750
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-30 13:15:02 +00:00
sofiagvaladze 8804690e7a [IMP] hr_holidays: Improve archived employees management
Add filter on everyone menu
Add archived filters

task - 2416659

closes odoo/odoo#64806

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 04:07:52 +00:00
sofiagvaladze 95daf9d28c [IMP] hr: Create activity a month before Work Permit Expiration Date
Add boolean field to upload work permit

Task - 2442648

closes odoo/odoo#65899

Related: odoo/upgrade#2173
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-24 21:40:32 +00:00
sofiagvaladze a2d078c17f [FIX] hr_expense: Fix traceback caused by empty company_id
task - 2475520

closes odoo/odoo#70871

X-original-commit: fa38e56e605406f0c97a3e2c260d2a1b2a19dea5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-05-17 12:06:28 +00:00
sofiagvaladze babd7c2948 [IMP] hr_payroll: add color picker to hr.work.entry.type form and list
Task - 2452036

closes odoo/odoo#65622

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-02-09 13:35:47 +00:00
sofiagvaladze 21e2676b7a [IMP] hr_holidays: Allow to delete future time off
Allow to delete a non validated time off in the future to a simple user
Add some tests

Task - 2428789

closes odoo/odoo#65361

Related: odoo/upgrade#2127
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-16 09:44:15 +00:00
Sofie Gvaladze 2de15d5c0c [IMP] hr_expense: amend multicurrency
In order to make the expense form more intuitive, it was necessary to distinguish between whether the product has cost different from
 zero or not. Depending ot this context, some fields are shown or not. Also 'Bill Reference' is shown only to account managers.
 Now the expense can be submitted in different currency and it can be reimbursed in company’s currency.
 In case the latter two currencies differ from each other,
 the conversion is done automatically and the rate is also displayed.
 Suggestion - untaxed_amount can be removed

Task - 2366775

closes odoo/odoo#61920

Related: odoo/enterprise#14838
Related: odoo/upgrade#2028
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-11 14:04:06 +00:00
sofiagvaladze d713b445c7 [IMP] hr: Hide menu_hr_employee for group_hr_user
Reason: In Employees app, it is confusing for the first time users to see
both 'Employees' and 'Employee Directory' folder. Also, first user
is not assigned to any departments.

Solution: If the user can see the folder 'Employees', don't show
the folder 'Employee Directory'. Assign the first user to the
'Administration' department.

Task - 2377506

closes odoo/odoo#63038

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-15 09:21:05 +00:00
sofiagvaladze acf99ae77d [FIX] hr_expense: Fix traceback caused by empty currency_id
One can leave the currency_id empty and that causes Traceback error

Task - 2409942

closes odoo/odoo#63159

X-original-commit: 7473ad44f960aa3609faafe0cee8e12a392b43a9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: sofiagvaladze <sofiagvaladze@users.noreply.github.com>
2020-12-10 12:36:09 +00:00