Skip to content

Commit

Permalink
[ADD] hr_timesheet_project_prevent_creation
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed Aug 26, 2022
1 parent 16dd2ef commit 2bd9fe0
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hr_timesheet_project_prevent_creation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2022 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later
27 changes: 27 additions & 0 deletions hr_timesheet_project_prevent_creation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2022 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

{
"name": "Prevent creation of projects and tasks from timesheets",
"summary": """
Prevent creation of projects and tasks from timesheets.""",
"version": "12.0.1.0.0",
"category": "Human Resources",
"website": "https://coopiteasy.be",
"author": "Coop IT Easy SC",
"maintainers": ["carmenbianca"],
"license": "AGPL-3",
"application": False,
"depends": [
"hr_timesheet",
"hr_timesheet_sheet",
],
"excludes": [],
"data": [
"views/hr_timesheet_sheet_views.xml",
"views/hr_timesheet_views.xml",
],
"demo": [],
"qweb": [],
}
3 changes: 3 additions & 0 deletions hr_timesheet_project_prevent_creation/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Carmen Bianca Bakker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent creation of projects and tasks from timesheets.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
SPDX-FileCopyrightText: 2022 Coop IT Easy SC
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<odoo>
<record id="hr_timesheet_sheet_form" model="ir.ui.view">
<field
name="name"
>hr_timesheet.sheet.form.hr_timesheet_project_prevent_creation</field>
<field name="model">hr_timesheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
<field name="arch" type="xml">
<field name="add_line_project_id" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
</field>
<field name="add_line_task_id" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
</field>
<xpath
expr="//page/field[@name='timesheet_ids']/tree/field[@name='project_id']"
position="attributes"
>
<attribute name="options">{'no_create': True}</attribute>
</xpath>
<xpath
expr="//page/field[@name='timesheet_ids']/tree/field[@name='task_id']"
position="attributes"
>
<attribute name="options">{'no_create': True}</attribute>
</xpath>
</field>
</record>
</odoo>
23 changes: 23 additions & 0 deletions hr_timesheet_project_prevent_creation/views/hr_timesheet_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
SPDX-FileCopyrightText: 2022 Coop IT Easy SC
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<odoo>
<record id="hr_timesheet_line_tree" model="ir.ui.view">
<field
name="name"
>account.analytic.line.tree.hr_timesheet_project_prevent_creation</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
<field name="arch" type="xml">
<field name="project_id" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
</field>
<field name="task_id" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
</field>
</field>
</record>
</odoo>
6 changes: 6 additions & 0 deletions setup/hr_timesheet_project_prevent_creation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 2bd9fe0

Please sign in to comment.