Commit Graph
126133 Commits
Author SHA1 Message Date
Luis González 3c9a50569a [FIX] account: Not enough account codes for created journals
When journals of type bank are created, default accounts are also
created, and an account code is automatically generated. However, the
number of possible automatic account codes is very limited, because only
100 different codes may be generated, and the error message "Cannot
generate an unused account code" is shown.

To solve the above, the number of possible account codes is raised up to
10,000 different possibilities.

closes odoo/odoo#31681

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-03-07 18:00:04 +00:00
Jorge Pinna PuissantandToufik Benjaa dd8494313f [FIX] account: instant payment post process
When register a payment, and choosing a payment acquired.

Before this commit, the payment post process had to wait until a cron
run (every 10 minutes).

Now, The post process is executed instantly after the payment, if the
payment is not yet done, the post process will be executed in the next
cron run.

Co-authored-by:  Toufik Benjaa <tbe@odoo.com>

opw-1928834

closes odoo/odoo#31732

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-11 12:02:32 +00:00
Martin Trigaux fdce99424b [FIX] base_automation: do not read all fields
vals may be an empty dict
This may happen a write is done on a computed field, the call to _write will
be empty (still needed to update write_uid/date).

Before this commit, all fields were read in the read call.
This was unecessary and may produce acess-rights errors or other side effect
(e.g. in odoo/enterprise#3778 the technical field ticket_count was read, even
if not present in the view or the write call)

Only compute old_values on the fields that are modified

Fixes odoo/enterprise#3778
opw-1949911

closes odoo/odoo#31737

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-03-11 10:50:45 +00:00
Elmeri Niemelä ec40cbb5b0 [CLA] Sprint IT
closes odoo/odoo#31728

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-10 16:57:09 +00:00
ypapouin 05275d95c8 [CLA] signature for Yann Papouin
closes odoo/odoo#31725

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-11 12:20:10 +00:00
Nans Lefebvre 245286949f [FIX] web: fix kanban css for overflows
If the content is too long, it overflows badly.
Since the height is fixed, the flex doesn't work well.

opw 1924145

closes odoo/odoo#31717

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-08 16:07:34 +00:00
VysakhMenon 3e645cd255 [CLA] signature for VysakhMenon
closes odoo/odoo#31611

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-11 12:21:53 +00:00
Alex Tuyls bcf722f639 [FIX] mail: incorrect check in template if no company set
In case company is not set on the model related to the template,
we should not try to retrieve it when creating the associated partner.

Fine-tuning of a46138cb01

opw-1947334

closes odoo/odoo#31607

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-11 12:18:38 +00:00
cristinamartinrod ca1b201cec [FIX] website_mass_mailing: translate button
The text was in a value tag, making it untranslatable

Closes odoo/odoo#30774

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-07 15:36:58 +00:00
Pedro M. Baeza 98b2784d1e [CLA] backport of e78af353fc to 10.0
Include cristinamartinrod in CLA of Tecnativa

Needed for odoo/odoo#30774
2019-03-07 15:36:47 +00:00
Rémi Rahir cc54194e13 [FIX] website_sale: filter fiscal positions on company
When creating a cart on the website, the website company was not
considered which could end up with the selection of a fiscal position
linked to a wrong company since the method is called in sudo.

closes odoo/odoo#31673

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-03-07 15:38:10 +00:00
Christophe Simonis db50050ed3 [MERGE] forward port branch 11.0 up to 7698f18ddd 2019-03-07 10:26:07 +01:00
Martin Geubelle d2d7f57529 [FIX] *: remove references to kanban_label_selection widget
This widget does not exist anymore since the merge between the all widgets
(new view refactoring).

closes odoo/odoo#31643

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-07 08:45:41 +00:00
Martin Geubelle 590c9d8e33 [FIX] web: add a fallback for kanban_label_selection
Before 11.0 the kanban view used to have its own widget registry. It is not the
case anymore, but there are still leftovers from the past. For example, the
widget `kanban_label_selection` is still used in many views, even though it is
now called `label_selection`.

As we are in a stable version, a fallback has been added for it in the field
registry.

Similar to odoo/odoo@5401c15

