Commit Graph
124195 Commits
Author SHA1 Message Date
Odoo Translation Bot 9f6c2ec11c [I18N] Update translation terms from Transifex 2019-02-03 06:03:42 +01:00
Christophe Simonis 2f118c41fb [FIX] web,mass_mailing: adapt forward-ported tests to new version 2019-01-31 18:10:02 +01:00
Christophe Simonis f927c68ddb [MERGE] forward port branch 12.0 up to cb8fefa899 2019-01-31 16:59:58 +01:00
Alexandre Kühn 24ba5ae276 [FIX] mail: open 'My Activities' from systray activity menu
Before this commit, when clicking on the activity view icon
from an item in the systray activity menu, the activity view
had no search filter by default.

This commit now auto-select 'My Activities' in the activity
view when redirected from the systray activity menu.

closes odoo/odoo#30702
2019-01-30 17:18:48 +00:00
Vincent Schippefilt 5ce86a65ac [FIX] web: allow back-end to be usable with IE11
IE11 does not support Array.filter, so I replaced it with _.filter

closes odoo/odoo#30434
2019-01-31 09:15:33 +00:00
Alexandre Kühn 8897cb1feb [FIX] mail: keep activity notification counter on today's meetings
Before this commit, when a user had some meetings planned today
and open the systray activity menu, the counter would disappear.

This was caused by a weak computation of the counter that relies
on activity having always a total counter. This was not the case
for activity that are today's meetings: Counter would be computed
as `NaN`, and since `NaN` is falsy, it won't display the counter.

Today's meetings have no reason to have a counter, so this commit
fixes the issue by letting those activities not change the
computation of the counter.

closes odoo/odoo#30695
2019-01-30 13:18:18 +00:00
Martin Trigaux 6b054f2640 [FIX] web: do not select disabled element
If xlwt is not installed on the server, the option is disabled.
However, the first element was checked, even if it is disabled.

Trying to export record without xlwt was causing a traceback.

Introduced at b60de0db41 where xls is now the first choice

closes odoo/odoo#30724
2019-01-31 10:41:33 +00:00
Pierre Paridans 6ca2563155 [FIX] web: form's tabs should be scrollable on mobile
On mobile, swiping right/left switches to next/previous record.

This feature prevents the horizontal scroll of the form notebook's tabs by
overtaking the swipe gesture on those elements.

This issue had different consequences depending on the platform:
  - on iOS: the tabs cannot be scrolled at all.
  - on Android: the tabs can only be scrolled by using a two-fingers
    gesture

This commit restore the horizontal scroll on the tabs but also keep the
swipe-gesture to navigate records.

opw-1929267

closes odoo/odoo#30658
2019-01-30 15:42:41 +00:00
Olivier Dony 483b6024cd [FIX] base: restore auto report layout selection
As of 12.0 the superuser account (UID 1) is only meant to be used for
advanced debugging, and non-superuser admin accounts are used for
day-to-day administration.

Adapts the admin detection system to allow non-superuser admins to
select the report layout as well.
2019-01-30 22:31:51 +01:00
Olivier Dony e61b0cac46 [FIX] account_payment: warn when payment can't be matched
The payment reconciliation screen can't be opened if there is no partner
on a payment, and currently crashes with a traceback.
Rather than hiding the button which could cause surprises for users, we
can raise a proper error to explain why it can't work, for the cases
where a payment has no related partner.

This could happen for example when a customer paid via a direct
/website_payment/pay link.
2019-01-30 22:31:51 +01:00
Nicolas Lempereur 006002646e [FIX] survey: resend survey input=>right one
When we use "Send invitation again" on a survey.user_input, it will send
the first survey.user_input it finds corresponding to:

- the state "new" or "skip",
- the partner it must be sent to,
- the survey the user_input corresponds to,
- the email it must be sent to,

or if none found, it could be create a new one.

This is an okay behavior in most instance, but in the case of
hr_appraisal where a manager could have same survey to fill for
"employee A" and "employee B" and when you send them again, we would receive two
mails linking to the same employee.

With this changeset, the current behavior is kept but when an existing
user_input is resent, we prioritize itself before searching a matching
one.

opw-1934478
closes #30693
2019-01-30 13:43:14 +00:00
Denis Ledoux d11a2000c4 Revert "[FIX] base ir.actions.report order pdfs when attachment_use option selected"
This reverts commit 529069996c, reversing
changes made to 76e085cbb7.

