OCA/project-service — pull request #48 by katyukha (2014-12-11 15:20:22+00:00)
Title: Project SLA: refactoring and improvement, to make it more generic

What is done:
1. Added 'start_field_id' field to 'project.sla' model same as
'control_field_id' field. This will make simpler integration with
objects that have no 'create_date' field, or such field have other
name. Also this will allow to control not only time from
confirmation, but any cobination of date fields of object (model)
2. Added sql constraints to check if 'limit_qty' and 'warn_qty' entered
correctly.
3. Partly fixed bug when control field is of type 'date' not 'datetime'
Partly, because of, may be, incorect calculation of time when not
exact time specified. but now it will not throw error.
May be start using UoMs here, to be able calculate time diferences
in hours or days, what can be choosed by user?
4. Bugfix with user_id. Now there no errors will be thrown on attempt
to create SLA for model, which has no 'user_id' field
5. Changed code, that checks for ```doc.state != 'cancelled'``` to
```doc.state not in ('cancelled', 'cancel')``` because of
'cancelled' state is not standard in other apps, in most apps
'cancel' state used instead
6. Views refactoring. Especialy tree view added for 'project.sla'
model, which shows model name and control field names in tree.