Files
odoo_source/addons/survey/security/ir.model.access.csv
T
David Beguin be9461bf8b [IMP] gamification, survey : apply badge on certification survey
This commit allow gaining a badge at the end of a certification survey if succeeded.
The badge can be configured on the survey if the certification mode is activated.

The badge is linked directly to the survey and not the challenge,
because it makes more sense to configure directly the reward on the survey and
not the way to gain this reward. As the way is always the same.
Only one badge can be set on the certification survey.
Only the name, description, image and badge level can be configured.
The rest of badge configuration is automatically set to correspond to the use case.
When a badge is configured on a certification survey, the needed challange, goal
and challenge line are autogenerated.

The badge is available on the user's profile page if he gained it.

Once the badge is configured on the survey, he cannot be changed
(remove + create new one), only modified (badge attributes edition).
The only way to remove the badge is to uncheck 'certification_give_badge'.

When removing the badge from the certification survey, all the autogenerated
records (at badge creation) are deleted to avoid ghost records (as they have
no purpose outside of this context). If the badge is owned by someone, the badge
is only archived. If nobody owns the badge, the badge is deleted.

Survey users now have the right to create badges but not challenges or goals.
All the autogenerated records are handled in sudo, to allow the survey user
to configure a badge on their survey.

Note : To avoid having to rewrite the complete context in an xpath expression
only to display the certification badge on the user's profile page,
the default website_published value of the certification badge is defined
directly in the survey module even if survey does not depend of website.
This attribute will be ignored until website module is installed.

Task ID : 1935136
Closes PR #31486
2019-07-15 08:16:43 +00:00

2.2 KiB

1idnamemodel_id:idgroup_id:idperm_readperm_writeperm_createperm_unlink
2access_survey_allsurvey.survey.allmodel_survey_survey0000
3access_survey_usersurvey.survey.usermodel_survey_surveybase.group_user0000
4access_survey_survey_usersurvey.survey.survey.usermodel_survey_surveygroup_survey_user1111
5access_survey_survey_managersurvey.survey.survey.managermodel_survey_surveygroup_survey_manager1111
6access_survey_question_allsurvey.question.allmodel_survey_question0000
7access_survey_question_usersurvey.question.usermodel_survey_questionbase.group_user0000
8access_survey_question_survey_usersurvey.question.survey.usermodel_survey_questiongroup_survey_user1111
9access_survey_question_survey_managersurvey.question.survey.managermodel_survey_questiongroup_survey_manager1111
10access_survey_label_allsurvey.label.allmodel_survey_label0000
11access_survey_label_usersurvey.label.usermodel_survey_labelbase.group_user0000
12access_survey_label_survey_usersurvey.label.survey.usermodel_survey_labelgroup_survey_user1111
13access_survey_label_survey_managersurvey.label.survey.managermodel_survey_labelgroup_survey_manager1111
14access_survey_user_input_allsurvey.user_input.allmodel_survey_user_input0000
15access_survey_user_input_usersurvey.user_input.usermodel_survey_user_inputbase.group_user0000
16access_survey_user_input_survey_usersurvey.user_input.survey.usermodel_survey_user_inputgroup_survey_user1111
17access_survey_user_input_survey_managersurvey.user_input.survey.managermodel_survey_user_inputgroup_survey_manager1111
18access_survey_user_input_line_allsurvey.user_input_line.allmodel_survey_user_input_line0000
19access_survey_user_input_line_usersurvey.user_input_line.usermodel_survey_user_input_linebase.group_user0000
20access_survey_user_input_line_survey_usersurvey.user_input_line.survey.usermodel_survey_user_input_linegroup_survey_user1111
21access_survey_user_input_line_survey_managersurvey.user_input_line.survey.managermodel_survey_user_input_linegroup_survey_manager1111
22access_gamification_badge_survey_usergamification.badge.survey.usermodel_gamification_badgegroup_survey_user1111