PR #30690 is a cleaner solution to the problem
than PR #30402.

closes odoo/odoo#30696
2019-01-30 14:00:49 +00:00
Nicolas Martinelli 1b753b0d53 [FIX] document: PDF indexing
Since PyPDF2 gives bad results for PDF indexing, stop using it since it
raises more issues than it helps users.

opw-1928446

closes odoo/odoo#30692
2019-01-30 12:50:27 +00:00
Christophe Simonis 5ad3d599ce [MERGE] forward port branch 11.0 up to 7eec6b3643 2019-01-30 13:25:36 +01:00
Denis Ledoux 651859a337 [FIX] web: reports, fallback for external report layout.
Following revision 61eef73b52

the fallback to the standard external layout when
the external layout is not set on the company has been removed.

It therefore leaded to the raise of the exception
```
The report's template '%s' is wrong, please contact your administrator.
Can not separate file to save as attachment because the report's template
does not contains the attributes 'data-oe-model' and 'data-oe-id'
on the div with 'article' classname.") %  self.name)
```

when the external layout was not set,
which could happen quite easily in a multi-company environment,
if you do not set the company external layout after having created it.

This revision simply puts back the fallback as it was before.

opw-1931195

closes odoo/odoo#30687
2019-01-30 10:57:00 +00:00
Julien (juc) Castiaux c7b6fcb9f2 [FIX] hr_holidays: Disable emails when importing from file
When using the "test import" feature to import leaves request, odoo
fails with a 500 error and no error message.

The only difference with a real import is that the test dry-runs by
rollbacking. The issue here is that mails are sent *after* a commit
is done hense crashes because they do not exist anymore.

opw-1916913

closes odoo/odoo#30523
2019-01-30 14:29:23 +00:00
Géry Debongnie ad9f6aee93 [FIX] web: reload view when pressing enter in search bar
Before the control panel refactoring, whenever a user pressed ENTER in
the search bar (with no text), the current view was reloaded.  This
untested behaviour was changed (not on purpose) with that refactoring:
instead of reloading, the search view add a useless filter in the list
of facets.

We restore the previous behaviour in this commit.

closes odoo/odoo#30503
2019-01-30 10:45:11 +00:00
Alexandre Kühn 1a774f9e0e [FIX] mail: click on item from composer's emoji menu
Before this commit, clicking on an item from the
emoji menu of a composer was not putting the emoji
in the input.

Steps to reproduce:
- Open discuss app
- Select a conversation with a composer
- click on emoji menu in the right-side of the composer
- click on an emoji in the emoji menu
> the emoji has not been put in the input of the composer

This problem was caused by a race condition with the event
`focusout` on the emoji button and the `click` on an emoji
item. `focusout` always happens before `click`, and `click`
event following a `focusout` event can only happen when the
element is visible. This was not the case, because the emoji
container is removed from the `focusout`, so no `click` is
triggered on the emoji item.

This commit fixes the issue by listening on `mousedown` on
the emoji item instead of `click`, which is triggered before
`focusout`.

closes odoo/odoo#30694
2019-01-30 12:23:28 +00:00
Christophe Monniez e3f54a7808 [FIX] stock: use proper font in PDF report
When printing a delivery order in waiting state under MS Windows, the
produced PDF does not use the proper font for the warning line.
This leads to an unreadable line full of small rectangles.

The problem comes from the fact that the 'fa' class is applied to a full
paragraph.

With this commit, the proper 'i' tag is used to display the exclamation
triangle.

opw-1931892

closes odoo/odoo#30680
2019-01-30 09:26:44 +00:00
wan 3eead65f07 [FIX] account: add date field in reconciliation writeoff form
purpose:
    when creating a writeoff from the manual reconciliation widget (invoices & payment matching), there's no way to specify the date of the writeoff journal entry

specs:
    in v12, add a date field in the js and set the date of the writeoff entry accordingly

Was PR #29794
Was OPW 1896593

closes odoo/odoo#30676
2019-01-30 09:28:40 +00:00
qdp-odoo 0237654113 [REF] base, account: removed useless @api.depends on name_get() 2019-01-30 09:16:26 +00:00
wan 7e9009f93a [IMP] base: choice of state/country easier in banks and partners
OPW 1891131
closes #27497

