View allocation menu added
This commit is contained in:
parent
9c6d16cc8f
commit
580d299184
|
@ -1,13 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, tools
|
||||
from odoo import api, fields, models, tools
|
||||
|
||||
|
||||
class BudgetHrsAnalysis(models.Model):
|
||||
|
||||
_name = "project.consultant.hrs.report"
|
||||
_description = "Project consultant hours analysis report"
|
||||
_rec_name = "project_id"
|
||||
#_order = 'project_id desc, hours_type asc, end_date desc, employee_id'
|
||||
_auto = False
|
||||
|
||||
|
@ -21,6 +22,16 @@ class BudgetHrsAnalysis(models.Model):
|
|||
#roworder = fields.Integer("Row Order")
|
||||
#ptime = fields.Char(string="Time", readonly=True)
|
||||
|
||||
@api.depends('project_id', 'employee_id')
|
||||
def name_get(self):
|
||||
res = []
|
||||
for record in self:
|
||||
name = record.project_id and record.project_id.name or ''
|
||||
if record.employee_id.name:
|
||||
name = record.employee_id.name + '/' + name
|
||||
res.append((record.id, name))
|
||||
return res
|
||||
|
||||
"""def _generate_order_by(self, order_spec, query):
|
||||
order_by = super(BudgetHrsAnalysis, self)._generate_order_by(order_spec, query)
|
||||
print("order by>>>>>>>>>>>>>>", order_by)
|
||||
|
|
|
@ -65,6 +65,23 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!--<record id="project_consultant_hrs_report_calendar" model="ir.ui.view">
|
||||
<field name="name">project.consultant.hrs.report.calendar</field>
|
||||
<field name="model">project.consultant.hrs.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Consultant Allocation"
|
||||
create="0"
|
||||
date_start="start_date"
|
||||
date_stop="end_date"
|
||||
mode="month"
|
||||
quick_add="False"
|
||||
color="project_id">
|
||||
<field name="project_id"/>
|
||||
<field name="employee_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>-->
|
||||
|
||||
<record id="action_project_consultant_hrs_report" model="ir.actions.act_window">
|
||||
<field name="name">Consultant Allocation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -80,6 +97,9 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="View Allocation" id="menu_main_cor_consult_allocation"
|
||||
action="cor_custom.action_project_consultant_hrs_report" sequence="53"
|
||||
groups="base.group_no_one,project.group_project_user"/>
|
||||
|
||||
<record id="project_consul_hours_report_view_form" model="ir.ui.view">
|
||||
<field name="name">Project Consul Report Hours</field>
|
||||
|
|
|
@ -66,5 +66,18 @@
|
|||
<field name="groups" eval="[(4, ref('hr_timesheet.group_hr_timesheet_approver'))]" />
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="project_view_consultant_user_own_rule">
|
||||
<field name="name">Project: view Consultant: Own User</field>
|
||||
<field name="model_id" ref="model_project_consultant_hrs_report"/>
|
||||
<field name="domain_force">[('employee_id.user_id', '=', user.id)]</field>
|
||||
<field name="groups" eval="[(4,ref('base.group_project_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="project_view_consultant_manager_rule">
|
||||
<field name="name">Project: view Consultant: see all</field>
|
||||
<field name="model_id" ref="model_project_consultant_hrs_report"/>
|
||||
<field name="domain_force">[(1, '=', 1)]</field>
|
||||
<field name="groups" eval="[(4,ref('project.group_project_manager'))]"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
Loading…
Reference in New Issue