add field for consultant distribution
This commit is contained in:
parent
bf055a3acc
commit
f6925cb5bd
|
@ -21,8 +21,7 @@ class Project(models.Model):
|
|||
project_type = fields.Selection([
|
||||
('hours_in_consultant', 'Hours are budgeted according to a consultant'),
|
||||
('hours_no_limit', 'Total hours are budgeted without division to consultant'),
|
||||
('no_limit', 'Projects that have no time limit')
|
||||
], string="Project Type", default="no_limit")
|
||||
], string="Project Type", default="hours_in_consultant")
|
||||
|
||||
privacy_visibility = fields.Selection([
|
||||
('followers', 'Invited internal users'),
|
||||
|
@ -44,7 +43,7 @@ class InheritProjectProductEmployeeMap(models.Model):
|
|||
_inherit = 'project.sale.line.employee.map'
|
||||
|
||||
employee_price = fields.Monetary(string="Consultant Price", related="employee_id.timesheet_cost", readonly=True)
|
||||
budgeted_qty = fields.Float(string='Budgeted Hours', related='sale_line_id.product_uom_qty', readonly=True, store=True)
|
||||
budgeted_qty = fields.Float(string='Budgeted Hours', store=True)
|
||||
budgeted_uom = fields.Many2one('uom.uom', string='Budgeted UOM', related='sale_line_id.product_uom', readonly=True)
|
||||
#budgeted_uom = fields.Many2one('uom.uom', string='Budgeted UOM', related='timesheet_product_id.uom_id', readonly=True)
|
||||
timesheet_hour = fields.Float("Timesheet Hour", compute='_compute_timesheet_hour', default=0.0)
|
||||
|
@ -69,3 +68,5 @@ class InheritProjectProductEmployeeMap(models.Model):
|
|||
val.budgeted_hour_week = (val.budgeted_qty /val.employee_id.budgeted_hour_week)
|
||||
else:
|
||||
val.budgeted_hour_week = 0
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
<field name="pricing_type"
|
||||
attrs="{'invisible': ['|', ('allow_billable', '=', False), ('bill_type', '!=', 'customer_project')], 'required': ['&', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}"
|
||||
widget="radio"/>
|
||||
<field name="project_type" attrs="{'invisible': [('pricing_type', '=', 'fixed_rate')]}"
|
||||
widget="radio"/>
|
||||
<div class="o_td_label"
|
||||
attrs="{'invisible': ['|', '|', ('allow_timesheets', '=', False), ('sale_order_id', '!=', False), '&', ('pricing_type', '!=', 'fixed_rate'), ('bill_type', '!=', 'customer_task')]}">
|
||||
<label for="timesheet_product_id" string="Default Service"
|
||||
|
@ -58,21 +60,22 @@
|
|||
<field name="company_id" invisible="1"/>
|
||||
<field name="project_id" invisible="1"/>
|
||||
<field name="employee_id" options="{'no_create': True}" string="Consultant Name"/>
|
||||
<field name="timesheet_product_id"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '!=', False)]}"/>
|
||||
<field name="sale_line_id" options="{'no_create': True}"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}"
|
||||
domain="[('order_id','=',parent.sale_order_id), ('is_service', '=', True)]"/>
|
||||
<!--<field name="budgeted_uom"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}"/>-->
|
||||
<field name="price_unit" widget="monetary" options="{'currency_field': 'currency_id'}"
|
||||
attrs="{'readonly': [('parent.sale_order_id', '!=', False)]}"/>
|
||||
<field name="budgeted_qty"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}"/>
|
||||
<field name="budgeted_qty" attrs="{'readonly': [('parent.project_type', '=', 'hours_no_limit')]}"/>
|
||||
<field name="timesheet_hour"/>
|
||||
<!--<field name="employee_price" widget="monetary" options="{'currency_field': 'currency_id'}"/>-->
|
||||
<field name="currency_id" invisible="1" readonly="1"/>
|
||||
<field name="budgeted_hour_week"/>
|
||||
<field name="currency_id" invisible="1" readonly="1"/>
|
||||
<!--<field name="timesheet_product_id"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '!=', False)]}"/>-->
|
||||
<!--<field name="budgeted_uom"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}"/>-->
|
||||
<!--<field name="budgeted_qty"
|
||||
attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}"/>-->
|
||||
<!--<field name="employee_price" widget="monetary" options="{'currency_field': 'currency_id'}"/>-->
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
|
Loading…
Reference in New Issue