-
- Downloads
[REF] survey: remove unused or unnecessary fields to clean models
PURPOSE As new features are about to land in survey, notably live interactions [1] and new survey building [2] performing a pre cleaning is necessary. In this PR we clean survey models by: removing unnecessary fields, cleaning some code and finally renaming models. SPECIFICATIONS: QUESTION FIELD ON SURVEY.SURVEY On survey.survey, remove question field, unnecessary related on title. Question model holds two fields for its title: ``title`` and ``question``. Question is simply a related on title, making the two fields completely redundant. It is mainly due to historical reasons, when updating models for certifications and eLearning. In this commit we keep only title field and remove the question related field as it adds unnecessary complexity to the model. SPECIFICATIONS: INPUT_TYPE FIELD ON SURVEY.USER_INPUT On survey.user_input, remove input_type and its garbage collect. ``input_type`` field exists on user input model to tell whether answer has been created through invite or through manual click on a survey page. It has been added a long time ago when surveys were either open to everyone, either closed and on invite only. Since eLearning and certification surveys access mode on surveys has evolved. Notably being able to distinguish invite from manual survey user input is not necessary anymore. Indeed what is important is the way people can reach the survey, not how they created their user input. Invitation creates token and this can be used if people effectively want to find invitation-related user inputs. Since 09ea5c7d manual entries still in draft are garbage collected. Reason is still unclear as it is not obvious that tons of unnecessary entries will be created. As this seems like unnecessary optimization this commit removes that feature along with the input_type field. SPECIFICATIONS: REPLACE URLS FIELDS BY METHODS ON SURVEY.{SURVEY, USER_INPUT} On survey.{survey, user_input}, remove url fields replaced by methods In this commit we remove some remaining of URL fields that are better found using methods. Both survey and user input holds a "start" url field that is replaced by a method call ``get_start_url`` on both survey (generic) and user input (token specific) models. We also introduced a ``get_print_url`` method doing the same for the printable version of survey / user input. SPECIFICATIONS: REMOVE CATEGORY FIELD ON SURVEY.SURVEY On survey.survey, remove unused category field. Survey model holds a ``category`` field whose purpose is to be able to somehow categorize surveys according to their use. However using this field is not easy as it is hidden and is a simple selection field. Module should add their own key. Its sole use is in ``hr_recruitment_survey`` which is a niche module. Let us clean models and lessen model complexity. LINKS [0] Related to Task ID 2061901 (survey models cleaning and preparation) [1] Task ID 1972640 (live interactions) [2] Task ID 2119587 (new frontend for building surveys) PR #40765
Showing
- addons/hr_recruitment_survey/__manifest__.py 0 additions, 1 deletionaddons/hr_recruitment_survey/__manifest__.py
- addons/hr_recruitment_survey/data/survey_demo.xml 0 additions, 1 deletionaddons/hr_recruitment_survey/data/survey_demo.xml
- addons/hr_recruitment_survey/models/__init__.py 0 additions, 1 deletionaddons/hr_recruitment_survey/models/__init__.py
- addons/hr_recruitment_survey/models/hr_applicant.py 2 additions, 6 deletionsaddons/hr_recruitment_survey/models/hr_applicant.py
- addons/hr_recruitment_survey/models/hr_job.py 1 addition, 2 deletionsaddons/hr_recruitment_survey/models/hr_job.py
- addons/hr_recruitment_survey/models/survey_survey.py 0 additions, 9 deletionsaddons/hr_recruitment_survey/models/survey_survey.py
- addons/hr_recruitment_survey/views/hr_job_views.xml 1 addition, 1 deletionaddons/hr_recruitment_survey/views/hr_job_views.xml
- addons/hr_recruitment_survey/views/survey_survey_views.xml 0 additions, 13 deletionsaddons/hr_recruitment_survey/views/survey_survey_views.xml
- addons/survey/controllers/main.py 1 addition, 2 deletionsaddons/survey/controllers/main.py
- addons/survey/data/mail_template_data.xml 1 addition, 1 deletionaddons/survey/data/mail_template_data.xml
- addons/survey/data/survey_demo_certification.xml 0 additions, 4 deletionsaddons/survey/data/survey_demo_certification.xml
- addons/survey/data/survey_demo_feedback.xml 0 additions, 4 deletionsaddons/survey/data/survey_demo_feedback.xml
- addons/survey/models/__init__.py 0 additions, 1 deletionaddons/survey/models/__init__.py
- addons/survey/models/ir_autovacuum.py 0 additions, 13 deletionsaddons/survey/models/ir_autovacuum.py
- addons/survey/models/survey_question.py 1 addition, 2 deletionsaddons/survey/models/survey_question.py
- addons/survey/models/survey_survey.py 22 additions, 29 deletionsaddons/survey/models/survey_survey.py
- addons/survey/models/survey_user.py 6 additions, 16 deletionsaddons/survey/models/survey_user.py
- addons/survey/tests/common.py 0 additions, 1 deletionaddons/survey/tests/common.py
- addons/survey/views/survey_question_views.xml 7 additions, 5 deletionsaddons/survey/views/survey_question_views.xml
- addons/survey/views/survey_survey_views.xml 0 additions, 2 deletionsaddons/survey/views/survey_survey_views.xml
Loading
Please register or sign in to comment