Commit Graph
126133 Commits
Author SHA1 Message Date
Thibault Delavallée f15861c36d [IMP] survey: add a category on surveys to allow filtering them
Purpose of this commit is to add a category selection field on surveys. It
will allow to filter / select surveys according to their category and their
main use.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 27328ca33c [REF] hr_recruitment_survey: adapt application to survey ACLs update
Recent community commit updated survey ACLs. Notably survey access groups
officer and manager have been updated to really give access to survey models
management. Other people cannot access survey models as they are considered
technical. Controllers give a way to take and complete surveys.

In this commit we update recruitment bridge module with survey to remove
custom rights and rules definition for survey models. As recruitment groups
already imply survey groups access defined in base survey should be sufficient.
Being a recruitment officer or manager automatically makes the user a survey
officer.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 7d110c20c5 [REF] survey: refactor template use on invite wizard
Purpose of this merge is to remove the ugly __URL__ hack of survey templates.
It is solved by making template rendered on user_input model. This means each
invitation recipient will received its own rendered mail. Small jinja code
allows therefore to include the url in a clean odoo-style way.

Subject and body in survey invite wizard are not rendered anymore. It means
jinja could be displayed. This is necessary as this wizard will work in batch
mode, rendering the body on each recipient.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 6fa4688693 [REF] survey: refactor invitation wizard
Purpose is to clean and simplify invite wizard on surveys. Main purpose is
to simplify options.

Public link is displayed for public surveys, allowing to quickly share
it. When sending emails a token is now generated for each recipient. There is
no "batch public link" sending option anymore as it is not really necessary.

Check is done on recipients and emails to match the access mode option. Having
a restricted survey gives the same limitations on people to invite (users,
employees, ...).

Code is cleaned to ease its understanding and prepare future evolution notably
with appraisals.

An existing mode field is added on invite model. All options are currently
not used but it prepares future addition to survey, notably for certifications.
Its purpose is to know what to do with existing tokens when inviting new
recipients. It is used notably to resend tokens through the user_input form
view instead of relying on a custom context key.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 1c5371a966 [IMP] survey: improve some survey pages
Survey has several side pages related to corner cases: closed surveys, void
surveys, ... those templates need a bit of polishing. Other main templates
are left untouched and will probably be improved in other tasks.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 7c50807bec [REF] survey: improve access mode options and survey form view
In this commit we extend access option on survey model. Access mode is now
defined as

 * public: everyone can access this survey. People having a link to the survey
   can create answers and fill survey. Those are used for example as
   satisfaction surveys;
 * login required: only users can access this survey. Depending on auth
   signup configuration this either limits survey access or forces people
   to create an account;
 * employees only: only users belonging to base.group_user can access this
   survey. Those are used for example for internal polls;
 * on invitation only: only people receiving a token can access this survey.
   They do not need to be an user, having a token is sufficient. Those are
   used for example for appraisals;

Note that survey officers and managers can always create and update answers
according to their ACLs.

In this commit we also improve a bit survey form view while changing the
access field. Surveys users now have access to all buttons and some labels
have been updated to better fit current Odoo style. Archive button is now
always displayed as it is considered as a standard way of managing surveys.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 66e00f642a [IMP] survey: add access rights tests
Purpose of this commit is to improve test coverage of survey module. This
commit adds tests related to current access and serve as a base for future
modification. Some tests are commented as access will evolve for this
application.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée dfc37ecede [REF] survey: adapt controllers and portal flow to new ACLs
Purpose of this commit is to adapt controllers and routes to new ACLs. As
survey access is now controlled routes have to use survey ID and browse
records as sudo when access is granted.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 5878579b10 [FIX] survey: is_closed field on survey should be readonly
Otherwise having this value coming from a view triggers a write on the
survey stage model. This write is unnecessary ad is_closed should really
be readonly. It may also causes access rights issues notably for survey
users that cannot update stages.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 598d84783e [FIX] survey: allow to delete surveys with questions and answers
Purpose of this commit is to allow to unlink surveys even if answers have
been given. Currently an ondelete restrict on answers exists that prevent
from unlinking surveys. As unlink rights are now given to survey users
only they should be able to completely remove surveys if necessary.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +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
Thibault Delavallée b74252dd1d [REF] survey: clean models by removing unnecessary fields
This commit holds several improvements on survey models.

