[IMP] sale_timesheet: remove warning when allow_billable changes
Before this commit, when the user unchecks the allow_billable, we display a warning to alert him the impact of this changes. This commit removes this warning because we don't need it now, the user knows the impacts of this changes. task-2442683
This commit is contained in:
committed by
Yannick Tivisse
parent
af188dfb44
commit
74f07717d0
@@ -148,15 +148,6 @@ class Project(models.Model):
|
||||
if project.sale_line_id.is_expense:
|
||||
raise ValidationError(_("A billable project should be linked to a Sales Order Item that does not come from an expense or a vendor bill."))
|
||||
|
||||
@api.onchange('allow_billable')
|
||||
def _onchange_allow_billable(self):
|
||||
if self.task_ids._get_timesheet() and self.allow_timesheets and not self.allow_billable:
|
||||
message = _("All timesheet hours that are not yet invoiced will be removed from Sales Order on save. Discard to avoid the change.")
|
||||
return {'warning': {
|
||||
'title': _("Warning"),
|
||||
'message': message
|
||||
}}
|
||||
|
||||
def write(self, values):
|
||||
res = super(Project, self).write(values)
|
||||
if 'allow_billable' in values and not values.get('allow_billable'):
|
||||
|
||||
Reference in New Issue
Block a user