Commit Graph
126256 Commits
Author SHA1 Message Date
Christophe Matthieu 832357f0b7 [FIX] web_editor: use website color for popover edition 2019-02-19 08:43:51 +00:00
Christophe Matthieu 60c013749e [FIX] web_editor: speeder edition of field char on website_blog
Before this fix, the customize button was updated with each character,
which slowed down the fast insertion of characters and used resources
unnecessarily.
2019-02-19 08:43:51 +00:00
Christophe Matthieu b7818fe036 [FIX] website: don't not edit not editable contents or branded hr, br... 2019-02-18 09:45:38 +00:00
mgh-odoo e096dc9b66 [IMP] mail : autofocus items in autocomplete inputs
With this commit, when using autocomplete inputs in Discuss
or chat windows, the 1st item is automatically auto-focused.

Example of autocomplete inputs:
- Discuss: "Add or join a channel" in sidebar
- Chat window: when clicking on "New Message" from systray
    messaging menu.

As a result, we can use keyboard keys to navigate and select
the desired item.

Task-ID 1894447

closes odoo/odoo#30207
2019-02-19 09:56:26 +00:00
qmo-odoo c564ae6c87 [IMP] website_slides: Add elearning feature to slides
Purpose of this commit is to introduce a new way of displaying and managing
slides in eLearning module. Its purpose is to give a better experience to
users when going through a course. Notably a fullscreen mode allows to take
lessons one by one without going out of the elearning display. Integration
of all slide types eases taking the course step by step.

Quiz are introduced in this commit. Those are an addition to slides with
some question / answers (multiple choice). It allows customer to gain karma
and improves gamification. Certifications are still done using the survey
application. Quiz targets only small tests at the end of a given slide.

A new widget is added to display and control slide display in fullscreen
mode. Old display is still available for documentation channels or when
going out of fullscreen mode, to see details on comments / review / statistics
and have access to share options.

This commit is linked to task ID 1902304 and PR #29876. It closes the main
work on refactoring website slides into eLearning, with other tasks already
merged in current community [1][2][3][4][5].

[1] Task ID 1940360 landed at b2149bc7a2: certification inclusion
[2] Task ID 1936153 landed at 6c6179e57c: homepage inclusion
[3] Task ID 1937160 landed at 8b7605c9e5: selling courses
[4] Task ID 1922159 and 1940516 landed at 5fa651cb01 and 6a64c3ce82:
    new user profile and gamification of slides / forum
[5] Task ID 1938643 landed at 77b5673a0d: upload channel/slide
2019-02-19 13:11:15 +00:00
Vandan Shah 7a80ebe35e [IMP] *: Add progress bar on kanban views based on activities
Purpose
=======

If the activities are available on a model (i.e. inherits mail.activity.mixin),
add a progress bar based on the activities if nothing is defined yet.

closes odoo/odoo#24777
2019-02-19 11:01:40 +00:00
Vandan Shah d09ecc8b18 [IMP] web: improve kanban tooltip
1) Remove the total record tooltip from kanban group.
2) Remove progressbar help from kanban view.
3) Improvements in testcase since we have removed total record tooltip.
2019-02-19 11:01:40 +00:00
Antoine Guenet f5c269db12 [FIX] web_editor: properly position image handle in product configurator
The image handle (grey overlay over the image) was not properly
repositioning on scroll in the product configurator (a side effect of
not having a popover).

closes odoo/odoo#31226
2019-02-19 09:06:49 +00:00
Antoine Guenet d9a77bd846 [FIX] web_editor: stop wrapping text in p on delete in anchor
This notably fixes a bug with the accordion snippet (website) where
selecting a title and typing seemed to add a newline.

closes odoo/odoo#31222
2019-02-19 09:46:28 +00:00
David Monjoie addeae990f [IMP] base,doc: add scales attribute to gantt view
closes odoo/odoo#31210
2019-02-19 08:28:29 +00:00
David Monjoie 7c48315d7a [IMP] base,doc: add offset attribute
Depending on the scale, the number of units to add to today to
compute the default period. Examples: An offset of +1 in default_scale
week will open the gantt view for next week, and an offset of -2 in
default_scale month will open the gantt view of 2 months ago.
2019-02-19 08:27:53 +00:00
Antoine Guenet 1f4b606ad0 [FIX] web_editor: remove invisible space on insert media where forbidden
The web editor inserts zero-width characters (unicode 200B) around media
when inserting them in the DOM so as to be able to edit before and after
said media (contenteditable caveat). It should however not do so in fake
not-editable nodes - such as the navbar - given that we do not expect to
edit in them but only to replace the media. This ensures that behaviour.

