Commit Graph
41 Commits
Author SHA1 Message Date
wde-odoo 1fb99d79b1 [IMP] survey: improve survey usability in backend
PURPOSE

This commit globally improves the backend survey module usability, notably by
renaming labels, moving menu items around and cleaning unused features.

SPECIFICATIONS

These changes include (non-exhaustive list):

On questions

  - Changing labels, action helpers and modules description to be clearer;
  - Re-organizing the survey.question form view, notably to clearly distinguish
    fields related to answers and validation options;
  - Removing the "Clean test answers" server action as it can be done through
    a search + unlink;
  - Removing the allow_value_image field as we now always display the
    image field. Users simply choose to let it blank;

On surveys

  - Re-organizing the survey.survey form view fields to get a clear view of
    the various options;
  - automatically update scoring type when checking certification: if not one
    linked to scoring, update to scoring without answers;
  - set create as create_multi to speedup batch creation;
  - Changes ACL rights for user_input_line. Now, only Survey Managers can
    change answers. Survey users keep only a read access on answers, meaning
    changing what customers / people answered is now limited to managers;

Globally

  - Moving menu items and make them visible outside debug mode;
  - Answer recap on print frontend page is now visible whenever a scoring is
    applied, not only for certification, as if scoring is activated seeing
    answers is probably wanted;

Task-2600241

closes odoo/odoo#79813

Related: odoo/upgrade#3033
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-01 18:39:45 +00:00
Martin Trigaux 65530dfd6a [ADD] *: add ir.model.access on all transient models
Following changes needing ir.model.access on transient models too.
Remove groups declaration on the action to move it to ir.model.access
when possible.
Rules are strict by default with no unlink access by default and high
priviledge asked. Adaptations may be needed later.
Write access is given as a wizard may need to be modified in case the
action triggers an error and the user has to correct a value

account*: use account.group_account_user for all transient by default
	  remove account.print.journal relic
stock*: use stock.group_stock_user by default
survey: survey user can send invitations
mail: allow any employee to execute wizards
      additional verifications are made to ensure they are executed
      only on the documents the user has access to you
      give portal access to mail.compose.message as portal still does
      some actions like posting messages on the forum
      add ir.rule to avoid reading somebody else messages
      increase the query count because of undeterminist count
crm: saleman for lead2opp, manager for massmailing
     partner manager for actions linked to partners
     avoid a write in test_lead_lost
sms: any employee can send sms
mrp: mrp user can execute wizards
     give unlink access as making write during do_produce operation
base_import: employees can import files
delivery: stock user can deliver
event_sale: sale user can configure the wizards
	    event user inherit from  sale rights
gamification: employee can give badge
google_service: resolve FIXME
hr: add specific rights
    manager can set a plan according to group on button
    anyone who can write on an employee can register a departure
hr_expense: set rights based on buttons
hr_holidays: an approver can make a summary report
hr_recruitment: recruiter can refuse a candidate
hr_timesheet: can use the wizard if can create a timesheet
l10n_eu_service: managers can create fiscal positions
mass_mailing: same group as on mass.mailing.list
membership: accountant can create invoice from membership
payment: accountant can create a link
	 as the source is an account.move
	 keep the payment.acquirer.onboarding.wizard to system user
	 only as it is called during company configuration
point_of_sale: PoS manager only can use wizards
	       never create closing_balance_confirm_wizard records
product_expiry: stock user has rights on stock.picking
product_margin: access from accounting menus
repair: same rules as for above models
sale: set ir.rule for self wizard only
      add rule from model introduced in payment to add salesman group
sale_crm: saleman can create a quotation from a lead
sale_coupon: any saleman can generate coupon
	     add self ir.rule
sale_product_configurator: salesman can select product variants
snailmail: employee can send letters
website: designers can write on website
website_crm_partner_assign: same rule as group on action
website_sale: sale ACL as for payment.acquirer.onboarding.wizard
website_slides: anyone can send invitation

