Change dependency from project_plan to project_allocation

This commit is contained in:
Jared Esparza 2021-01-22 11:16:40 +01:00
parent 0040c78de4
commit 0060c8f071
3 changed files with 3 additions and 14 deletions

11
role.py
View File

@ -33,15 +33,6 @@ class Work(metaclass=PoolMeta):
role_employee = fields.Function(fields.Char('Role Employee'),
'get_role_employee', searcher='search_role_employee')
@classmethod
def __setup__(cls):
super().__setup__()
# Enables allocations in Project type task
# allowing children task inheritthe parent allocations
cls.allocations.states['invisible'] &= Eval('type') != 'project'
if not 'type' in cls.allocations.depends:
cls.allocations.depends.append('type')
@fields.depends('parent', 'allocations', '_parent_parent.id')
def on_change_parent(self):
pool = Pool()
@ -64,7 +55,6 @@ class Work(metaclass=PoolMeta):
new_allocation = Allocation()
new_allocation.role = allocation_parent.role
new_allocation.employee = allocation_parent.employee
new_allocation.percentage = 100.00
allocations.append(new_allocation)
self.allocations += tuple(allocations)
@ -91,7 +81,6 @@ class Work(metaclass=PoolMeta):
allocation = Allocation()
allocation.role = role
allocation.employee = Configuration(1).default_allocation_employee
allocation.percentage = 100.0
allocations.append(allocation)
self.allocations += tuple(allocations)

View File

@ -40,12 +40,12 @@
<record model="ir.ui.view" id="allocation_view_form">
<field name="model">project.allocation</field>
<field name="name">allocation_form</field>
<field name="inherit" ref="project_plan.allocation_view_form"/>
<field name="inherit" ref="project_allocation.allocation_view_form"/>
</record>
<record model="ir.ui.view" id="allocation_view_tree">
<field name="model">project.allocation</field>
<field name="name">allocation_tree</field>
<field name="inherit" ref="project_plan.allocation_view_tree"/>
<field name="inherit" ref="project_allocation.allocation_view_tree"/>
</record>
<!-- add role to task list view -->

View File

@ -2,7 +2,7 @@
version=5.4.0
depends:
ir
project_plan
project_allocation
project_phase
#Required for configuration only
project_sequence