closes odoo/odoo#31200
2019-02-18 13:06:17 +00:00
Christophe Monniez fec86404e7 [IMP] tests: replace browser_js success and failure strings
When evaluating js tests using the browser_js method, they are
considered a success when 'ok' is found in the console log and a failure
if 'error' is found instead.

This is not very robust and recently failed with this commit : 7410de111f
It adds a filter named 'Error' in a view, when the 'click_all' test
clicks on this filter, a message with the name of the filter is written
in the console, wrongly leading to a test failure.

With this commit, the browser_js method expects a log message in the
browser console with the explicit text "test successful".
On the other hand, any error in the console log will lead to a test
failure but a test can be forced to fail with the explicit error message
in the browser console "test failed".

As a bonus, the python logger should now also log browser js trace messages.

closes odoo/odoo#31158
2019-02-19 08:06:07 +00:00
Robot Odoo 83e6faf9a2 [FIX] website_slides: hide publish widget if user cannot publish
Purpose
=======

The "publish/unpublish" widget is always shown on slide.channel/slide.slide for
a website_publisher user even if he's not allowed to manage the publishing of
the channel (see slide.channel.can_publish field).

This commit will hide the widget on both the slide.channel and the slide.slide frontend
pages if the user doesn't have the right to publish/unpublish. A generic solution
implemented directly in the publish mixin has been chosen to ease understanding
and allow easy reuse in other applications.

Commit linked to task ID 1902304 (main elearning task).

closes odoo/odoo#31187
2019-02-19 10:20:00 +01:00
Robot Odoo d56402a547 [FIX] doc: build errors & some warnings
closes odoo/odoo#30835
2019-02-19 08:09:28 +01:00
Aurélien Warnon 3c88e75c86 [FIX] website_slides: handle publishing rights of channel/slide
Purpose
=======

Handle publishing of the slide.slide/slide.channel accordingly to the new
'can_publish' field in the website published mixin.
2019-02-19 07:08:03 +00:00
Aurélien Warnon 916968058d [IMP] website: add a field to handle publish rights for publish mixin
Purpose
=======

The "publish/unpublish" widget is always shown on the frontend as long as the user
is a website_publisher and the object has a "website_published" field.

In some modules (namely website_slides) we need to handle a more refined level of access.

This commit adds a "can_publish" computed field that can be overridden to add some additional
access rules to the object and hide the widget if the user doesn't have the rights to
publish/unpublish.
2019-02-19 07:07:02 +00:00
Yannick Tivisse 7cd45840fc [IMP] hr_payroll: Set structure on generated payslips from benefits
closes odoo/odoo#30432
2019-02-18 16:16:20 +00:00
RomainLibert 1e12ce3430 [IMP] hr_payroll: add multi company rules on benefit and payslip run
Task 1913733
2019-02-18 16:16:20 +00:00
RomainLibert afde04dd54 [IMP] point_of_sale: make pos_session multi company aware
When creating a pos session we try to link the session to
the first cash journal we find.

The problem is that we cannot link a journal comming from another
company this is strictly forbidden by a constraint.

This is why we should make sure that we search only for journals in the
same company as the config.

Task 1913733
2019-02-18 16:16:20 +00:00
Yannick Tivisse ef048c24de [IMP] l10n_in_hr_payroll: Remove useless reports
They don't show anything that is of interest.

Task 1913733
2019-02-18 16:16:20 +00:00
qsm-odoo 9d5fa81ba3 [REF] website_theme_install: update theme install screen design
task-1907934

closes odoo/odoo#31114
2019-02-18 09:50:03 +00:00
Robot Odoo 6a64c3ce82 [MERGE][IMP] website{_profile, _slide,_forum,*} : improve slides integration in user profile and add karma generation
Purpose of the merge is to continue the work done from PR #30988.
This completes the website profile page,  gamifies the under development eLearning [1][2]
and continues integration between eLearning and the forum.

