Commit Graph
68 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
Yannick Tivisse 4c291e3f70 [IMP] base: Display searchpanel on ir.module.module views
Purpose
=======

The current kanban view is messy. It is difficult to identify which
apps are installed or not. The user can completely miss a module
that might have interested him. A search panel would make things way
more readable.

closes odoo/odoo#44401

Taskid: 2181557
Related: odoo/enterprise#8144
Related: odoo/upgrade#879
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-05 14:03: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
jbm-odoo ec07e72845 [IMP] base,*: Reorganize access rights groups
Purpose
=======

Access group terminology is missleading. Yous have to be manager to administrate
an application. This task consists to rename groups to be understandable for everyone.

Groups should be reorganised on the users form to be more explicit.

Specification
=============

1/ Rename 'Manager' to 'Administrator' in users groups.
2/ Define a hierarchy on access groups by using the category_id in the manifests
   A category 'Operations/Project' will create a category Project with a parent
   category 'Operations', and something smart is already developed (in modules/db.py)
   to avoid duplicating categories.
3/ Add a group in expenses to be able to approve expenses reports for my team.
4/ Add a group in timesheets to be able to approve timesheets for my team.
5/ Remove partially the useless crap in ir_module_category_data.xml
6/ Sort access rights groups on users form according to its parent category

closes odoo/odoo#29362

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 09:08:12 +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
Aurélien Warnon 3ea91f397f [FIX] survey: typo in survey security groups
The rule "survey_stage_rule_survey_user_read" was applied on the model
"survey.model_survey_page" instead of "survey.model_survey_stage".

closes odoo/odoo#30342
2019-01-18 10:02:37 +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
Raphael Collet 2f7c03d9ca [IMP] base: add regular user admin as uid 2
User 1 simply becomes a technical user (inactive, no password).
2018-08-23 21:38:57 +02:00
Christophe Simonis 0cefaad370 [MERGE] forward port branch 9.0 up to 2c5fe07fc7 2018-03-21 11:35:58 +01:00
Martin Trigaux 9fd5df4305 [FIX] survey: add missing groups
Survey Users have a correct record rule but portal and employee had no rule,
being able to read more records than a Survey User

Closes #23675
2018-03-16 13:58:25 +01: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
Thibault Delavallée efd55ab8a5 [REF] various: rename openerp node to odoo in xml files 2016-08-10 15:48:10 +02:00
Yannick Tivisse 1ecba213f4 [IMP] Newly created users get all manager access right
Coming from a bug in web_settings_dashboard. Invited user didn't have any rights
when created from the dashboard, which was leading to an error.

This bug leaded to a new discussion. Better to have basic employee having user
rights for all main applications. For bigger entreprises there is an admin that
will carefully remove extra rights, if necessary. The target is small businesses,
it makes sense that every way to create a user gives the same result.

In conclusion, each new user has a full access to the applications by default

How is it implemented ?
We added an inactive default user which original access right to the groups
'base.group_user' and 'base.group_partner_manager' in base. Each
application will extend the default user's access right by adding the maximal
access right for this application.

On user creation, we will use by default the 'group_id' field from the default
user. We will in the same time remove the ugly 'default_groups_ref' key which
was passed sometimes in the context for some fields in some views, and sometimes
nothing.

So, the user can modify the access rights for the default user, but he should be
aware that removing project user access rights for a default user will prevent
a *created on the fly in a task* user will not be able to access the task.
2015-11-20 16:27:32 +01:00
Christophe Simonis 73e652818b [MERGE] forward port of branch saas-6 up to 8d95f6d 2015-08-15 16:57:35 +02:00
Gaurav Panchal 8dd1d0481e [IMP] survey: groups and settings update
Link survey user and manager group to the survey module category and update
their label to match the labels used in the various Odoo groups.
2015-08-12 11:41:58 +02:00
Nicolas Lempereur 5844fa4a2a [FIX] survey: partner access to survey input
Allow the partner associated to a survey user input to read the data on
this output.

A survey can be created by a different user than the one
filling it, for example an appraisal interview request can be created by
another user than its interviewer. In this case if the interviewer is
not Survey / Manager an error would happen.

closes #7978
opw-644791
2015-08-10 16:57:27 +02:00
Richard Mathot 2809314045 [FIX] survey: security rules mess with xmlids 2014-06-11 11:47:55 +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) e53b07b12b [FIX]
bzr revid: rim@openerp.com-20140423085404-rleqt5f9rznpbj0k
2014-04-23 10:54:04 +02:00
Richard Mathot (OpenERP) 35d50a7139 [FIX] add noupdate to survey security rules
bzr revid: rim@openerp.com-20140423085037-7wgp3hekne7hwnrl
2014-04-23 10:50:37 +02:00
Richard Mathot (OpenERP) 732293d69b [FIX] Security rules for surveys
bzr revid: rim@openerp.com-20140417135047-7ekyq1t7jpa6ggk1
2014-04-17 15:50:47 +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) e910dc758d [FIX] Access right
bzr revid: rim@openerp.com-20140205080541-2b4yzamvydxnb9xw
2014-02-05 09:05:41 +01:00
Richard Mathot (OpenERP) c85da98af9 [FIX] Security groups name
bzr revid: rim@openerp.com-20140120125959-lbz09n4p9t2g3noi
2014-01-20 13:59:59 +01:00
Richard Mathot (OpenERP) a67631c934 [IMP] Security rules for user inputs
bzr revid: rim@openerp.com-20131231144735-5v7dm5ya9ovmy8nu
2013-12-31 15:47:35 +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) 32876beec7 [IMP] Code improvements
bzr revid: rim@openerp.com-20131206091744-ry1bnwisj0vwmj9o
2013-12-06 10:17:44 +01:00
Richard Mathot (OpenERP) 7d232137b6 - Info page when survey is not open
- Survey admin view improvements
- Survey state change handling
- Security params for public users
- Handling of tokens, survey with authentification, surveys without tokens...
- (Typos)

bzr revid: rim@openerp.com-20131120151301-no2wl0ud9jccaalk
2013-11-20 16:13:01 +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
Raphael Collet ba1454149c [IMP] groups: remove auto-inclusion of admin in groups, and make the inclusion explicit in groups
bzr revid: rco@openerp.com-20120404090830-nteimn2kvz8nkk7h
2012-04-04 11:08:30 +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
Raphael Collet 0c1021806d [MERGE] trunk-user-groups-rco: add category_id to groups
bzr revid: rco@openerp.com-20111213141949-ohvn0c9iq6tcl7jj
2011-12-13 15:19:49 +01:00
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
Raphael Collet 49a7682479 [IMP] subscription, survey, wiki: add group categories
bzr revid: rco@openerp.com-20111212142121-jly0qs05n2tvk1wh
2011-12-12 15:21:21 +01:00
Raphael Collet ba6342174e add group implications
bzr revid: rco@openerp.com-20110802130811-pkdmw43ufifz0tpj
2011-08-02 15:08:11 +02: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
Harry (OpenERP) 764b9f251e [FIX] correct regression on intalling module without demo data
bzr revid: hmo@tinyerp.com-20101114134821-7djwpr6nmmxu584q
2010-11-14 19:18:21 +05:30
uco (OpenERP) f7f51a9497 [ADD] Task ID-1720: The demo user should be in all '<application's name> user' groups.
bzr revid: uco@tinyerp.com-20101102095327-77v9g35gjosrc5ky
2010-11-02 15:23:27 +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