base: base.language.*: allow employee (cf lang_install)
      change.password.user: can not read change password wizard of
      other users
      test.*: no access is needed

Courtesy of Damien Bouvy, William Andre and Antoine Prieëls for review
of acl
2020-02-04 17:54:18 +01:00
Thibault Delavallée 7edeb24de9 [REF] survey: globally rename survey.user_input_line model to survey.user_input.line
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

Main user answer model is ``survey.user_input``. It holds lines related to
answers given to specific questions. In this commit we rename this model from
``survey.user_input_line`` to ``survey.user_input.line`` to be coherent with
general odoo naming guidelines.

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
2019-12-05 15:21:28 +00:00
Thibault Delavallée 2592e72f2c [REF] survey: globally rename survey.label model to survey.question.answer
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

In this commit we rename the long standing ``survey.label`` model. Indeed
a label is something before a question, like an input label. Labels in survey
are used for suggested answers and sometimes as rows for matrix answers.

After much thoughts we rename ``survey.label`` to ``survey.question.answer``.
It indicates this model holds answers. Moreover it is namespaced within the
``survey.question`` model name to avoid conflict with user input / user answer
model.

As model naming changes, some fields also evolve. In survey.question model

  * ``labels_id`` is renamed to ``suggested_answer_ids`` to indicate it is
    used to display suggested values to the user;
  * ``labels_id_2`` is renamed to ``matrix_row_ids`` to indicate it is used
    to generate the rows of the matrix-type question. A matrix is therefore
    done using ``matrix_row_ids`` for rows and ``suggested_answer_ids`` for
    columns which seems easier to understand;

In survey.question.answer (old survey.label) model

  * ``question_id_2`` is renamed to ``matrix_question_id`` to ease its
    understanding, notably that it is used for matrix questions;

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
2019-12-05 15:21:28 +00:00
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
Victor Feyens 50caae5bc0 [REF] survey: replace dynamic survey.stage by a static state on survey.survey
Stages modification through the clickable statusbar wasn't very intuitive.
By fixing default behavior through states (and corresponding buttons), default user experience is simplified.

3 static states available : draft, open, closed

Form view: navigation through states with buttons
Kanban view: disabled modification of survey state

Task ID : 1949110

closes odoo/odoo#32325

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-25 14:17:45 +00:00
Aurélien Warnon dba4783326 [REF] survey: convert survey.page to survey.question -> is_page=True
Task #1902306

Purpose
=======

survey.question is now also the model used for the survey's pages (with the "is_page" field set to True).
This allows to put all the pages and questions together in a o2m field on the view side and
easily reorganize your survey by dragging the items around.

It also removes one level of encoding by directly having 'Add a page' and 'Add a question'
links on the tree view of questions, enabling a faster encoding.

However, this has the downside of making the code reading a little bit more complicated.
Efforts were made at the model level to create computed fields so that the use of these models
still seems somewhat logical. That means:
- A survey still has "page_ids" (question_and_page_ids filtered on is_page = True)
- These "page_ids" still have question_ids (questions located between this page and the next)
- These "question_ids" still have a "page_id"

That makes the use and display of these information at view and controller levels easier to understand.
2019-02-06 09:37:59 +00:00
Thibault Delavallée e3d2957f98 [REF] survey: update ACLs and limit access to survey models
Purpose of this commit is to rewrite all access rights and rules of survey
models. Indeed this module is quite old and rules may give some strange
permissions to some people and does not enforce the use of real survey
user groups.

Specifications
 * survey manager: can CRUD everything;
 * survey users: can CRUD their own surveys, read all;
 * regular users: cannot access anything and will use dedicated controllers
   and routes;
 * portal, public: cannot access anything and will use dedicated controllers
   and routes;