This merge contains notably:
- Complete profile page with course progression detail and eLearning certifications
- Apply Karma gains on various action on the eLearning
- Allow to set the communication type on eLearning course at creation (frontend)
- Redesign website users page

See sub commits for more details.

Merge linked to task ID 1922159 (elearning gamification / website_profile)
and task ID 1940516 (forum comments) PR #31097.

[1] see task ID 1902304 (main eLearning task) PR #29876.
[2] see task ID 1936153 (new homepage for slides) PR #30770.

closes odoo/odoo#31109
2019-02-18 17:15:58 +01:00
David Beguin 2c01452d4b [IMP] website(_profile,_forum,_survey) : redesign website all_users page
As the eLearning (website_slides) is also using website_profile users,
the All Users page is moved from website_forum to website_profile, to be
useable in both forum and eLearning.

This page displays also the number of karma point, badges and certificates
of each user.

The users are sorted by their karma points and the first 3 users are
promoted on a podium.

Use span instead of b tag in profile page

Task ID : 1922159
PR #31109
2019-02-18 15:15:06 +00:00
David Beguin 5125eecce5 [IMP] website_slides_survey : add certifications in website profile page
For users viewing their own profile page on the website,
a new section 'Certifications' is added to the about tab.
Thoses certifications are the survey that activated certificate.

Task ID : 1922159
PR #31109
2019-02-18 15:15:06 +00:00
David Beguin 3ab9f1d8ab [IMP] website_slides_forum : set communication on slide.channel at creation - frontend side
Since 556b6454dab07cdf716d404ec0db9aa51a09b165, channel can be linked to a dedicated forum.
But the link could only be done in backend, in the slide.channel configuration
For now on, website_publishers can create a new dedicated forum when they create
a new slide.channel.

Link buttons have been added in both forum and slide.channel headers to navigate easily
between them.

Fix the relation between course and forum in a model point of view.

Task ID : 1922159
PR #31109
2019-02-18 15:15:02 +00:00
David Beguin 705376a982 [IMP] website_slides : add karma gain rules
To gamify the new elearning, karma can be gained on various actions
- rank a slide_channel (course)
- vote for a slide
- finish a course

This commit also fix the 'completed' computation on slide.channel.partner

Task ID : 1922159
PR #31109
2019-02-18 15:01:40 +00:00
Thibault Delavallée 0fe26b382c [FIX] website_slides: fix computation of completed courses 2019-02-18 14:53:10 +00:00
David Beguin 16b0b18361 [IMP] website_slides : show completed and ongoing course on profile
Two new sections are added in the profile page : Completed courses and Followed courses
Thoses sections replace the former 'Courses' section.

Use span instead of b tag in profile page

Task ID : 1922159
PR #31109
2019-02-18 12:16:08 +00:00
Xavier Morel f7e1f0645e [IMP] doc: PYTHONPATH configuration
Previously we'd `append` the extensions and odoo parent directories to
sys.path, however this means if an `odoo` is already installed in a
sys.path (e.g. global installation, or setup.py develop in a venv,
...) *that* will be used as the source of Python code (for autodoc)
instead of the Python source being synchronised with the rst, which
can lead to very odd behaviour.

Prepend the doc's stuff to the PYTHONPATH instead, to ensure they get
priority and the code matching the rst gets loaded.
2019-02-18 08:56:07 +00:00
Xavier Morel 7065ea520c [FIX] *: various docstring formatting issues
Would yield block quotes instead of code blocks or lists or whatnot.
2019-02-18 08:56:07 +00:00
Xavier Morel 3f8d20b778 [FIX] web_editor: various levels of broken in docstrings 2019-02-18 08:55:57 +00:00
Xavier Morel cca26f7952 [FIX] doc: workarounds for weirdo code & refs
Make UnknownNS more capable (of giving no fucks) so the documentation
builder blows up less on weird-ass code at module toplevels.

UnknownNS should probably be split out from NSDoc though, that requires
odd workarounds in `__getitem__`.
2019-02-18 08:55:57 +00:00
Arnaud Baes dba97a2689 [FIX] stock: Scrap button.
The 'scrap button' should be visible only if:
- The picking is a done receipt
- The picking is a not done delivery
- The picking is internal

