Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] hr_timesheet_task_required #640

Merged
merged 32 commits into from
Mar 2, 2024

Conversation

MohamedOsman7
Copy link

No description provided.

@MohamedOsman7 MohamedOsman7 marked this pull request as ready for review February 26, 2024 15:52
@MohamedOsman7 MohamedOsman7 force-pushed the 17.0-mig-hr_timesheet_task_required branch from 6419179 to 162c93c Compare February 27, 2024 09:17
Copy link
Member

@FrancoMaxime FrancoMaxime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: code review

@MohamedOsman7 MohamedOsman7 force-pushed the 17.0-mig-hr_timesheet_task_required branch from 162c93c to 9e9c436 Compare February 27, 2024 09:18
benwillig and others added 23 commits February 27, 2024 10:16
Currently translated at 100.0% (9 of 9 strings)

Translation: timesheet-14.0/timesheet-14.0-hr_timesheet_task_required
Translate-URL: https://translation.odoo-community.org/projects/timesheet-14-0/timesheet-14-0-hr_timesheet_task_required/nl_NL/
Currently translated at 66.6% (6 of 9 strings)

Translation: timesheet-14.0/timesheet-14.0-hr_timesheet_task_required
Translate-URL: https://translation.odoo-community.org/projects/timesheet-14-0/timesheet-14-0-hr_timesheet_task_required/fr/
Currently translated at 100.0% (12 of 12 strings)

Translation: timesheet-15.0/timesheet-15.0-hr_timesheet_task_required
Translate-URL: https://translation.odoo-community.org/projects/timesheet-15-0/timesheet-15-0-hr_timesheet_task_required/fr/
@MohamedOsman7 MohamedOsman7 force-pushed the 17.0-mig-hr_timesheet_task_required branch from 9e9c436 to 50a9c80 Compare February 27, 2024 10:18
@MohamedOsman7 MohamedOsman7 marked this pull request as draft February 27, 2024 11:43
@MohamedOsman7
Copy link
Author

MohamedOsman7 commented Feb 27, 2024

I encountered a problem which i will describe step by step with screenshots:

  1. In the settings, under the project app settings, i did not set the checkmark in the field (Require Tasks on Timesheets):
2024-02-27 14_07_43-Odoo - Settings und 3 weitere Seiten - Geschäftlich – Microsoft​ Edge
  1. In the project app, i choosed the project "Research & Development" and opened his settings:
2024-02-27 14_08_23-Odoo - Projects und 3 weitere Seiten - Geschäftlich – Microsoft​ Edge
  1. I also did not set the checkmark in the field (Require Tasks on Timesheets):
2024-02-27 14_09_28-Odoo - Research   Development und 3 weitere Seiten - Geschäftlich – Microsoft​ E
  1. In the timesheet app, when attempting to create a timesheet entry with the same project without choosing a task, i encountered an unexpected error:
2024-02-27 14_10_56-Odoo - My Timesheets und 3 weitere Seiten - Geschäftlich – Microsoft​ Edge

Apart from the fact that the error occurs at all, where it should not occur, the error message does not match the error specified in the code, which is:

(Note: This screenshot is from version 16.0)

2024-02-27 13_39_08-Odoo - My Timesheets und 7 weitere Seiten - Profil 2 – Microsoft​ Edge

I would assume that something has changed in the new odoo standard in this regard. But i did not find anything yet. Any ideas?

@MohamedOsman7 MohamedOsman7 force-pushed the 17.0-mig-hr_timesheet_task_required branch 2 times, most recently from 86278a3 to 23c81c7 Compare February 27, 2024 15:32
@MohamedOsman7 MohamedOsman7 marked this pull request as ready for review February 27, 2024 15:36
Copy link
Contributor

@CRogos CRogos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working, but some code improvements possible.

@@ -10,27 +10,15 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="inherit_id" ref="hr_timesheet.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath
expr="//div[@data-key='project']//field[@name='module_hr_timesheet']/../../.."
expr="//app[@data-string='Project']//block[@name='project_time']"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expr="//block[@name='project_time']"

should be sufficient.

Comment on lines 29 to 35
<div
class="col-lg-6 o_setting_box"
id="timesheet_task_settings"
attrs="{'invisible': [('allow_timesheets', '=', False)]}"
invisible="allow_timesheets == False"
>
<div class="o_setting_left_pane">
<field name="is_timesheet_task_required" class="oe_inline" />
Copy link
Contributor

@CRogos CRogos Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the hole div block should be replaced by this:

                    <setting id="timesheet_task_settings" help="Set tasks on timesheet as a mandatory field" invisible="allow_timesheets == False">
                        <field name="is_timesheet_task_required"/>
                    </setting>

<attribute
name="attrs"
>{'required':[('is_task_required','=',True)]}</attribute>
<attribute name="required">is_task_required == True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<attribute name="required">is_task_required</attribute>
should be enough.

<attribute
name="attrs"
>{'required':[('is_task_required','=',True)]}</attribute>
<attribute name="required">is_task_required == True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. remove "== True"

@@ -14,9 +14,8 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="is_task_required" invisible="1" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invisible needs to be changed to
column_invisible="True"

@MohamedOsman7 MohamedOsman7 mentioned this pull request Feb 28, 2024
14 tasks
@MohamedOsman7 MohamedOsman7 force-pushed the 17.0-mig-hr_timesheet_task_required branch from 23c81c7 to 28dcd4f Compare February 28, 2024 09:15
@dreispt
Copy link
Member

dreispt commented Feb 28, 2024

/ocabot migration hr_timesheet_task_required

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Feb 28, 2024
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@dreispt
Copy link
Member

dreispt commented Mar 2, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-640-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 2c73a0f into OCA:17.0 Mar 2, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 191eb44. Thanks a lot for contributing to OCA. ❤️

@CRogos CRogos deleted the 17.0-mig-hr_timesheet_task_required branch March 4, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.