This commit alone breaks some use of survey, notably its embedded portal.
Future commit will update code to use those new ACLs. It is done in several
commits in order to have smaller diff and avoid having too large diff in a
single commit.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Richard Mathot 2e760407e4 [FIX] survey: enable survey access to portal users instead of 404 2014-05-21 13:42:17 +02:00
Richard Mathot (OpenERP) e7766719fe [FIX] Fixing things & views with comment answers
bzr revid: rim@openerp.com-20140409085216-5knre0uoxygunazr
2014-04-09 10:52:16 +02:00
Richard Mathot (OpenERP) 21b7829c70 [ADD] New stage for surveys
bzr revid: rim@openerp.com-20140320153351-xgj5j164ixmwxaj6
2014-03-20 16:33:51 +01:00
Richard Mathot (OpenERP) 522b8ca196 [IMP] Security rules
bzr revid: rim@openerp.com-20131231110914-bz4njdxfqpjv3do4
2013-12-31 12:09:14 +01:00
Richard Mathot (OpenERP) acedaa3eff [FIX] Bad access rights
bzr revid: rim@openerp.com-20131212080810-0m0y0146pcn9ngfj
2013-12-12 09:08:10 +01:00
Richard Mathot (OpenERP) 886f5e0d21 [FIX] Access rights on surveys for public users
bzr revid: rim@openerp.com-20131119132917-tuvp2r57vz7lwjc0
2013-11-19 14:29:17 +01:00
Richard Mathot (OpenERP) c5ff225a16 [IMP] Server side validation
bzr revid: rim@openerp.com-20131115151435-ht5eg6e6vfiydibe
2013-11-15 16:14:35 +01:00
Richard Mathot (OpenERP) 0e45d81546 [IMP] Fixing first view of survey + logic bugs
bzr revid: rim@openerp.com-20131028144314-cjy5rexani70ikhc
2013-10-28 15:43:14 +01:00
Richard Mathot (OpenERP) 15d7695189 [IMP] Models refactoring (again)
bzr revid: rim@openerp.com-20131028075121-odgv1f4en47vvtr3
2013-10-28 08:51:21 +01:00
Richard Mathot (OpenERP) 848e212986 [IMP] Enhancements to survey.survey fields
bzr revid: rim@openerp.com-20131023090342-m3x111pd2byd7sez
2013-10-23 11:03:42 +02:00
Richard Mathot (OpenERP) 31c582874d [REF] Importing previous work by chm
bzr revid: rim@openerp.com-20131021090319-zbi93frwqpcvxkk9
2013-10-21 11:03:19 +02:00
Saurang Suthar (OpenERP) 703da5b93a [FIX]res.partner.address removed from the respective modules
bzr revid: ssu@tinyerp.com-20120307054759-dsp0r4n1pbf8x4hg
2012-03-07 11:17:59 +05:30
Fabien Pinckaers f27318c8af [IMP] Security Rule: removed duplicates due to inheritancies of groups
bzr revid: fp@tinyerp.com-20111212181113-mhnnbps3ip8ls6pp
2011-12-12 19:11:13 +01:00
Jigar Amin 4c0cd7b7ed [BUF/FIX] survey, base_calendar : added new access rights for the Survey/User for Invited user of the Survey
lp bug: https://launchpad.net/bugs/730651 fixed