TaskID: 1930221

closes odoo/odoo#30466
2019-02-18 08:37:36 +00:00
Hugo Adan ef618df9e9 [REF] account: Performance improve unreconcile process (_reverse_move):
_reverse_move presents a critical performance issue when
unreconcile moves with a lot of account_move_line.

The issue is that `account.move` and `account.move.line` models are triggering computed fields/methods for each new
`account.move.line` added, computing all lines again and again.

Making a factorial performance issue.

For each line the function try create cash basis entries for tax/base lines and this is combined with all the
fields compute that exists on the model so this introduce a performance problem

The issue is that `account.move` and `account.move.line` models are triggering
computed fields/methods for each new `account.move.line` created isolated,
computing all lines again and again.

e.g.
 _compute_matched_percentage at
https://github.com/odoo/odoo/blob/5e8289cfeaf52a1eac64bcc975b186f0b5f9594b/addons/account/models/account_move.py#L44-L62

Then for each line modified/created this compute is executed for all lines (not just the last one).

Now by using self.env.norecompute() and self.recompute() the problem was reduced.

Unreconciling an 'account.move' with 1576 lines with a payment takes almost 4
minutes when before this changes, the conciliation process seemed not to never
end.

Fix https://github.com/odoo/odoo/issues/30934

closes odoo/odoo#31014
2019-02-17 10:28:21 +00:00
Hugo Adan ce93a949a7 [REF] account: Performance improve for create_tax_cash_basis_entry
create_tax_cash_basis_entry presents a critical performance issue when
reconciling moves with a lot of account_move_line.

The issue is that `account.move` and `account.move.line` models are triggering computed fields/methods for each new
`account.move.line` added, computing all lines again and again.

Making a factorial performance issue.

For each line the function try create cash basis entries for tax/base lines and this is combined with all the
fields compute that exists on the model so this introduce a performance problem

The issue is that `account.move` and `account.move.line` models are triggering
computed fields/methods for each new `account.move.line` created isolated,
computing all lines again and again.

e.g.
 _compute_matched_percentage at
https://github.com/odoo/odoo/blob/5e8289cfeaf52a1eac64bcc975b186f0b5f9594b/addons/account/models/account_move.py#L44-L62

Then for each line created this compute is executed for all lines (not just the last created one).

Now by using self.env.norecompute() and self.recompute() the problem was reduced.

Reconciling an 'account.move' with 1576 lines with a payment takes almost 4
minutes when before this changes, the conciliation process seemed not to never
end.

Fix https://github.com/odoo/odoo/issues/30934
2019-02-17 10:27:50 +00:00
Christophe Simonis 1cb3e7c522 [MERGE] forward port branch saas-15 up to c6c3d73391 2019-02-19 19:14:16 +01:00
Nicolas Martinelli bddd53881c [FIX] hr_holidays: numerical error
In some exceptional circumstances, the computation of the remaining
leaves might lead to numerical errors, e.g. a very small but non-zero
number (e.g. 10^-17)

This value will be displayed in the name of the leave type because of
the `%g` used in the string format. To avoid breaking the translation,
we round the value.

opw-1935232

closes odoo/odoo#31245
2019-02-19 12:43:07 +00:00
Nicolas Martinelli 29a3634c1a [FIX] l10n_us: ABA/Routing
When defining an ABA routing number with leading zeros (which is
possible), the value will always be displayed without them.

This is because the field is an integer. Since the ABA routing transit
number must be a nine-digit code, we automatically fill it with leading
zeros.

opw-1940138

closes odoo/odoo#31223
2019-02-19 07:59:25 +00:00
Nicolas Martinelli 3e147220fd [FIX] account_voucher: round globally
- Enable multi-currency. Company currency = USD, another currency = SGD
- Update the exchange rate
- Create a purchase journal. Assign SGD to this journal
- Create a purchase tax of 7.00 %
- Enable tax rounding globally
- Create a purchase receipt with the following values
  62.04 @ 7% tax
  7.29 @ 7% tax

An error occurs: 'Cannot create unbalanced journal entry.'

Each line of the receipt creates its own tax line, which is therefore
rounded => the total of the receipt is computed with a 'round globally'
configuration, while the taxes are computed with a 'round per line'
configuration.