[IMP] re-order fields in survey models and update strings / helps

Purpose is to ease understanding and future modifications of survey models
by reordering fields in survey, question and user input models. Those are the
main models we want to clean in future updates.

Some comments have been moved into help and some labels and helps have been
updated to clarify a bit the use of various fields, notably in question model.

No functional or technical change occur with this commit. It is just pure
code move. Reordering them allow to already understand a bit more the logic
of this module.

[REF] survey: remove unnecessary/unused fields on answer models

Purpose of this commit is to remove unnecessary and/or unused fields on survey
answer line model. In this commit we

 * remove useless date_create field on answer and answer lines models. This
   field is basically a renamed create_date. Let us remove this dummy field
   as it adds nothing to the answer and answer lines models;
 * remove useless URL-related fields and actions on answer and answer lines
   models. Having those fields actually bloats the model without really helping
   understanding survey models. As changing routes should not occur frequently
   hiding routes in fields does not really help. Templates are update to
   directly include links instead of fields;

We also remove a button on user input that redirects to the survey global
results. Surveys results are available on survey kanban and form views. It
makes no sense to have that kind of button on a specific answer.

[REF] survey: remove unnecessary/unused fields on survey models

Purpose of this commit is to remove unnecessary and/or unused fields on survey
model. In this commit we

 * remove useless is_designed field on survey model. We remove is_designed
   field that is based on having page and/or questions. It is just used to
   make some links inactive in kanban view. Having fields just for that
   purpose bloats the model and is not necessary. Testing void surveys will
   just lead to a void page;
 * remove useless email_template_id field on survey model. This field is
   completely not used anywhere in survey codebase;
 * remove useless urls field in survey model. In this commit we remove support
   of both relative and global urls computation. It was used only in invite
   wizard but was actually not really necessary as knowing the survey access
   url is the only really necessary thing to display;
 * Print and results URLs are removed from survey model. Having them inlined
   directly in code is simpler that actually hiding them behind field. As
   changing routes should not occur often it is not a big deal to write them
   when necessary. We therefore remove public_url_html, print_url and
   result_url fields;

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée ee2631cd51 [REF] survey: clean survey routes definitions
Purpose of this commit is to ease understanding or routes. In this commit
we make token a parameter where it is optional and force is where it is
not; we remove unnecessary list on routes; we rename some controller methods
to ease understanding;

Code calling those URLs is adapted accordingly. No functional change should
occur with this commit.

Some routes are json-http-mixed as a result of old implementation. Those
will be updated in future tasks when cleaning the templates and routes.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
jem-odoo 08a9391a84 [IMP] project: always display working calendar
Setting the working calendar on a project should
be done in debug mode for now. This is annoying as
it is not a "so delicate" feature and project
manager should be able to do it.
This commit makes the field always visible to ease
project configuration.

Task-1827986

closes odoo/odoo#30193
2019-01-14 14:35:01 +00:00
jem-odoo 44b9f1efbe [IMP] hr: make default calendar required
Through the HR setting, you can set the default
calendar for employee in the company. This field
is not required, and not setting it can be annoying
on employee creation.
This commit makes the field required only on the UI,
as default calendar is generated on company creation,
we can not set the required flag on the model.

Task-1827986
2019-01-14 14:33:04 +00:00
Pratima Gupta 2f4ec15a37 [IMP]base: Unique barcode for customers.
If two customers have same barcode -
Current functionality : To select customer in POS, if we scan barcode, only the newly created customer will be selected.

To resolve this: Created the unique sql constraint for customer per company.
This commit is related to task# 1877329.

closes odoo/odoo#28316
2019-01-15 04:45:36 +00:00
Robot Odoo 4155bc5614 [MERGE][REF] link_tracker: strengthen ACLs and add tests
[REF] link_tracker: strengthen ACLs and add tests

Purpose of this merge is to clean ACLs of link tracker models. Those are rather
technical and should not be accessed as it is by external people. Let us
delegate control to controllers and lessen a bit model accessibility.

Some code is cleaned and code field is made required on link.tracker.code
model to ensure database integritry.