bzr revid: jam@tinyerp.com-20110308125911-pzwecd8396dxjnib
2011-03-08 18:29:11 +05:30
DBR (OpenERP) e711609f26 [MOD/IMP] survey : Usability Improvement in Accessrights
bzr revid: dbr@tinyerp.com-20101006103657-2579vov188co0oc9
2010-10-06 16:06:57 +05:30
Vir (Open ERP) 5afbd9c663 [MOD] Survey : Improvements in access rights
bzr revid: vir@tinyerp.com-20101006092807-yctppi8ub7t8jx8s
2010-10-06 14:58:07 +05:30
AMP (OpenERP) 0888189083 [MOD/IMP] tools : Survey,Idea,Lunch,Subscription Usability improvement in access rights
bzr revid: amp@tinyerp.com-20101005133252-hz7jww5xuzjrxal1
2010-10-05 19:02:52 +05:30
AMP (OpenERP) 7ed2a8b8b6 [MOD/IMP] survey: Improvements in survey wizrd,view,groups and access rights
bzr revid: amp@tinyerp.com-20100929060549-h3g518f6e6ertu3t
2010-09-29 11:35:49 +05:30
Vir (Open ERP) aaea54012a [FIX,MOD] hr_*, survey : problem with access rights are sovled
bzr revid: vir@tinyerp.com-20100917120814-e45m5gwpqvrirk8y
2010-09-17 17:38:14 +05:30
Vir (Open ERP) f4d26a7016 [MOD/IMP] hr : access rights improved. idea : label for state changed,subscription: tooltip added, survey : improved access rights,and small changes
bzr revid: vir@tinyerp.com-20100916113351-61sfyn6d0okgsw7t
2010-09-16 17:03:51 +05:30
Vir (Open ERP) 7cc2e27105 [MOD/IMP] survey : Usability Improvements
bzr revid: vir@tinyerp.com-20100906071537-q5o6icri0z9ifc08
2010-09-06 12:45:37 +05:30
AMP(Open ERP) 53cfaebe3f [MOD/IMP] survey,account,email_template,idea,lunch,marketing_campaign,sale,stock_planning : Improvements in access rights
bzr revid: vir@tinyerp.com-20100813060634-laq3wb2d660wcrrp
2010-08-13 11:36:34 +05:30
amp(Open ERP) 17960cb1d8 [MOD/IMP] crm_* : Improvements in access rights
bzr revid: vir@tinyerp.com-20100809133419-1wvxnxgk7rll77hq
2010-08-09 19:04:19 +05:30
Vir (Open ERP) 253983a1e8 [REMOVE] survey : removed not required access rights
bzr revid: vir@tinyerp.com-20100809105254-huib4j18objmh0ob
2010-08-09 16:22:54 +05:30
AMP (OpenERP) d4dca3e313 [MOD] survey: usability improvement in access rights
bzr revid: amp@tinyerp.com-20100807113657-epjetandhb7462f8
2010-08-07 17:06:57 +05:30
DBR (OpenERP) a446dfb18e [MOD] hr_* :Improvement in hr_* modules groups and accessright
bzr revid: dbr@tinyerp.com-20100803131117-jkvf2a7pe955en2u
2010-08-03 18:41:17 +05:30
AMP (OpenERP) 39d1c31b49 [MOD] usability improvement and changes in access rights
bzr revid: amp@tinyerp.com-20100730130247-1hvssj5z0f9gvd3a
2010-07-30 18:32:47 +05:30
AMP (OpenERP) 7e0180c254 [MOD] usability improvement in access rights
bzr revid: amp@tinyerp.com-20100729133057-gdhqqohzpkdnq8vl
2010-07-29 19:00:57 +05:30
UCO (OpenERP) 3217cf7e4c [REM]: Removed access rules for OSV memory objects
bzr revid: rpa@tinyerp.com-20100628134938-23kiccr4355jfhmg
2010-06-28 19:19:38 +05:30
Ysa (Open ERP) 0c0bb21537 [IMP] survey :- add access rules.
bzr revid: ysa@tinyerp.co.in-20100329104203-i303jmibqjybyazf
2010-03-29 16:12:03 +05:30
uco (OpenERP) 0c3e9788cb [ADD]: Added access rules for remaining objects in hr_evaluation and survey modules.
bzr revid: uco@tinyerp.co.in-20100305111348-v7f2smhx0yqdu295
2010-03-05 16:43:48 +05:30
ysa, apa 76a8a995a1 [ADD] survey, hr_evaluation : taken from trunk-extra-addons branch
bzr revid: hmo@tinyerp.com-20100120142828-zc25st2aqfrn4mop
2010-01-20 19:58:28 +05:30