This is because `apply_taxes=True` is set in the context. This creates
the tax line by forcing the rounding. Therefore, we call the method
`_apply_taxes` explicitly in this specific case, and manually round the
taxes once they are merged.

opw-1938623

closes odoo/odoo#31194
2019-02-18 12:55:35 +00:00
Nicolas Martinelli cece8834f9 [IMP] account: apply taxes
We extract the tax creation from the AML creation in an external method,
in order to be able to call it separately.

This is necessary for the subsequent commit.

opw-1938623
2019-02-18 12:53:58 +00:00
Nicolas Martinelli 3a5c50e5c6 [FIX] account: TaxCloud multi-company
The TaxCloud settings are not company-specific.

opw-1933774

closes odoo/odoo#31198
2019-02-18 13:10:22 +00:00
Alexandre Kühn fa2a5055e7 [FIX] im_livechat: instantly receive messages from new livechat
Before this commit, when new messages were posted in a new
livechat, the operator received them after a delay. This
may take up to a minute before receiving the notification.

This behaviour was causing a bigger issue: those notifications
may never be received by the operator. This case happened when
the operator was receiving more recent notifications while
notifications from new livechats were pending.

The delay was caused by the operator not yet subscribed to
notifications on the newly created livechat. It is only on
the next poll of longpolling that the subscription occurred,
then followed by dispatching the notifications to the operator.

This commit fixes the issue by dispatching new messages of new
livechats directly to the operator. This is done by enforcing
the operator to make another polling when a new livechat is created,
so that he is always subscribed to those livechats. As a result,
new messages are received instantaneously.

opw-1933951

closes odoo/odoo#31191
2019-02-18 12:20:40 +00:00
Odoo Translation Bot 5a3d4e4c80 [I18N] Update translation terms from Transifex 2019-02-17 06:02:37 +01:00
mreficent e74f96ba06 [FIX] hr_holidays: leave_type_request_unit field was declared twice
closes odoo/odoo#31162

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-02-15 18:36:37 +00:00
Martin Trigaux 62a29dba2c [REV] models: do not erase master version
This commit has been backported in 11.0 [1] and then reverted [2],
because it introduced a regression in web_studio, discovered at opw-1947380

As no forward-port has been done between the backport and the revert,
the forward-port of the revert also contains the patch itself, resulting
in a noop.

Actually revert 06d73eab62 in branch `12.0`.

[1] d855e3911f
[2] 1748b46718

closes odoo/odoo#31637

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06 14:45:21 +00:00
Lucas Perais (lpe) 1a9393c8d7 [FIX] account: invoice compute tax group amount correctly grouped
Before this commit, when printing an invoice, the taxes were grouped
by their tax group (NOT by their parent tax)
Summing the base of each tax in the process.

This was largely insufficient, as tax groups can have taxes
with different rates or computation method within them

The summing of the base of each tax for reach tax group was in this case plain wrong

This commit aims at grouping by
group > computation method > amount

Which makes more sense

OPW 1947202
OPW 1945353

closes odoo/odoo#31617

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-03-06 08:58:52 +00:00
Julien (juc) Castiaux c0847a7bd7 [FIX] project: subtask of duplicate project are linked to original
When duplicating a project, every task linked to the project is
duplicated too but the link between sub-tasks and their parent
task is not updated thus they are left linked to the task of
the original project.

opw-1937371

closes odoo/odoo#31154
2019-02-15 15:03:16 +00:00
Nicolas Martinelli e632e6c5e2 [FIX] account: do not copy alias
When duplicating a journal, the alias is kept. Therefore, when the user
tries to change it, it updates the value on both records.

opw-1941717

closes odoo/odoo#31242
2019-02-19 12:13:28 +00:00
Nicolas Lempereur 4b977f3b7d [FIX] website_crm_partner_assign: stage breadcrumb in order
If the stage breadcrumb on the portal view is too long, it could get on
two lines but since they are righ-aligned in inversed order, the second
line (or more) will be the first stages.

With this fix, the breadcrumbs are left-aligned so on two line the
second line are the last breadcrumbs.

Also there was possibly a different order than backend since the order
is on "sequence, name, id" in backend but was just "sequence" here.

opw-1934497
closes #31237
2019-02-19 11:11:15 +00:00