-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD]project_ux:state change in project tasks
- Loading branch information
Showing
8 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
############################################################################## | ||
# For copyright and license notices, see __manifest__.py file in module root | ||
# directory | ||
############################################################################## | ||
from odoo import models, fields | ||
|
||
class ProjectTaskType(models.Model): | ||
_inherit = 'project.task.type' | ||
|
||
state_change = fields.Boolean( | ||
default=False, | ||
help="When the task's stage changes, if the state change is checked it will change the state of the task into the state selected" | ||
) | ||
|
||
task_state = fields.Selection(selection=lambda self: self.env['project.task'].fields_get(allfields=['state'])['state']['selection']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
|
||
<record id="task_type_edit_inherited" model="ir.ui.view"> | ||
<field name="name">project.task.type.form.inherited</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="after"> | ||
<label for="state_change"/> | ||
<div class="o_row"> | ||
<field name="state_change"/> | ||
<field name="task_state" invisible='state_change == False'/> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |