Skip to content

Commit

Permalink
Ta#66856 [16.0] [MIG] project_stage_no_quick_create (#490)
Browse files Browse the repository at this point in the history
* TA#66856 [16.0] [MIG] project_stage_no_quick_create
---------

Co-authored-by: Lanto R. <[email protected]>
Co-authored-by: majouda <[email protected]>
  • Loading branch information
3 people authored Jan 16, 2025
1 parent d221cf2 commit 52103ac
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"project_projected_hours",
"project_remaining_hours_update",
"project_stage_allow_timesheet",
"project_stage_no_quick_create",
"project_task_date_planned",
"project_task_deadline_from_project",
"project_task_description_template",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ COPY project_progress_variance /mnt/extra-addons/project_progress_variance
COPY project_projected_hours mnt/extra-addons/project_projected_hours
COPY project_remaining_hours_update /mnt/extra-addons/project_remaining_hours_update
COPY project_stage_allow_timesheet mnt/extra-addons/project_stage_allow_timesheet
COPY project_stage_no_quick_create mnt/extra-addons/project_stage_no_quick_create
COPY project_task_date_planned /mnt/extra-addons/project_task_date_planned
COPY project_task_deadline_from_project /mnt/extra-addons/project_task_deadline_from_project
COPY project_task_description_template /mnt/extra-addons/project_task_description_template
Expand Down
57 changes: 57 additions & 0 deletions project_stage_no_quick_create/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Project Stage No Quick Create
=============================

This module prevents the quick creation of project stages.

*Before installing the module*:

.. image:: static/description/quick_create_project_stage_enabled.png

*After installing the module*:

.. image:: static/description/quick_create_project_stage_disabled.png

It also add the field `type_ids` (Task Stages) on the project form.

.. image:: static/description/project_stages_form_view.png

It also remove the view of all project linked to the project stage, only in form view.
It is always in the tree view.

*Before installing the module*:

.. image:: static/description/projects_linked_to_project_stage_visible.png

*After installing the module*:

.. image:: static/description/projects_linked_to_project_stage_invisible.png

Same Stages for All Projects
----------------------------
If you need to have the same stages for all project:

* Activate the developer mode.
* Go to /Settings/Technical/Actions/User-defined Defaults.
* Click on `Create`.
* In `Field` select `Tasks Stages (project.project)`.
* In `Default Value (JSON format)` enter `[[6, 0, [n1, n2, ..., n]]]`
where [n1, n2, ..., n] is the list of ids of the stages.

Example:

.. image:: static/description/user_defined_defaults_tasks_stages.png

After creating a new project with the previous configuration, the default stages will be as follows:

.. image:: static/description/user_defined_defaults_example.png

Whenever you want to update the default stages, you may edit this default value.

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
* Istvan Szalai ([email protected])

More information
----------------
* Meet us at https://bit.ly/numigi-com
2 changes: 2 additions & 0 deletions project_stage_no_quick_create/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2022-today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/LGPL).
20 changes: 20 additions & 0 deletions project_stage_no_quick_create/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2022-today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/LGPL).

{
"name": "Project Task Stage No Quick Create",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"licence": "LGPL-3",
"category": "Project Management",
"summary": "Disable project task stage quick create",
"depends": ["project"],
"data": [
"views/project_project_views.xml",
"views/project_task_views.xml",
"views/project_task_type_views.xml",
],
"installable": True,
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions project_stage_no_quick_create/views/project_project_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="edit_project" model="ir.ui.view">
<field name="name">Project Form With Stages</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project" />
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="type_ids" widget="many2many_tags" />
</field>
</field>
</record>

</odoo>
15 changes: 15 additions & 0 deletions project_stage_no_quick_create/views/project_task_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="task_type_edit" model="ir.ui.view">
<field name="name">project.task.type.form</field>
<field name="model">project.task.type</field>
<field name="inherit_id" ref="project.task_type_edit" />
<field name="arch" type="xml">
<xpath expr="//field[@name='project_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
17 changes: 17 additions & 0 deletions project_stage_no_quick_create/views/project_task_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<record id="project_view_kanban" model="ir.ui.view">
<field name="name">project.task.kanban</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_kanban" />
<field name="arch" type="xml">
<kanban position="attributes">
<attribute name="group_create">0</attribute>
</kanban>
</field>
</record>

</data>
</odoo>

0 comments on commit 52103ac

Please sign in to comment.