Merge branch 'development' of http://103.74.223.20:8085/prakash.jain/cor-odoo into development

This commit is contained in:
projectsodoo 2021-02-18 13:58:50 +05:30
commit 84a6c49ffb
1 changed files with 5 additions and 1 deletions

View File

@ -104,13 +104,17 @@ class AccountAnalyticLine(models.Model):
if rec.end_time < rec.start_time:
raise exceptions.ValidationError(_('End time cannot be earlier than Start time'))
@api.onchange('start_time', 'end_time')
@api.onchange('start_time', 'end_time', 'start_datetime', 'end_datetime')
def _onchange_start_end_time(self):
if self.start_time > 0 and self.end_time > 0:
res = self.end_time - self.start_time
if res <= 0:
raise ValidationError(_("End time cannot be earlier than Start time"))
self.unit_amount = res
# if self.start_datetime and self.end_datetime:
# res1 = self.end_datetime - self.start_datetime
# print('ressssssssss', res1)
# self.unit_amount = res1
@api.model
def export_data(self, fields):