See commits for more details.

This merge is linked to task ID 1904277 and closes PR #28242.
2019-01-14 15:00:23 +01:00
Thibault Delavallée 6842d5cbd8 [IMP] link_tracker: make code field required on link.tracker.code model
Indeed it makes no sense to have void codes.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:47 +00:00
Thibault Delavallée 7222f0ab53 [CLN] link_tracker: clean some code
Purpose of this commit is to remove some unnecessary code in link tracker.

 * remove unnecessary code / parameters:
 * remove unused field click_date on click as create_date is already used for
   that purpose;

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:27 +00:00
Thibault Delavallée b670911a92 [REF] link_tracker, mass_mailing: simplify add_click method and add tests
In this commit we rewrite a bit add_click in order to remove the inlined sudo
and ease inheritance and parameter management inside the method.

Access through controllers is sudo-ed as the main API method is now done
with current user access rights.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:26 +00:00
Thibault Delavallée 75638ffb94 [REF] link_tracker: do not let public read technical / private link data
Link tracker models are rather technical and should not be accessed as it is
by external people. Let us delegate control to controllers and lessen a bit
model accessibility.

Currently everyone can use add_click method and generate statistics. Now
statistics will be generated only through dedicated routes. It will make
statistics more reliable and ensure technical data remain private.

Next commit will update code from controllers and main methods in order to be
have a more readable click API and avoid link between non dependent modules.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:21 +00:00
mgh-odoo 9ee9724a10 [Generic] unaccent search
- added unaccent search on POS customer/partner and product
- moved unaccent from "mail.utils" to "web.utils"
- added more character to make function accurate

We might use str.normalize(from ES6) but the problem is str.normalize method can not consider some double characters i.e. accented character when normalized it returns 2 normal characters and normalize method returns single character, so here custom unaccent method is used to normalize the string

What we can improve here: We can use str.normalize method and check if string is still have unaccented charaters that we can call our unaccent method but this unaccent method is also working and performing well

closes odoo/odoo#27671
2019-01-10 12:31:53 +00:00
XavierDo 80f3eb27f7 [FIX] mail: add index on mail.activity create_uid
The activity create_user_id field is now replaced by magic create_uid field.
Since most of the search are done on this field, create_uid should be indexed as
create_user_id was.

closes odoo/odoo#30061
2019-01-09 09:30:05 +00:00
Robot Odoo a57503bfd0 [MERGE] web: update bootstrap from 4.1.3 to 4.2.1
Bootstrap just released a brand new version with new components and new possibilities, which are great to integrate in master.

Note: Unfortunately, this also comes with some bug fixes they did not add in a 4.1.4 version, so there is no clean way to backport them in Odoo 12.0 (so if any is required at some point, we will have to use bootstrap_review.scss or anything else to bug fix).

closes odoo/odoo#29949
2019-01-10 13:58:21 +01:00
XavierDo 303220f214 [FIX] mail: only notify activity assignation on user change
The current implementatipon of write on mail.activity will
send a notification to the user every time a write is made
on user_id.

To avoid to send notification / mail if the user_id is given
but doesn't change, we can simply filter the records. This
will also avoid to check assignation rights in this case.

Task: 1905086

closes odoo/odoo#30055
2019-01-10 10:14:45 +00:00
qsm-odoo f87e56c571 [FIX] web, website: adapt accordion to bootstrap update
Some update to the accordion component made it incompatible with some of
our customization.
2019-01-09 14:03:48 +00:00
qsm-odoo 63a636e6d9 [FIX] website: adapt default theme font to new BS font 2019-01-09 14:03:48 +00:00
qsm-odoo 827f30abf1 [FIX] web: adapt the color-yiq BS function
Odoo overrides the color-yiq function of bootstrap to improve it. With
the last update, BS changed its signature so Odoo had to change it to.
2019-01-09 14:03:47 +00:00
qsm-odoo 0f6f108cbe [FIX] web: adapt BS import and assets to BS update 2019-01-09 14:03:47 +00:00
qsm-odoo f4503d09dc [FIX] web: remove bootstrap sourceMappingURL
Same as https://github.com/odoo/odoo/commit/8e17223c260add842d83b2549d7bdaa4c3cc4d6c
2019-01-09 14:03:47 +00:00
qsm-odoo 63e52e6acf [IMP] web: update bootstrap from 4.1.3 to 4.2.1
This commit only updates the existing bootstrap files and add the new
ones the update brings.
2019-01-09 14:03:47 +00:00
Martin Geubelle a55fd329ab [FIX] test_main_flows: make tour pass without all modules
With the current test_main_flows dependencies, the tour does not pass in community.
Since rev. odoo/odoo@32db86e the `extra_trigger` waiting for `payment_method_id` is
never reached because the onchange who is supposed to display this field hides it
because there is only one payment method on the journal.