Closes odoo/odoo#30904
Closes odoo/odoo#25928
2019-03-07 08:45:41 +00:00
Aaron Bohy abf3506543 [FIX] web,hr: don't display dept complete_name in searchpanel
The departments being already rendered according to the hierarchy,
only the name of the department should be displayed (e.g. 'Direct
Sales' instead of 'Sales / Direct Sales'.

closes odoo/odoo#31353

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-03-07 07:51:44 +00:00
qmo-odoo 24d30331d6 [FIX] website_slides: no completion for public user
When a slide is seen by user, it should be marked as completed
(according to its type), and the user completion for the course
is updated. But for public user, we don't want those RPC calls
to be done, as completion for visitor makes no sense.
This commit also hide progressbar when current user is public.

Task-1942852

closes odoo/odoo#31700

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-12 15:36:50 +00:00
qmo-odoo fd78a40836 [REF] website_slides: revamp fullscreen widget
This commit makes the 'Fullscreen' page a complete odoo
widgets. We decided to split it into some sub widget:
- Fullscreen: will be the master piece, handle communication of
components, displaying slide content, setting slide as completed,
handling server RPC calls, ....
- Sidebar: responsible for slide navigation, based on the table of
content. (prev, next, keyboard naviguation, ...)
- VideoPlayer: display content for Youtube video and handling player
event to auto set as completed, ...

The DOM of this page is still rendered serverside. DOM was cleaned in
order to be less complex and less deep. CSS style was also reviewed
to decrease line of code.

Fullscreen is now completely using Quiz widget with events triggered.

Task-1942852
2019-03-12 15:31:40 +00:00
Romain Derie c9f832d9f0 [FIX] test_website: restore test now that fix has been forward-ported
Commit ef03db9ed added back the reset_templates functionality and some tests in
Odoo 12.0.
Commit fcb972db9 skipped one of the tests in Odoo saas-12.2 as there was a race
condition (new editor).
Commit 7c045dda0a fixed the race condition in Odoo 12.0 even if the error never
showed, it was safer.

Now that the fix got forward-ported to Odoo saas-12.2, we can add back the
skipped test.

closes odoo/odoo#31780

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-12 10:17:27 +00:00
Christophe Simonis 8f1daaf937 [FIX] {,test_}mass_mailing: set mail.mass_mailing subject
Field is required.
2019-03-11 15:44:32 +01:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Robot Odoo 0c1eff0d95 [MERGE][IMP] survey: apply small tweaks on survey views (certification)
Purpose
======

This merge implies several small tweaks on the survey views, mainly to add support for the new certification fields.

Show the quizz_passed field in the answers views
-------------------------------------------------------------------

The quizz_passed field is now more important because it determines whether
a certification has been successfully taken or not.

The quizz_passed field is added in:
- The search view of user_input
- The list view of user_input
- The form view of user_input (along with the score)

Fix survey statistics computation
-------------------------------------------

Fix the shared dict in the survey statistics computation that
causes surveys to incorrectly share the same stats when computed in batch.

Add a stat button on survey to show the certified count
------------------------------------------------------------------------

Add a stat button on the survey form view showing the amount
of answers with the quizz_passed field set to True.
It allows to quickly see people that have been granted the certification.

On click, the stat button redirects to the answers list view with the "Quizz passed"
filter defaulted to True.

Task-1936539

closes odoo/odoo#31467

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-11 13:07:38 +01:00
Aurélien Warnon 7070fa3219 [IMP] survey: rename 'Survey' to 'Certification' when relevant
Purpose
=======

This commit reworks some views to rename 'Survey' to 'Certification'
for a better visual integration of the new certification flow.
2019-03-11 10:46:11 +00:00
Christophe Simonis 2b3296bbf8 [FIX] web: use stricter css selector in new test
It allow not matching the dropdowns of the search view.

closes odoo/odoo#31738

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-11 10:16:53 +00:00
Odoo Translation Bot ae8aac2a18 [I18N] Update translation terms from Transifex 2019-03-10 06:02:07 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Christophe Simonis c023d0784f [MERGE] forward port branch saas-11.3 up to ecd8c023b7 2019-03-08 16:10:55 +01:00
Toufik Ben Jaa 7d4ca67680 [FIX] website_links: links fetching not working
- The fetch of recently/most clicked links was not working due to the
  fact that the widget handling this feature had not parent, thus not
  having access to ajax.rpc to make rpc calls.

closes odoo/odoo#31712

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-08 14:54:37 +00:00
Thibault Delavallée 57004e22b0 [FIX] website_slides_survey: avoid issue when fetching certification information
Information was already present, let us use it instead of having access issues
on membership.

Commit linked to task ID 1941250 and PR #31708.

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-08 14:51:25 +00:00
Thibault Delavallée bccfe8a418 [IMP] website_slides: display a flag for unpublished lessons in course list view
It helps course maintainers understanding the state of their lessons.

Commit linked to task ID 1941250 and PR #31708.
2019-03-08 14:51:25 +00:00
Thibault Delavallée 6b7eeac56d [FIX] website_slides: fix domain computation of a channel slide list
When displaying a channel content all its slides are displayed in a
list view or cards view. Even slides current user cannot read because
he is not member of the channel are displayed, even if there is no link
(and access rights prevent them for effectively accessing the slide).
Purpose is to display a channel content without giving access through
ACLS at its slides.

However this domain computation was not correctly matching real use case
 * publishers should see everything;
 * public users should not see unpublished slides;
 * members not publishers should not see unpublished slides unless they
   uploaded it;

Commit linked to task ID 1941250 and PR #31708.
2019-03-08 14:51:05 +00:00
Thibault Delavallée edf68bde6c [REF] website_slides: extract code to have slides per category
Purpose of this commit is to have a method allowing to fetch slides
and have them ordered by category with some info on the category. It
fully supports uncategorized slides.

This commit also fixes the lessons list view of a training course. When
having rights to edit the channel the category name was not editable.
We now use a real browse record allowing to edit the category names
directly in this reorderable list view.

Commit linked to task ID 1941250 and PR #31708 .
2019-03-08 14:46:32 +00:00
Antoine Guenet c9b1401a23 [FIX] web_editor: update the handle on click input node in website edit
When clicking on a snippet containing an input node on Firfeox, the
handle wouldn't appear as expected. This is due to trying JQuery (but
not only) trying to modify properties that are restricted on Firefox but
not on Chrome. The error message still appears from time to time due to
Summernote using `document.getSelection`, which is problematic with
Firefox. This will be fixed with the next version of the editor. In the
meantime the direct effect of that error (the handle issue) is fixed
with this commit.