When creating a new bank account/partner address, the view displays the 'state 'field before the 'country_id'  field, which naturally leads users to select the state before selecting the country.
But there was problem: in order to select a state, one had to first select a country, which was confusing.

Done:
  - allow the user to select the state before the country (without restriction on country)
  - remove the state from the form when the country changes, if the state (name) is not in the country
  - automatically set the country when the state is set
  - always display the country code in the name_get of res.country.state, to deal with the case where different countries have a state with the same name
2019-01-30 08:55:32 +00:00
wan b18ebde9c2 [FIX] account: Clean receivable/payable bank reconciliation
Task 1933763
Be able to reconcile this scenario :

- You invoiced 00 to a contact—> receivable 00
- You received a 0 bill from the same contact—> payable 0
- Contact pay you 0 (bank statement)
- You want to reconcile all the things easily from bank reconciliation

the story looks like (bank move is the one to be managed) :
```
journ    n° compte              contact        DEBIT    CREDIT    Mach
sales    12 400000 Clients      Azure Interior 100.00€    0.00 €  A1
sales    12 701000 Ventes       Azure Interior   0.00 € 100.00 €
purchase 11 440000 Fournisseurs Azure Interior   0.00 €  50.00 €  A2
purchase 11 600000 Achats       Azure Interior  50.00 €   0.00 €
bank      3 550001 Bank         Azure Interior  50.00 €   0.00 €
bank      3 400000 Clients      Azure Interior   0.00 € 100.00 €  A1
bank      3 440000 Fournisseurs Azure Interior  50.00 €   0.00 €  A2
```

closes odoo/odoo#30664
2019-01-30 08:16:00 +00:00
Romain Estievenart 3956afb8e4 [IMP] web: expose FieldX2Many relational fields
Expose to public the variable FieldX2Many.

Task ID: 1910385

closes odoo/odoo#30512
2019-02-06 10:05:11 +00:00
Robot Odoo 6001fb227f [IMP] core: more details in debug mode access error messages
Access rights issues are currently hard to diagnose (especially from
ir.rule) due to how little details they provide.

This makes a pass over various sources of access errors and:
* improve/clarify the base message
* provide an alternative message with more details in debug mode

- [x] ir.model.access
- [x] ir.rule
- [x] related fields
- [x] fields with groups
- [x] close #28451 (provide both _name and _description in access error messages)