The second payment method is added by the module account_check_printing but we don't
want to add it in the dependencies because this module is not very common.

Note that this `extra_trigger` was meant to wait for the onchange triggered by the journal
modification on the 'Register Payment' modal but this modification is not useful as the
journal is already 'Bank (USD)' by default.

closes odoo/odoo#30023
2019-01-08 11:42:39 +00:00
Christophe Simonis d7c5bc02cc [MERGE] forward port branch saas-12.1 up to 8aa8548d8a 2019-01-09 19:59:27 +01:00
Romain Derie 37b518f174 [IMP] website, website_partner: use fields from mixin on res.partner
Currently, res.partner has:
1. `website_id` field hardcoded in website module
2. `website_published` field from website `website.published.mixin` in
   website_partner module.

At the end, the res.partner model has all the field of the mixin
`website.published.multi.mixin` without having the mixin.
As a result, we have all the multi-website fields but we don't have access to
the mixins methods & computes.

Now, we use the `website.published.multi.mixin` on res.partner in website
module even if `website_published` is not needed if website_partner is not
installed.

+ add tooltip to `website` field to prevent warning since 2 fields would have
  the same label

closes odoo/odoo#29711
2019-01-09 15:21:35 +00:00
Romain Derie 30ed4c08cc [FIX] website_*: prevent record to be unpublished on website change
Before this commit, when changing the website field in a record form view,
the is_published field would be force to false, ending unpublishing the record
if it was published.

That behavior was coming from the fact that is_published field is missing from
the form view. Thus, onchange on website is triggering a recompute server side
without is_published as the JS framework is not sending the field.
The ORM is then fallbacking on default Boolean value (False) for is_published
when sending back the onchange result.

This would only appear on object with 'website.published.multi.mixin' and with
website_id in the form view.

Replacing website_published by is_published will fix the behavior and has more
sense has website_published is the 'is_published' state in a website context.
In the backend, we are not in a website context.

task-1919689
2019-01-04 15:50:45 +00:00
Andrea Ulliana 59cc261448 [IMP] website, *: allow creating anchor links
* portal, web_editor

Anchor Link:
- Some visual improvements of the link dialog.
- New 'Page Anchor' field.
    - System by default: top and bottom.
    - Shows existing anchors.

Creation of the anchor:
- New option 'Anchor Name' to be able to create an anchor.

task-1913458

closes odoo/odoo#29150
2019-01-09 16:16:01 +00:00
Yenthe666 2ee21d9938 [IMP] gamification: improve view layout and add names for easier xpaths
closes odoo/odoo#29948
2019-01-08 15:35:34 +00:00
Darshil Trivedi 6a8f9f3570 [IMP] payment, website_sale_delivery : payment acquirer and delivery method whole part should be clickable and cursor pointer on mouse hover.
Purpose: user click anywhere from panel box to select delivery method and payment method.

Related task ID 1918459

closes odoo/odoo#29604
2019-01-09 12:11:42 +00:00
Robot Odoo 4baae1f6f2 [IMP] mrp, sale_mrp: kits quantities
**Before this PR:**

- The quantities available when a kit was ordered was 0 even if enough components were available
- The quantities delivered when a kit was ordered were correct only if all move from the picking of its sale order were done. So the quantities delivered were correct only if all components were fully delivered.

**After this PR:**
- The number of kits available is computed based on the quantities available of the components needed to make the kit.
- The number of kits delivered is computed based on how many kits it's possible to make with the components already processed.
- Some test case are added the check the flows when kits are ordered.
Those test case make sure that:

  * Delivered quantities are accurate if :
     - kits in kit
     - backorders are made
     - returns are made
     - returns of returns are made
     - Multiple differents UoMs are setted on the components of a kit

  * Available quantities are accurate if:
     - Kits in kit
     - Multiple differents UoMs are setted on the components of a kit