The standard target (`Event.target`) is now looked for in first position
instead of non-standard 'Event.srcElement` (IE alias for `Event.target`)
then `Event.originalTarget` (Mozilla-specific) and finally
`Event.target` (standard). `Event.originalTarget` is restricted on
Firefox so it was giving the same cryptic error as mentioned above
("Error: Permission denied to access property", which generally points
to same-origin policy violations).

Ref:
- https://developer.mozilla.org/en-US/docs/Web/API/Event/srcElement
- https://developer.mozilla.org/en-US/docs/Web/API/Event/originalTarget
- https://developer.mozilla.org/en-US/docs/Web/API/Event/target
- https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects
- https://developer.mozilla.org/en-US/docs/web/javascript/reference/errors/property_access_denied

closes odoo/odoo#31710

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-08 14:41:49 +00:00
Thibault Delavallée 7afd23e56c [FIX] website_slides: various fixes
Display
 * improve color of trophy displayed on top of course main page (success if
   course done, warning while working on it);
 * correctly fetch and display karma/xp points on course lesson list. It is
   either gain of next try, either awarded points depending on slide
   completion;
 * fix control buttons in course main page (prev, next, set done,
   set completed, fullscren), notably correctly set them disabled;

Linting / Code
 * put demo in no update;
 * rename some parameter in website_slides_survey to avoid conflict between
   quiz (on a slide) and certification (a survey);

 Commit linked to task ID 1941250 and PR #31697.

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-08 11:15:07 +00:00
David Beguin 523c1276a1 [IMP] gamification : move rank demo data into data
In order to se the 'next rank card' and the user karma on user's profile page,
not only the first rank is needed but also higher ranks. Otherwise everyone
will be 'Newbie', even the admin.

Moreover it is easier to update existing data for things like rank than having
to figure out how it works.

Task ID : 1941250
PR #31697
2019-03-08 11:15:07 +00:00
David Beguin f38a81f981 [IMP] website_slide_survey : set slide completed when quizz_passed
This commit sets the completed flag to True for a slide of type certification
when this certification is succeeded (quizz_passed set to True).

Also, the Download certification button has been added to the fullscreen mode
if the certification is passed by the user.

Task ID : 1941250
PR #31697
2019-03-08 11:15:07 +00:00
David Beguin 6091062e66 [IMP] website_(profile, slides): add custom pager to show on all users / courses pages
If there are too much users to show on the page and to avoid performance
issues, a pager is now applied on the all users page.

A new pager based on website_pager is added in order to ease the navigation
through the potential high number of pages. 'Go to first page' and 'Go to last
page' buttons have been added and the design of the pager have been adapted
to be more integrated into the new eLearning platform.

Also add the pager on the slide page if search category is applied. The pager
was already computed in the controller but not displayed.

Task ID : 1946160
PR #31697
2019-03-08 11:14:45 +00:00
Aurélien Warnon db53057528 [IMP] survey: add a stat button on survey to show the certified count
Purpose
=======

This commit adds a stat button on the survey form view showing the amount
of answers with the quizz_passed field set to True.
It allows to quickly see people that have been granted the certification.

On click, the stat button redirects to the answers list view with the "Quizz passed"
filter defaulted to True.
2019-03-08 11:00:06 +00:00
Aurélien Warnon 1932e25f68 [IMP] survey: show the quizz_passed field in the answers views
Purpose
=======

The quizz_passed field is now more important because it determines whether
a certification has been successfully taken or not.

