List view and read group added
This commit is contained in:
parent
2f7f22407b
commit
ec53a365d7
|
@ -23,6 +23,13 @@ class PlanningShift(models.Model):
|
|||
('project_required_if_task', "CHECK( (task_id IS NOT NULL AND project_id IS NOT NULL) OR (task_id IS NULL) )", "If the planning is linked to a task, the project must be set too."),
|
||||
]
|
||||
|
||||
@api.model
|
||||
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
|
||||
if 'budgeted_hours' in fields:
|
||||
fields.remove('budgeted_hours')
|
||||
return super(PlanningShift, self).read_group(domain, fields, groupby, offset, limit, orderby, lazy)
|
||||
|
||||
|
||||
@api.depends('project_id', 'employee_id')
|
||||
def _compute_budgeted_hours(self):
|
||||
for slot in self:
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
<field name="inherit_id" ref="planning.planning_view_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='role_id']" position="after">
|
||||
<field name="project_id" optional="hide"/>
|
||||
<field name="task_id" optional="hide"/>
|
||||
<field name="project_id"/> <!-- optional="hide" -->
|
||||
<field name="task_id"/>
|
||||
<field name="budgeted_hours"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue