remove 0.0 value while create first record

This commit is contained in:
Pawan Kumar 2020-12-31 17:50:33 +05:30
parent 2991de3d8f
commit 65b5ae5c01
1 changed files with 12 additions and 10 deletions

View File

@ -119,13 +119,15 @@ class InheritProjectProductEmployeeMap(models.Model):
for val in self:
val.cost = val.budgeted_qty * val.price_unit
# @api.onchange('employee_id', 'budgeted_qty')
# def onchange_(self):
# for val in self:
# rec = 0.0
# if val.project_id.project_type == 'hours_in_consultant':
# print('555555555')
# rec = rec + rec.budgeted_qty
# print('66666666666666666', rec)
# print('777777777', rec)
# self.budgeted_hours = rec
@api.depends('sale_line_id', 'sale_line_id.price_unit', 'timesheet_product_id')
def _compute_price_unit(self):
for line in self:
if line.sale_line_id:
line.price_unit = line.sale_line_id.price_unit
line.currency_id = line.sale_line_id.currency_id
elif line.timesheet_product_id:
line.price_unit = line.timesheet_product_id.lst_price
line.currency_id = line.timesheet_product_id.currency_id
else:
#line.price_unit = 0
line.currency_id = False