TaskID : 1915370

closes odoo/odoo#29270
2019-01-09 16:28:07 +01:00
Arnaud Baes 82fd418a98 [IMP] sale_mrp: Test cases added for kits flows
Thoses tests checks the correctness of the kit's flows.
The following cases are tested :

Delivered quantities are accurate if :
- kits in kit
- backorders are made
- returns are made
- returns of returns are made
- Multiple differents UoMs are setted on the components of a kit

Available quantities are accurate if
- Kits in kit
- Multiple differents UoMs are setted on the components of a kit

TaskID: 1863856
2019-01-09 14:00:49 +00:00
Arnaud Baes b50d6a07db [IMP] sale_stock, sale_mrp: Kits quantities availability
With this commit, the warning message triggered when there are not enough quantity available of a kit is based on the minimal quantity of a kit it's possible to make, based on the quantities available of its components.
However, as this quantity is based on the 'virtual_available' quantity, the values could be negative, wich doesn't really make sense for a kit.
This is why in such a case, the quantity available reported by the warning will be set to 0.

TaskID: 1915370
2019-01-09 14:00:49 +00:00
Arnaud Baes 380b84bd09 [IMP] sale_mrp: Kit quantities delivered
Before this commit, the quantity_delivered of a kit was set to 0 unless all its components were delivered.
With this commit, the quantity_delivered is the minimal quantity it's possible to make with the components currently delivered.

TaskID: 1863856
2019-01-09 13:23:35 +00:00
Yenthe666 b0b991328d [IMP] website_forum: show favourite count in forum question and profile tab
closes odoo/odoo#30044
2019-01-08 17:01:17 +00:00
Martin Geubelle b4e9410f6a [IMP] web: use showSearchInput in model field selector
The option `showSearchInput`, which is used on the model field selector to display a search
input that filters the displayed fields, is not set by default.

This includes the model field selector instantiated in the `domain` field widget.

closes odoo/odoo#29986
2019-01-08 13:46:01 +00:00
arbaes fb693b65ff [IMP] stock: Immediate transfer picking view
With this commit, the buttons 'Check availability', 'Unreserve' and the column 'Initial Demand' are hidden if
the picking is an immediate transfer.

TaskID: 1868544

closes odoo/odoo#29108
2019-01-08 14:26:20 +00:00
Nimesh Jethva ca129305e4 [IMP] crm_reveal : relabeling menu and change the 'help' tooltip
Purpose of Task is to relabeling of various settings and button to be consistent with other view.
  -- change menu 'Lead Generation' to 'Visits to Leads' for crm.reveal.rule
  -- change help tooltip 'Create a conversion rule.' & 'Create rules to generate B2B leads/opportunities from your website visitors.'

This commit is related to task ID : 1919736

closes odoo/odoo#29701
2019-01-07 10:35:54 +00:00
Romain Estievenart dc017d17e9 [FIX] sale_timesheet: responsive table
On small screens, when we click on the overview of a task
inside the "project" app, the displayed table doesn't fit the screen.

This commit only add missing parent "div.table-responsive" to add
responsive support.

opw-1907877

closes odoo/odoo#29970
2019-01-07 12:51:27 +00:00
Romain Derie 4c8eeb7f58 [FIX] website_*: set correct order on modal footer button
Modal primary button should be the one in the corner (left if buttons aligned
left, right if buttons aligned right) as in the Bootstrap doc.
More than a simple guideline, the user will intuitively click on the button in
the corner as it is supposed to be the primary one.

Plus some DOM fixes (o_technical_modal was missing, H2 was too big especially
since BS4)

Closes #29890
task-1922120
2019-01-07 10:00:04 +00:00
Pierre Rousseau c37a79925b [IMP] snailmail, snailmail_account: settings
closes odoo/odoo#29320
2019-01-07 08:13:21 +00:00
Pierre Rousseau e91f2bd4a7 [IMP] account: settings 2019-01-07 08:13:09 +00:00