Merge branch 'pawan_branch' into 'development'

update timesheet hour issue

See merge request prakash.jain/cor-odoo!65
This commit is contained in:
pawan.sharma 2021-01-07 00:32:13 -08:00
commit 629b9f8af6
1 changed files with 4 additions and 2 deletions

View File

@ -65,6 +65,7 @@ class Project(models.Model):
employee_hour = fields.Float(string='Employee Hour')
def _compute_consultant_timesheet_hours(self):
print('222222222222')
for record in self:
consultant_cost = 0.0
for rec in record.sale_line_employee_ids:
@ -155,7 +156,7 @@ class InheritProjectProductEmployeeMap(models.Model):
readonly=False)
sale_line_id = fields.Many2one('sale.order.line', "Service", domain=[('is_service', '=', True)])
cost = fields.Float("Cost", default=0.0, store=True)
consultant_cost = fields.Float("Actual Cost")
consultant_cost = fields.Float("Actual Cost", compute='_compute_timesheet_hour', default=0.0)
hour_distribution = fields.Selection(related='project_id.hour_distribution')
role = fields.Selection([('Manager', 'Manager'),
@ -173,6 +174,7 @@ class InheritProjectProductEmployeeMap(models.Model):
val.timesheet_hour = res[2]
else:
val.timesheet_hour = 0.0
val.consultant_cost = val.timesheet_hour * val.employee_price
# Run another method
# val.project_id.onchange_compute_values()
@ -199,7 +201,7 @@ class InheritProjectProductEmployeeMap(models.Model):
else:
val.cost = 0.0
# val.cost = val.budgeted_qty * val.price_unit
val.consultant_cost = val.timesheet_hour * val.employee_price
#val.consultant_cost = val.timesheet_hour * val.employee_price
#self.project_id.onchange_budgeted_hour()
@api.depends('sale_line_id', 'sale_line_id.price_unit', 'timesheet_product_id')