mirror of
https://bitbucket.org/presik/trytonpsk-rental.git
synced 2023-12-14 06:53:01 +01:00
Add res to confirm service
This commit is contained in:
parent
65e54bc177
commit
f87191344d
|
@ -301,6 +301,12 @@ class Service(Workflow, ModelSQL, ModelView):
|
|||
rec.send_rental_emails()
|
||||
rec.equipment.write([rec.equipment], {'status': 'not_available'})
|
||||
|
||||
res = {
|
||||
'status': 'success',
|
||||
'msg': 'Agreement confirmed, please check your mail for more details!'
|
||||
}
|
||||
return res
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('done')
|
||||
|
@ -385,7 +391,7 @@ class Service(Workflow, ModelSQL, ModelView):
|
|||
if end_date:
|
||||
for rec in records:
|
||||
if isinstance(end_date, str):
|
||||
rec.end_date = datetime.strptime(end_date, format)
|
||||
rec.end_date = datetime.strptime(end_date, format).date()
|
||||
values['hiring_time'] = rec.on_change_with_hiring_time()
|
||||
super(Service, cls).write(records, values)
|
||||
|
||||
|
|
Loading…
Reference in a new issue