Skip to content

Commit

Permalink
[17.0][MIG] hr_timesheet_task_required
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Osman committed Feb 28, 2024
1 parent 66b4816 commit 28dcd4f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 46 deletions.
2 changes: 1 addition & 1 deletion hr_timesheet_task_required/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Hr Timesheet Task Required",
"summary": """
Set task on timesheet as a mandatory field""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, CorporateHub, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/timesheet",
Expand Down
1 change: 0 additions & 1 deletion hr_timesheet_task_required/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down
10 changes: 3 additions & 7 deletions hr_timesheet_task_required/views/account_analytic_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="is_task_required" invisible="1" />
</field>
<field name="task_id" position="attributes">
<attribute
name="attrs"
>{'required':[('is_task_required','=',True)]}</attribute>
<attribute name="required">is_task_required</attribute>
</field>
</field>
</record>
Expand All @@ -26,12 +24,10 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
<field name="arch" type="xml">
<field name="task_id" position="before">
<field name="is_task_required" invisible="1" />
<field name="is_task_required" column_invisible="1" />
</field>
<field name="task_id" position="attributes">
<attribute
name="attrs"
>{'required':[('is_task_required','=',True)]}</attribute>
<attribute name="required">is_task_required</attribute>
</field>
</field>
</record>
Expand Down
22 changes: 7 additions & 15 deletions hr_timesheet_task_required/views/project_project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="allow_timesheets" position="after">
<field
name="is_timesheet_task_required"
attrs="{'invisible': [('allow_timesheets', '=', False)]}"
invisible="allow_timesheets == False"
/>
</field>
</field>
Expand All @@ -25,22 +25,14 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="model">project.project</field>
<field name="inherit_id" ref="hr_timesheet.project_invoice_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='timesheet_settings']" position="after">
<div
class="col-lg-6 o_setting_box"
<xpath expr="//setting[@id='timesheet_settings']" position="after">
<setting
id="timesheet_task_settings"
attrs="{'invisible': [('allow_timesheets', '=', False)]}"
help="Set tasks on timesheet as a mandatory field"
invisible="allow_timesheets == False"
>
<div class="o_setting_left_pane">
<field name="is_timesheet_task_required" class="oe_inline" />
</div>
<div class="o_setting_right_pane">
<label for="is_timesheet_task_required" />
<div class="text-muted">
Set tasks on timesheet as a mandatory field
</div>
</div>
</div>
<field name="is_timesheet_task_required" />
</setting>
</xpath>
</field>
</record>
Expand Down
29 changes: 7 additions & 22 deletions hr_timesheet_task_required/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,13 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
<field name="model">res.config.settings</field>
<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']/../../.."
position="inside"
>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="is_timesheet_task_required" />
</div>
<div class="o_setting_right_pane">
<label for="is_timesheet_task_required" />
<span
class="fa fa-lg fa-building-o"
title="Values set here are company-specific."
role="img"
aria-label="Values set here are company-specific."
groups="base.group_multi_company"
/>
<div class="text-muted">
Require task selection on each timesheet entry by default
</div>
</div>
</div>
<xpath expr="//block[@name='project_time']" position="inside">
<setting
id="is_timesheet_task_required_setting"
help="Require task selection on each timesheet enty by default"
>
<field name="is_timesheet_task_required" />
</setting>
</xpath>
</field>
</record>
Expand Down

0 comments on commit 28dcd4f

Please sign in to comment.