This commit adds the quizz_passed field in:
- The search view of user_input
- The list view of user_input
- The form view of user_input (along with the score)
2019-03-08 11:00:06 +00:00
Thibault Delavallée 20e68b3297 [REF] website_slides: rework standard lesson page view
Purpose of this commit is to perform a cleaning and upgrade of the lesson
view in front-end when not using the fullscreen mode. This page had not
been updated since eLearning addition.

A method is added on slide model to have a protected method computing quiz
related information on a given set of slides, notably potential karma gain,
gained karma and number of attempts. It is mainly a code move from controllers
now working in batch.

Some linting is also done, notably a badly-named file.

See original eLearning task for main specifications [1].

Commit linked to task ID 1941250 and PR #31657.

[1] See task ID 1902304

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-07 19:51:33 +00:00
baef90d31d [REF] website_form_editor: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 19:01:03 +00:00
Suganthi Karunanithi eb62cd2c2b [FIX] gamification: badge auth for badge no error
To avoid exception:
  TypeError: Mixing apples and oranges: gamification.badge() - gamification.badge.user(1,)

when rule_auth of a badge is set to `having`.

opw-1945440
closes #31436
closes #31595

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-06 18:00:53 +00:00
Nicolas Lempereur ee5f1e277d [FIX] web: pivot no result no remove groupbys
Since f8b38f64d dictionaries "groupbys" are the same object between the
pivot model instance and the headers menu.

But this causes an issue in 12.0 since when there is no results, the
headers menu groupbys is truncated and now being the same object, the
pivot model instance is also truncated.

So succedding search that find results would possibly have lost the
groupbys which is unexpected and breaks some 12.0 tests not expecting
it.

With this changeset, the groupbys are not truncated anymore.

Without the change, the added test fails with:

 Column groupby not lost after reload after empty results
  expected: { "pivot_column_groupby": [ "customer" ],
              "pivot_measures": [ "__count" ], "pivot_row_groupby": [] }
  result:   { "pivot_column_groupby": [], "pivot_measures":
              [ "__count" ], "pivot_row_groupby": [] }
closes #31644

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-06 17:02:35 +00:00
Luis González 7ef6557902 [FIX] l10n_mx: Add sequence to taxes for IVA 8%
Since those taxes are missing a sequence and they're at the bottom of
the data, they're being taken as the default ones for the mexican chart
of accounts. However, the default taxes for sales and purchases should
be IVA 16%.

closes odoo/odoo#31651

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-07 02:28:39 +00:00
Nathan de Pryck 10964a230c [IMP] account_asset,account: Performance improvements
The generation of the deffered revenues took initially 471s.This
improvement permit to reduce the time to 72s (behave Cprofiler).
The issue was related to the fact that all the message post and logs
invalids the cache. It results that several read requests were
repeated multiple times.

closes odoo/odoo#31750

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-03-14 09:36:41 +00:00
Martin Geubelle 1793d6d138 [FIX] web: update breadcrumbs when switching view
To reproduce:
 1. go on list view
 2. open record in form view
 3. come back on list view
 4. switch to kanban
 5. open record in form view
 6. click on breadcrumb

Before this rev. we were back on the list view, and not the kanban view.

This is due to the fact that the breadcrumb was not updated when switching view,
(if a controller was already existing) so the form view control panel breadcrumb
was still referencing the wrong (list) controller.

This bug appeared with the control panel refactoring, which is now managed by
the view itself (and not the action manager as previously).

Task 1932646

closes odoo/odoo#31598

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 10:28:01 +00:00
Toufik Ben Jaa 5805c032a4 [FIX] analytic: name_search return no results
- Since the commit 5fcf891e07 an issue has
  been introduced in the `analytic.account.analytic` name_search method.

  In some cases searching through analytic accounts will return no
  results when it should.

  The issue is due to a bug in `expression.py` that doesn't correctly
  handle the fields in `auto_join`.

  The issue is described here https://github.com/odoo/odoo/issues/25175
  and will be fixed by the ORM team.

closes odoo/odoo#31628

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06 12:15:35 +00:00
Julien (juc) Castiaux e0bd7b9932 [FIX] mass_mailing: inline image not supported
Inline (base64) embedded images are not supported by most mail
clients (gmail on top of them), this fix save those images as
attachments and replace the src tag with the url of the
generated image so the image correctly renders.

opw-1929940

closes odoo/odoo#31532

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-03-06 09:04:29 +00:00
Toufik Ben Jaa e4c434c6ff [FIX] hr_holidays: inconsistency in leave record rules
- `hr.leave` and `hr.leave.allocation` should have the same record
  rules, otherwise leave approval behavior can be unpredictable.

  As a Holidays Team Leader:
    For example you could see the approve button on a leave but cannot
    approve it because the `_check_holidays` fails

closes odoo/odoo#31620

Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2019-03-06 09:03:28 +00:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
Christophe Simonis 27081bf6f5 [MERGE] forward port branch saas-15 up to c03f6db6ea 2019-03-05 16:45:22 +01:00