Merge branch 'pawan_branch' into 'development'

remove 0.0 value while create first record

See merge request prakash.jain/cor-odoo!44
This commit is contained in:
pawan.sharma 2020-12-31 04:21:18 -08:00
commit 240a35a227
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