Commit Graph
124797 Commits
Author SHA1 Message Date
Aurélien Warnon 44ae98d3dd [IMP] survey: add a download button at the end of certification process
Purpose
=======

When the user successfully takes a certification, he can download the certification
document using a new "Download certification" button.
(In addition to receiving an email containing the certification)

Also cleaned a bit the way certifications are downloaded.

Task-1941250
2019-03-15 20:38:58 +00:00
jem-odoo 34f7266792 [FIX] website_slides: avoid putting unexisting attribute on object
In this computed field, an attribute is assigned to the record
but this attribute does not exist. Python authorized this but
this makes the code ugly and this is definitely not a good
practice.

Task-1941250
2019-03-15 20:38:58 +00:00
jem-odoo 954e8ca6d4 [FIX] website_slides: prevent to mark a certification as done
When a certification slide is display in no fullscreen
mode, the done button is clickable. Same applies to quiz
slide.
This commit prevents user to manually mark a slide as done
for slide type that requires an other action (submit answer,
pass survey, ...).

Task-1941250
2019-03-15 20:38:58 +00:00
jem-odoo 32c5632aa5 [FIX] website_slides: auto set done successfull quizz
For now, in no fullscreen mode, if the quiz is succeed, the
user progress is not updated because the quiz is not set
to done.
This commit implements this call to mark slide as done and
green the check bullet.
We decided to unify the submit RPC call with the done one,
so a quiz (or a slide with questions) can only be done when
submitting answers. As consequence, we need to prevent some
slide type to use the /set_completed route (quiz and certif).

Task-1941250
2019-03-15 20:38:58 +00:00
Aurélien Warnon 55f61d95bf [FIX] website_slides: avoid access error when submitting quiz
Purpose
=======

The quiz_submit method and the action to set the quiz done both use
the slide_partner relation that has to be accessed in sudo mode.

Task-1941250
2019-03-15 20:38:58 +00:00
sri-odoo 54261c4e3e [IMP] website_slides: embedded player restyling
The style and DOM structure of the embeded player (used
to display PDF file) is old, and it needed a little refresh
to be adapt to bootstrap4 and modern styling.

Task-1941250
2019-03-15 20:38:58 +00:00
sri-odoo 69fb136a48 [FIX] website_slides: styling fullscreen mode
Since the fullscreen widget has been revamped, it needed
to be pixel perfect. This commit cleans the CSS and DOM
structure in order to optimize and sublime it.

Task-1941250
2019-03-15 20:38:58 +00:00
Robot Odoo 77fa2d6903 [MERGE][IMP] website_slides, website_*: email validation, comment restrictions with karma and search user profile
This merge is improving various points linked to eLearning.
Impacted modules: website_profile, website_forum, website_rating and website_slides

- Move validation email from website_forum to website_profile to use the feature in both Forum and elearning. The purpose is to give first karma points to allow users to comment, vote, ... on slides.
- Add search bar in 'all users' page. To do so, we needed to introduced the `karma_position` field.
- Restrict comment, review and vote based on user's karma in eLearning (minimum karam required to review/vote/comment, like in forum). This feature required to add 3 stored fields, with the benediction of chs !
- Fix channel completion computation and linked karma gain. Also provide some test on karma gain.

See sub commits for more details.

Task-1943788

closes odoo/odoo#31321

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-15 20:00:40 +01:00
David Beguin 5798ca28bf [IMP] website_slides : improve get slide access computation
As slides are returned in sudo to the template, the user rights were
checked via a can_access variable set in the template directly.
In order to disable the vote for user that cannot get access to the course
all the checks are now done in backend (also to avoid to get access to slides
in sudo mode with rpc calls). We add now, for each slide on the course view,
the access and vote rights to the template : can_access and can_vote.
Those two are computed in backend, using the user's access right instead of admin's.
But, as if the user is not member of the channel, he cannot get access to the
course slides (expect for Free Peview ones), so the check on can_vote
will crash. This is why we check the access rights before checking can_vote,
for each slides (as free preview slides are still accessible,
even if the user is not in channel members).

The vote widget is disabled if user's can_access or can_vote = False, enabled otherwise.
If user have access but have not enough karma, the controller will handle this
case and return an error to the user telling him he has not enough karma to vote.
If user can vote but cannot access, the controller will handle this
case and return an error to the user telling him he has no access to the lesson.