Task [1886746](https://www.odoo.com/web?debug#id=1886746&model=project.task&view_type=form&menu_id=4720)

closes odoo/odoo#30144
2019-02-06 13:40:29 +01:00
Xavier Morel 51819dcf17 [IMP] access errors through related fields
When an access error bubbles through a related field (aka the user
doesn't have access to the delegate or the delegate's field), append
the "intermediate step" so that it's easier to understand e.g. that
the access error to a partner really comes from accessing a user or
somesuch.
2019-02-06 11:29:29 +00:00
Xavier Morel 0f167634be [IMP] access error messages on fields with groups 2019-02-06 11:29:29 +00:00
Xavier Morel 6461a0f58c [FIX] core, base: rules detail on access error
In debug mode, if an access fails due to access rules, try to provide
a clearer error message & include a list of the rules which fail for
the record-set.

Note: for read() operations it'll be a bit misleading as failed
records will get a list of all the rules failing for the recordset,
only some of which might apply to that specific record.
2019-02-06 11:29:29 +00:00
Xavier Morel 860c842313 [IMP] base: error message on ACL failure, test 2019-02-06 11:29:29 +00:00
XavierDo e2180e5a2e [FIX] fields: setting an integer field invalidates its inverse one2many
In particular, creating a `mail.message` automatically invalidates the
corresponding `record.message_ids`.

closes odoo/odoo#30737
2019-02-06 10:18:24 +00:00
Robot Odoo e1838a9e27 [MERGE] portal,website_slides: posting review on slide channel
Impacted modules: portal, rating, website_rating, website_slides

This merge modifies the some aspect of posting a message for public
document, in order to implement the rating (message+rating) on a slides
channel.

We now support the use case of posting without having the right to write
on a document, and force the author of the message (as it is required to
be logged to post a message). The security has been improved: to do so,
the document token is not leaked anymore. Only the signed token (by current
partner id) is used.
The rating mixin has been modified to handle displaying average and count
(per document), in an efficient way.

A new frontend message composer is born in website_rating (as it allow to
post a rating with a comment). To do so, a little refactoring of the
Portal Chatter has been done.

For more details, please have a look at the subcommits. They are well
explained and correctly split.

Task-1902304

closes odoo/odoo#30655
2019-02-06 12:19:09 +01:00
jem-odoo e84779749b [IMP] website_slide: allow to edit comment
When a portal user post a message to review a channel, we
want to allow him to edit its own comment and rating.
This commit modifies the special check access method in
portal to extract the security check and reuse it to
allow user to update its comment on slide.channel only.
We decided to reuse existing widget (new rating popup
composer) to do the message modification.

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo cd3b6026e9 [FIX] website_rating: display label when rating
This commit fix the display of a label when the user add
a review; when selecting desired stars, the label corresponding
to the star is displayed in a badge.
The bug probably comes from the update to bootstrap 4.
2019-02-06 09:55:13 +00:00
jem-odoo e97b40bae6 [IMP] website_slides: allow to rate slide channel
This commit allows user to rate a slide channel: using the new Popup
Rating Composer, users having access to the slide channel can submit
a rating with a comment. Then, lower in the page, they can see the
ratings of other users.

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo 17ac041bfa [REF] portal: posting message with signed token
Before this commit, it was possible to post a message on a document
the user has no access, thanks to a token. In addition to this token,
if a hash (signed token with a partner id), the author_id of the message
was forced.
This commit change a little bit that logic by distinguish 2 cases:
1/ Token only: anyone with the token can post a message on the document. If
  the user is not logged (public with token), the author_id will be the
  customer of the document (or the public user). This case is moslty used
  for business document, through the portal or with the "share link" for
  instance.
2/ Signed token: user has no write access to the document, but can post a
  message on it. The user have to be logged, as the token is signed with its
  identifier. The goal here is to avoid leaking the access token's document
  to all visitors. This case is mostly used for public content, such as blog
  posts, slides, ...

The token case was already existing. The second is now working with this
commit. To do so, it was required to
- move `_sign_token` from the portal mixin to mail.thread.
- transfering 'pid' and 'hash' parameters from the controller to template
to js widgets.

This commit also change the `_message_post_helper` signature by making
the 3 first parameters required, as to post a message you need at lease
res_model, res_id and the message body. The optional argurments and kwargs
are here to check the bypassing access rights mecanism.

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo 4cb228d823 [IMP] portal,website_rating: new popup composer to submit rating
Rating document available on a website will become more common, but
we want to do it with different UI widget. This commit introduces a
new "popup rating composer": the idea is the rating average is
displayed with stars, and when clicking on it, a popup with the
composer appears. The user can so submit its review.

To do so, we factorize the Portal Composer into a dedicated widget
(instead of natively inside Portal Chatter).

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo 8c840f7539 [IMP] rating: add rating average on mixin
This commit provides 1 more field on the rating mixin: the average of
the ratings of the document. Before that, the only way to get the
average was to call `rating_get_stats` record per record.
As we are on a mixin, this new field is not stored to avoid recomputation
each time a rating is added. To improve performance, we decided to
compute `rating_count` and `rating_avg` in one `read_group`.

This commit also set an extendable method to get the domain of the
rating to include in those statistics computation, called `_rating_domain`.
This way, each model inheriting the rating.mixin can define the subset of
pertinent ratings.

As consequence, this commit uniformized the way average is displayed:
instead of taking the closer value to the 0.5 value, it only round it
at 2 digits.

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo 1ed3cb37b0 [IMP] website_slides: provide search bar on channel
Visitor are now able to search a channel, based
on the name or description with a search bar on
the channel list page.

Task-1902304
2019-02-06 08:06:46 +00:00
Antoine Guenet c839df6e91 [FIX] website: only show "welcome" message on empty homepage
Every new page was being considered an empty homepage with "Welcome to
your Homepage! Let's start designing." shown. Now only an empty homepage
shows that message.

closes odoo/odoo#30839
2019-02-05 13:31:57 +00:00
Nikunj Ladava 6f60243726 [IMP] purchase: Set supplier currency on product supplier info
- if currency is set on vendor, and set that particular vendor to product, the currency will not being changed by vendor's currency.
-  after this commit currency in pricelist will be changed by the currency of the vendor

This commit is related to Task ID 1826166

closes odoo/odoo#24468
2019-02-06 06:03:18 +00:00
sed-odoo ec42737702 [FIX] l10n_be_hr_payroll_fleet: clean mismatched values
Between 11.0 and master there was a mismatch in the legal values used to
compute the co2 fee and the ATN of a company car.

Task : 1937082

closes odoo/odoo#30841
2019-02-05 15:36:54 +00:00
Robot Odoo 88e76a7ff1 [MERGE] website, *: improve CSS edition usability + add JS edition
* web, web_editor

See sub-commits for details.

Currently, when an user wants to edit the css of its website, he has
access to lots of files and, in debug mode, to even more files. While
the feature is nice for people who know what they are doing, a lambda
person can easily break its website by changing the wrong files. Also,
nothing warns the user that the files that are edited will never receive
updates anymore (unless if they are reset). The goal is to prevent
those behavior while still allowing the add custom css. Another goal
is to be able to *add* custom javascript.

Custom files created for the user:
SCSS: user_custom_rules.scss, user_custom_bootstrap_overridden.scss
JS: user_custom_javascript.js

task-1919350

closes odoo/odoo#29999
2019-02-06 02:13:10 +01:00
qsm-odoo fc61305f51 [IMP] website: improve documentation of user custom files
See https://github.com/odoo/odoo/pull/29999
2019-02-05 14:28:29 +00:00
Andrea Ulliana 515e7bc50f [IMP] website, *: improve CSS edition usability + add JS edition
* web_editor

Currently, when an user wants to edit the css of its website, he has
access to lots of files and, in debug mode, to even more files. While
the feature is nice for people who know what they are doing, a lambda
person can easily break its website by changing the wrong files. Also,
nothing warns the user that the files that are edited will never receive
updates anymore (unless if they are reset). The goal is to prevent
those behavior while still allowing the add custom css. Another goal
is to be able to *add* custom javascript.

Custom files created for the user:
SCSS: user_custom_rules.scss, user_custom_bootstrap_overridden.scss
JS: user_custom_javascript.js

See https://github.com/odoo/odoo/pull/29999
task-1919350
2019-02-05 14:28:29 +00:00
Andrea Ulliana 7f2ce89554 [IMP] web: add JS-related lib files for ace editor
In task handled in https://github.com/odoo/odoo/pull/29999, we will need
support for javascript files in ace editor. This commit adds the related
lib files.

See https://ace.c9.io/#extending-highlighters:
https://github.com/ajaxorg/ace/tree/master/lib/ace/mode
1. https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/doc_comment_highlight_rules.js
2. https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/javascript_highlight_rules.js
3. https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/javascript.js

task-1919350
2019-02-05 14:12:16 +00:00
Thibault Delavallée 8f3eff13fb [REF] website_slides: light cleaning
Purpose of this commit is to prepare future code addition by making some
noise in a separate commit. In this commit we move compute methods below
fields definition because currently it is a complete mess and finding a
given field gives a headache.

Commit linked to task ID 1933820 and PR #30830.
2019-02-05 11:19:52 +00:00
Thibault Delavallée 7105669b77 [FIX] website_slides: limit auto subscription
In order to avoid spam and unwanted notification this commit limits auto
subscription on channel when

 * creating a channel;
 * automatically telling a channel a new publication has been done;
 * creating a slide;

As being a follower of a slide channel means following its slides user should
choose manually to be follower of a channel, notably through the UI.

A new way of managing subscription will come with elearning in mind and
therefore auto subscription should be limited.

Commit linked to task ID 1933820 and PR #30830.
2019-02-05 11:19:52 +00:00
Antoine Guenet 275af90b38 [FIX] web_editor: update displayed media in dialog on remove media
closes odoo/odoo#30809
2019-02-04 12:52:15 +00:00
Antoine Guenet f834204af3 [FIX] web_editor: reapply the classes of ANY type of media on replace
closes odoo/odoo#30801
2019-02-04 11:29:40 +00:00
Antoine Guenet 48cb3c71d1 [IMP] web_editor: handle CTRL+A (and then DELETE) locally
This fixes issues with CTRL+A then delete.
Now CTRL+A selects all the contents of the unbreakable node in
which the range is contained. Deleting it all will replace the contents
with `<p><br></p>` so the user can start editing afresh.

Note: Only CTRL+A is handled: ``select all`` in contextual and edit
menus are still handled by the browser.

closes odoo/odoo#30648
2019-02-04 09:44:18 +00:00