Task ID: 1943788
PR #31321
2019-03-15 15:05:54 +00:00
David Beguin d4db21a9cc [IMP] website_slides : allow review, comment and vote only if enough karma
To avoid eLearning to be spammed, the comment, review and vote behaviours
are now allowed only if the user has enough karma to do it.

Here is the new behaviour on courses and slides rating / comment / vote
    -If allow_comment is checked on Course :
        - Review (rating) is allowed on Course only if enough karma
        - Comment is allowed on slides within the course
            only if enough karma and course type is 'training'
        - Vote is allowed on slides within the course
            only if enough karma and course type is 'documentation'
    -If allow_comment is not checked on Course :
        - Review (rating) is not allowed on Course
        - Comment is not allowed on slides within the course
        - Vote is not allowed on slides within the course
    - Rating is not allowed on slides within the course anymore

Task ID : 1943788
PR #31321
2019-03-15 15:05:54 +00:00
David Beguin 81cebf3485 [FIX] website_slides : fix and add tests on karma gain
Fix karma channel completion computing and karma gain :
    set to complete only if not completed
    and handle eventual multi course completion
Removes unused karma gain rules.
Add karma unvote rule to loose the karma gained if user changes his mind.
Test karma gain on each users.
    Note : technically, public user could be member of a course,
    but functionally speaking, this case should and could never happen
    (it's a non sens anyway)
    -> public user has not been tested for this reason.

Task ID : 1943788
Closes PR #31321
2019-03-15 14:59:40 +00:00
David Beguin d7cc1520f4 [IMP] website_profile, gamification, : add search bar in all users page
This commit adds the search bar in 'All users' page in order to filter on name or company name.
To be able to keep the position, a non stored computed field has been added on res_users
to get the position depending on the user's karma.

The podium (top 3 users) is now displayed only if there is no search applied and if the page = 1
because it has no sens anymore in other cases.

Special thanks to @jem-odoo who helped me finding smart solution for position computing.

Task ID : 1943788
PR #31321
2019-03-15 14:59:12 +00:00
David Beguin fb40c6bf60 [IMP] website(_profile,_forum,_slides): move validation email to profile and use in forum and elearning
Email validation was necessary on the forum to be able to begin to use the forum
(ask or answer questions, vote, etc..)

As the new elearning also uses karma since 705376a982,
the email validation is now also necessary in the eLearning platform.

This is why this commit is moving the email validation process to website_profile
and extend website_slides (eLearning) and website_forum to use this feature.

In function of where the user asked to send him the validation email,
the user is redirected on the forum or on the elearning when he clicks on
'Validate my account' in the received 'email validation' email.

Task ID : 1943788
PR #31321
2019-03-15 14:58:28 +00:00
Christophe Simonis bbedcdb190 [MERGE] forward port branch saas-12.1 up to ff1bca32f3 2019-03-14 19:44:55 +01:00
Christophe Simonis ff1bca32f3 [MERGE] forward port branch 12.0 up to a26496b6e7 2019-03-14 17:43:32 +01:00
Sébastien Theys fec83667bb [FIX] web: fix kanban_image when called for a different record
The issue is manifesting for example in the Contact kanban view where the
company image should be displayed in small. Before this fix, the person image
was displayed twice instead.

Following PR #30881 and commit: f78b7a76d6

The fix introduced by the above commit highlighted another issue with the
method: if the `model` and `id` given in parameter are different than the
current record, the method returned the url for the current record instead of
the requested record.

To fix the issue, we return the `raw_value` only if the requested record is the
current record. Otherwise, we return the manually built url.

PR: #31842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-14 14:10:54 +00:00
Nans Lefebvre a26496b6e7 [FIX] mail: set message_main_attachment_id when the attachment is added via widget
Create a record.
Add an attachment, using the widget (aptly named 'add an attachment').
It is not set as message_main_attachment_id.
If you add the message through 'log note', then it is.

We add a hook to make sure that it is set as message_main_attachment_id
when added through the widget.

opw 1950403

closes odoo/odoo#31847

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 12:50:51 +00:00
Andrea Ulliana e73ad6127e [FIX] website: restore ace editor resize and line numbers
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775,
the gutter in ACE Editor was broken. We were not able to resize and view
the line numbers anymore.

closes odoo/odoo#31838

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-14 10:22:16 +00:00
Nans Lefebvre c68a97a255 [FIX] mail: set message_main_attachment_id to copy=False
Create a record.
Add an attachment set as message_main_attachment_id (e.g. through log note).
Duplicate that record.
The new record has the message_main_attachment_id of the old record,
while it has no attachments.

Since attachments security is linked to the record id, we shall not copy them.

opw 1950403

closes odoo/odoo#31846

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 09:40:11 +00:00
Christophe Simonis ac4ef455c4 [FIX] web: correct view definition in new test 2019-03-14 15:01:09 +01:00
Christophe Simonis 9a4e84ae66 [MERGE] forward port branch saas-11.3 up to f5ab04ce50 2019-03-14 14:13:47 +01:00
Nathan de Pryck 5625257991 [FIX] mrp: display quantities with UoM precision in wizard
Before this commit, the fields qty_reserved and
qty_done were displayed in the wizard with a
precision of two digits (for each case).

The problem is that the qty_to consume uses the
precision accuracy defined in 'Product Unit of Measure'.
It resulted that a quantity of 0.002 to consume
was translated to a qty_done of 0.0.

See opw-1949198

closes odoo/odoo#31822

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 09:40:38 +00:00
Nicolas Martinelli b5921fbfa8 [FIX] sale: exclude all attributes
With the demo data:
- Go to Sale > Products > Products, search for 'Customizable Desk'
- Click on 'Configure Variants'
- For variant 'Legs: Steel', add all attribute values for the
  'Conference Chair'
- Create a SO, add a line with 'Configure Product'
- Select the 'Customizable Desk' with 'Legs: Steel', add

Boom boom, traceback at template rendering at
`first_possible_combination[variant_id_index] == value_id`

This is because the `parent_combination` is not taken into account when
evaluating `_is_add_to_cart_possible`.

closes odoo/odoo#31496

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-14 08:08:45 +00:00
Nicolas Martinelli 35221a3243 [FIX] product: exclude without attribute values
With the demo data:
- Go to Sale > Products > Products, search for 'Customizable Desk'
- Click on 'Configure Variants'
- For variant 'Legs: Steel', remove the attribute values for the
  'Conference Chair'
- Create a SO, add a line with 'Configure Product'
- Select the 'Customizable Desk' with 'Legs: Steel', add

The 'Conference Chair' is displayed in the 'Available Options', while it
shouldn't.

The methods `_get_own_attribute_exclusions` and
`_get_parent_attribute_exclusions` compute the exclusions based on the
attribute values. Since there is no values in our case, the exclusion is
not taken into account.

We add a specific case to search for exclusions without values.

opw-1945460
2019-03-14 08:08:45 +00:00
Christophe Simonis f5ab04ce50 [FIX] web: adapt new test to extra rpc call made on view loading 2019-03-13 17:55:13 +01:00
Christophe Simonis afe8e97800 [MERGE] forward port branch 11.0 up to c23d1186e7 2019-03-13 16:52:40 +01:00
goran.kliska d2a6554932 [CLA] add Decodio Applications CLA
closes odoo/odoo#31824

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-13 15:48:30 +00:00
Christophe Simonis c23d1186e7 [MERGE] forward port branch saas-15 up to 21ef0f4f6d 2019-03-13 16:15:34 +01:00
Christophe Monniez 0201d896d8 [FIX] packaging: include pot files
Since #26134 the po files are compared with pot content when loading a
translation. If a term is found multiple times in a po file, the terms
that does not exists in the pot files are ignored. If the pot files does
not exists, the unicity constraint leads to an error.

Closes #31583

closes odoo/odoo#31823

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-13 15:10:02 +00:00
Christophe Simonis 21ef0f4f6d [MERGE] forward port branch saas-14 up to d5a8b238fa 2019-03-13 16:06:34 +01:00
Christophe Simonis d5a8b238fa [MERGE] forward port branch 10.0 up to 49ca43d75c 2019-03-13 13:23:43 +01:00
tarteo a9a8eeac1d [FIX] account: show missing 'Go to bank statements' button
When importing bank statements, a rainbow man is shown but with no action button
The active model is account.bank.statement.import in this context

Before this commit, the rainbow man was staying with no possible action

closes odoo/odoo#30723

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-13 10:44:15 +00:00
Nicolas Martinelli 1c912767d1 [FIX] stock_account: dropship & AVCO
- Activate: 'Order-Specific Routes' and 'Dropshipping'
- Create a stockable product in AVCO + AUTO
- Purchase the product at $10 and validate the receipt
  => One product @ $10 in stock
- Sell the product via dropshipping
- A PO is generated, change unit price to $20, validate
- Validate the picking

The product in stock has now a cost of $15, i.e. the dropship impacted
the cost of the product.

Now if the product in stock is sold, the product will go out at a cost
of $15. This will lead to a wrong accounting valuation (0 product in
stock with -$5 in stock).

opw-1922289
opw-1935272
opw-1937672

closes odoo/odoo#31786

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-13 09:55:40 +00:00
Martin Geubelle 170c7632f2 [FIX] web: hide handle on readonly x2m
The widget handle was displayed on x2m fields in form views, even when
the field was readonly, which makes no sense.

It is now correctly hidden.

Fixes #30580
opw-1937833

closes odoo/odoo#31743

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-13 09:31:37 +00:00
Nicolas Lempereur fa4552926c [FIX] website_sale_comparison: no compare variant=False
When comparing product, there was already an exceptions that would not
list the attributes if they were only "create_variant=False" type.

But if we mix attribute create_variant False or not on a product, we
could get an error.

With this changeset, create_variant=False attribute are ignored also
when mixed with create_variant=True attributes.

opw-1946361
closes #31680

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-12 14:50:52 +00:00
Christophe Simonis 2602642a78 [IMP] mail,*: remove useless field is_master_data
This field is a non-sense. By using the same logic, it should be added
to any low level model.
Replace the check by a simple verification of presence of an XMLID.

A more generic opt-in solution should be integrated into ORM.

Partially revert commits 0db0e66e96 and
bbd64c22ab.

See #29257 odoo/enterprise#3550

closes odoo/odoo#31778

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-12 10:29:51 +00:00
Lucas Lefèvre 6207391276 [FIX] survey: Display datetime answers in results
Currently, user input lines of type ´datetime´ are not
correctly displayed in both situations:

1. not displayed at all in the survey result frontend page

2. the answered value is not displayed in the form view of
a user input line.

This commit fixes both issues

closes odoo/odoo#31815

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-13 12:47:33 +00:00
Lucas Lefèvre 8f8c508034 [FIX] survey: Do not parse datetime as date
Commit 98d0424 (merged in saas-12.1) fixed a Deprecated warning by using
`field_utils.parse.date` instead of relying on
moment to parse the date.
However, a datetime question type was added in saas-12.2.
When the fix commit was forward ported, the parsing of datetime
broke as `field_utils.parse.date` can't parse a datetime.

Fix: use `field_utils.parse.datetime` if `questiontype === 'datetime'`.

Also, defining `toJSON` method is no longer necessary because
it is already done in the field_utils methods.
2019-03-13 12:47:33 +00:00
Pierre Paridans ad8a6afa4f [FIX] lunch: rpc call cannot be performed in Widget.init()
The Widget's init function is synchronous.

The 'then' will execute after the end of the function so
self.group_portal_id will not be set immediately.

Also, RPC's in the init function is really not a good idea, it should be
putted in the willStart.

Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13

closes odoo/odoo#31508

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-13 09:14:47 +00:00
Rémi Rahir 49ca43d75c [FIX] website_sale: filter fiscal positions on company v2
Sequel of cc54194e13.
The mentioned fix only worked when the user was public.

The problem arises when calling the function `_get_fpos_by_region()`
in `sudo` without specifying the company and this happens, for instance,
in every `onchange_partner_*` function of a sale order.

We propose to add the `force_company` key in the context of the sale
order to ensure the right company when selecting the fiscal position.

closes odoo/odoo#31751

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-03-11 14:57:21 +00:00
Yannick Tivisse 0ab333c6e8 [FIX] hr_skills: Don't set 'false' line in no value to set
closes odoo/odoo#31334

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-03-11 14:28:14 +00:00
Lucas Lefèvre f6d2d0fd87 [FIX] hr_skills: Allow searches on employee skills/resumé
Search term should match in the resumé line title or
in the resumé line description.
2019-03-11 14:28:13 +00:00
Lucas Lefèvre d03bff47f3 [IMP] hr_skills: Add demo data for all employees 2019-03-11 14:28:13 +00:00
XavierDo 49db3d92e7 [FIX] mail, test_mail: don't notify inactive users
We don't want to notify inactive followers,
especially in the case of oddobot that was considered
as a inactive partner in _notify_compute_recipients.

The computed recipient data for odoobot are
(pid:2 active:False pshare:True notif:None)

It was considered as a partner and notified by email.
This fix simply removes inactive partner from partner to notify.

closes odoo/odoo#31734

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-11 12:50:05 +00:00
Priyanka Kakadiya 67990f91f1 [IMP] website_sale: adapt wishlist tour to product configurator fixes
Before this commit the flow of using wishlist with dynamic attributes was not
tested, and it also wasn't tested when combinations were not possible.

Those cases are now tested too.

closes #29859
PR: #31752
task-1920065

Signed-off-by: Sébastien Theys <seb-odoo@users.noreply.github.com>
2019-03-12 16:26:09 +00:00
Jorge Pinna PuissantandSébastien Theys 47016a1df3 [FIX] portal: sent form without signing
In the portal, when the client signature is asked (for a SO for example).

Before this commit, the client could send the form without really signing
the document.

Now, a warning is shown if the form is not signed.

opw-1943702

closes odoo/odoo#31768

Signed-off-by: Sébastien Theys <seb-odoo@users.noreply.github.com>


Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-03-12 14:58:17 +00:00
Nans Lefebvre 37689b189e [FIX] payment: do not retry indefinitely to post process transactions
Suppose that a payment transaction cannot be reconciled for any reason.
Then _cron_post_process_after_done will try to process it every 10 minutes until
the end of time.

Moreover, if the user takes some manual action before
_cron_post_process_after_done,
even if in principle it would have been able to go through,
then it is likely to fail, e.g. on invoice_open.

Meaning that a transaction that could have been processed will become
an undead transaction.

To avoid that situation we set an arbitrary retry_limit_date set to 2 days,
which seems a reasonnable compromise.
It gives some time for the transaction to go through, but not exaggeratedly so.

opw 1945953

closes odoo/odoo#31791

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-12 14:17:38 +00:00
Martin Trigaux 7e2f9634d2 [FIX] web: do not use t-if inside assets
This makes the assets to be recomputed everytime somebody with a different
language load the page.

closes odoo/odoo#31782

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-03-12 10:58:53 +00:00
Sébastien Theys cd773e79df [FIX] website_sale: prevent crash if setting qty to 0 in cart update
When there is an optional product for which the quantity is set to 0 because
there is no stock available, the cart update would raise because it tried to
read the order line even though it was deleted above.

Now we apply the logic only if the order_line actually exists.

Part of task 1950712

closes odoo/odoo#31779

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-03-12 10:59:27 +00:00
Nicolas Martinelli 77584bee3c [FIX] website_sale: price precision
- Set company currency as VND and Enable the Multi-currency with USD
- Create Pricelists for VND & USD, set them as 'Selectable'
- Without being logged, go to eCommerce
- Select the USD pricelist
- Open a product page

The price has zero decimals, while it should have 2.

When the product page is opened, a RPC call is performed on
`get_combination_info_website`:

https://github.com/odoo/odoo/blob/7612f2c55cd4795b109a3b3dc3099f280ce99a7f/addons/sale/static/src/js/product_configurator_mixin.js#L71

When the response is received, the price is updated in:

https://github.com/odoo/odoo/blob/7612f2c55cd4795b109a3b3dc3099f280ce99a7f/addons/sale/static/src/js/product_configurator_mixin.js#L472

However, `_priceToStr` uses the decimal precision of
`product.currency_id.decimal_places`:

https://github.com/odoo/odoo/blob/7612f2c55cd4795b109a3b3dc3099f280ce99a7f/addons/sale/static/src/js/product_configurator_mixin.js#L543

This is incorrect: it should be the currency of the website, not the
curency of the product.

opw-1947140

closes odoo/odoo#31770

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-12 09:56:19 +00:00