Commit Graph
119170 Commits
Author SHA1 Message Date
Olivier Colson 87f0d2eefb [REF] account, account_check_printing, payment, l10n_do, l10n_de, l10n_fr, l10n_nl, l10n_mx: chart templates installation: remove old useless wizards and move everything to account.chart.template
Was task 1858974
Was PR https://github.com/odoo/odoo/pull/25243
2018-08-07 17:11:08 +02:00
Thibault Delavallée 8edae4200f [FIX] hr_holidays: yet another date/datetime fix
Still fixing some side effects of https://github.com/odoo-dev/odoo/commit/960360afe478a8f7b9c456721b5591154952a37d.
2018-08-07 16:45:16 +02:00
Thibault Delavallée 41eb02c218 [MERGE][REF] mail: optimize message notification process
This merge optimizes and lessens query count of notification process. When
posting a message some computation is done to fetch followers and/or people
and channels to notify, then notify them on their Inbox or by email. This
process now takes less queries thanks to several improvements :

 * fetching followers / recipients data is now done manually in SQL allowing
   to fetch data across several models in less queries;
 * computing recipients is now separated from notifying them. Notification
   better uses precomputed data in order to avoid fetching and browsing
   several time the same data;

When possible code has been made more readable through code inlining. Several
methods have been removed because they are not used in inheritance. Some code
is now more low-level. Optimizing part of the process can make it harder to
inherit or modify.

Performance counters are updated showing gain in nearly all tested cases.
An enterprise branch is linked to this one that also improve notification
process.

This merge is linked to task ID 47934 and closes PR #24033. No functional
change should occur with this merge.
2018-08-07 15:44:15 +02:00
Thibault Delavallée 689a496f1c [REF] mail: propagate recipient data through notification process
Purpose of this commit is to avoid browsing and prefetching data about
recipients when notifying a message to partners and channels. Mail message
_notify computes all necessary data in a single query. This commit allow
to re-use this data by propagating it through the call chain.

Addons inheriting from classification methods used when sending notification
emails are updated accordingly to the API and data update.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:43:06 +02:00
Thibault Delavallée 89051058f4 [REF] mail: clean code related to notification email generation
This commit cleans code about sending email notification to recipients.
Purpose of this code is to prepare notification emails, group recipients
and finally send emails. In this commit we clean and optimize a bit by

 * propagating some additional parameter to simplify code, like record
   on which the notification process runs;
 * inlining some code currently located in sub-methods. It eases code
   understanding as there are less code jumps. As those methods are not
   inherited inlining them can be done;
 * simplifying a bit notification emails preparation and computation;

It allows to save a few query by avoiding to fetch and browse again some
data that were already computed.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:43:06 +02:00
Thibault Delavallée df8130b2fa [REF] test_mail: update counters due to enterprise mail_push update
This commit is related to enterprise commit that updated mail_push. It is about
[REF] mail_push: optimize mail.message notification process override

It updates code of mail_push to lessen its impact on mail-related code. It
allows to change a few counters in test_mail. Indeed counters are impacted
by code located in enterprise because those are "maximum queries" counters.
As mail_push is an auto-install module enterprise runbot would be broken
if the counters weren't updated.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:42:50 +02:00
Thibault Delavallée 6de76cc4f1 [REF] mail: optimize notification recipients data fetch through SQL query
In this commit we update _notify method of mail.message to fetch most data
related to notification process in a single query.  Indeed posting a
message can be a costly process, especially when involving several partners,
channels, depending on their notification status, user groups, ... Most
of the required data can be fetched in a single hand-tuned query.

Purpose is to lessen query count. Side effect of this commit is that code
is less recordset based and therefore more low-level. It is also harder to
customize the behavior through inheritance as it implies rewriting a bit
more of code.

This query is located in a private method on follower model. It takes
parameters allowing to either fetch data related to followers of a given
subtype, either related to some partners and channels. First use case is
related to the process of posting a message with a subtype that triggers
notification of followers. Second use case is related to notifying some
specific partners or channels of a given message. It takes notably into
consideration internal subtypes and active field of partners, allowing to
correctly handle corner case for deactivated followers and portal / share
partners.

Notification process is divided into two steps. First one is to compute
recipient data. Second one is to apply the result of this computation and
call the various notification mechanisms accordingly. Doing so allows to
easily re-call notification process or compute some data differently
if necessary.

API of notification methods is updated to allow passing notably the values
used to create the newly-posted message. It allows in some simple case to
avoid browsing message and partners when no notification is necessary. It
saves some queries in simple case like posting messages with specific
subtypes not often followed or logging notes without mentioning people.

This commit allows to save a few queries on several performance tests as
indicated by updated performance counters. Future commits will gradually
propagate the use of this data to further lessen query count.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:42:45 +02:00
Thibault Delavallée 40922cc027 [FIX] hr_holidays: fix date computation
Since date / datetime refactoring done at 960360afe4 we cannot
encode new leave requests or new allocation requests anymore. This commit
fixes that by correctly setting date / datetime on date / datetime field
and correctly computing one from the other.
2018-08-07 15:39:36 +02:00
qsm-odoo 240b338dd9 [FIX] mail: BS4, restore activity popover
Adapt SCSS which was BS3-specific and remove misuses of the
dropdown-item class.

Closes https://github.com/odoo/odoo/pull/24419
2018-08-07 14:50:06 +02:00
Olivier Colson 3de7521174 [IMP] account: new setting to define a start for bank reconciliation
Payments older than the chosen date won't be proposed in the widget allowing to match payments with bank statements. This is useful if the db used invoicing for years and then installed accounting : users don't want to have to match all the old payments that were generated by invoicing with bank statements.

Was task 1829536
Was PR https://github.com/odoo/odoo/pull/24728
2018-08-07 13:39:02 +02:00
David Beguin 8c1805cdc6 [FIX] Crash Manager - Clipboard JS reference updated
The instanciation of the clipboard in the crash manager was not updated
in the fix that upgraded the clipboard.js
2018-08-07 10:37:55 +02:00
Deep Patel 70df0bb586 [FIX] website, website_sale: BS4, adapt carousel controls
Completes https://github.com/odoo/odoo/commit/20d033a782f4d85fdd6f15df68d116b2fd7a7dfd

Closes https://github.com/odoo/odoo/pull/26077
2018-08-07 10:03:59 +02:00
Prakash Prajapati 5caa9a46a0 [FIX] stock: review some report layout
The 'table-responsive' class should not be used on <table/> elements
directly (this is allowed by BS4 but this is not good practice to me).

Closes https://github.com/odoo/odoo/pull/26148
2018-08-07 10:03:59 +02:00
Prakash Prajapati ba8a52972a [FIX] website_forum, website_forum_doc: BS4, fix some layout issues
Closes https://github.com/odoo/odoo/pull/26178
2018-08-07 10:03:59 +02:00
Siddarth Gajjar 0d8b1f5ba3 [FIX] web: BS4, fix tooltip flickering issues
Closes #26186
2018-08-07 10:03:59 +02:00
qsm-odoo 57400c1560 [FIX] mail: BS4, properly style followers list
Thanks to @hbh-odoo
2018-08-07 10:03:59 +02:00
Florent de Labarre b16a40721d [FIX] account: add countraints on account type
You cannot have more than one account with "Current Year Earnings" as type for a company.

opw:1868446
2018-08-07 09:43:04 +02:00
Ivan Yelizariev d458ec953b [REM] point_of_sale: remove fastclick.js
It was introduced in 2013, but it's not needed in 2018. According to library's
note: 

"As of late 2015 most mobile browsers - notably Chrome and Safari - no
longer have a 300ms touch delay, so fastclick offers no benefit on newer
browsers, and risks introducing bugs into your application. Consider carefully
whether you really need to use it."

PR #26200
2018-08-07 08:49:18 +02:00
Thibault Delavallée 027b3a35d7 [IMP] mail: improve use of templates linked to activities
Purpose: Give the ability to people to directly sign (sic) an email template
without opening the mail composer.

Specifications
 * do not display 'email' in activity view: either there are emails and new
   display applies, either there aren't any and do not dispaly anything;
 * update display of template choice: https://www.awesomescreenshot.com/image/3531694/7f6ac0250009599089ec62b6951a88b4;
 * add an "mt 16" between activity and first mail template;

Tests have been updated to new specifications.

This commit is linked to task ID 1872169 and PR #26185.
2018-08-06 16:24:43 +02:00
Thibault Delavallée 92dcbfe8d0 [IMP] mail: add method to send an email on activity mixin
Purpose of this commit is to have a shortcut allowing to send an email based
on an email template in the activity mixin. Its use will be to integrate
the sending of emails directly in chatter-activity widget.

This commit is linked to task ID 1872169 and PR #26185.
2018-08-06 16:24:43 +02:00
Deep Patel 967d228a44 [IMP] mass_mailing, mail: added support for media queries in mass mail
- Email generated from mass mailing will have its own layout with internal css.
- strip_classes is removed from mail_message because mail client are now supporting
  internal stylesheet. we need it for make mail responsive.

mail: manually removed classes from incoming mail body

Because we removed strip_classes from mail message body field because we want to
allow classes in outgoing mail to make it responsive but classes are not removed
from incoming mails so here we manually removed classes from incoming mail.

opw-1836556
2018-08-06 16:06:45 +02:00
Fabien Pinckaers 8b4b61dfcc [IMP] base: reducing report template preview by 180kb for 4 pictures + change size to reduce height 2018-08-06 15:49:26 +02:00
Fabien Pinckaers ecc69c93ba Merge branch 'master-enterprise2-fp' 2018-08-06 14:47:06 +02:00
Fabien Pinckaers ae97e5b93a [IMP] base: avoid tab on optional dropdown menu 2018-08-06 14:46:22 +02:00
Raphael Collet 960360afe4 [REF] *: use native date/datetime for Date/Datetime fields
From this commit onwards, Date fields will return datetime.date objects and Datetime fields will return datetime.datetime objects, this implies a number of things that are clearly explained both in the ORM API for master.

This commit also introduces a number of helper functions for dates and datetimes that are exposed in tools.date_utils and fields.Date[time], explained in the documentation as well.

Task-ID: 47189
2018-08-06 14:37:19 +02:00
Kirti Choudhary 09ba95b2d0 [FIX] mrp, mrp_byproduct: Pull/push rule on warehouse level for MO/Unbuild Order.
Finished product moves from a MO where created without warehouse_id.
It implies that push rule based on warehouse where not trigger on those
moves confirmation.

This commit adds warehouse_id on unbuild/production's finished/raw
moves. It also add a test for this behavior.

Task ID - 1865574
2018-08-06 14:04:27 +02:00
Yannick Tivisse caf86edbc4 [IMP] website_twitter: Add a tutorial for the credentials configuration 2018-08-06 13:49:55 +02:00
Yannick Tivisse e0bc147b96 [IMP] website: Add an id to ease the view inheritance 2018-08-06 13:49:55 +02:00
Rémi Rahir 77d34b9f8d [FIX] web: fixing checkbox style 2018-08-06 13:27:59 +02:00
Fabien Pinckaers 7f9e7f0c96 [IMP] *: only show 'learn more' when there is a web page describing the module 2018-08-06 11:57:41 +02:00
David Beguin 361dac682d [FIX] Share Link : Incorrect share url - Missing parameters.
When sharing a document inheriting portal.mixin,
the url was missing the parameters.
This fix adds them.
2018-08-06 11:44:55 +02:00
David Beguin 902e484f14 [FIX] ClipboardJS update for Bootstrap Modals focus issue in Chrome
Since Bootstrap 4, ClipboardJS does not copy the value in the clipboard anymore
as Bootstraps modals give the focus to another element. As the focus need to be
given back to the correct element, ClipboardJS has to be updated as the
container parameter is only added in v1.7. We were in 1.5.
That container parameter allow to give the focus back to the correct element.
See doc on https://clipboardjs.com/
+ Issue : https://github.com/zenorocha/clipboard.js/issues/155
2018-08-06 11:34:51 +02:00
Vincent Schippefilt f7cce79cfe [IMP] web: list view grouped layout is nicer
Task ID: 1860033

When the list view is grouped,
Before this commit the group title took as much space in the group
content as the first column of the table, and the space under this title
was not usable by the content (it was blank)

After this commit, the group title takes as much space as the sum of the
selector, sequence and first content column, but the space in the group
content under the title is used, so there is less wasted white space.
2018-08-06 09:16:35 +02:00
Fabien Pinckaers 7c8ab8a574 [IMP] base: improve kanban of modules, cards not clickable (top-right menu)
[NEW] base: show enterprise module, with an 'upgrade' button
[IMP] *: some modules renaming, and improved copywriting of manifest
[IMP] *: utm on links to odoo.com
2018-08-06 00:29:51 +02:00
Fabien Pinckaers 0a6353216b [FIX] mail: button are now translatable
[IMP] mail; various CSS issues
2018-08-03 16:30:01 +02:00
Thibault Delavallée 791d90203d [MERGE] various: update applications manifests
Purpose of this merge

 * improve the installation of modules;
 * module descriptions are not up to date in the software (still outdated
   screenshots for example). Some features are no longer there;
 * there is a lot of duplicated content to translate since apps are already
   described on our website;
 * apps in system homepage are not always called the same way than the
   module installed ;
 * showcase the website features in a neat apps store (remove tech
   dependencies, clean names and descriptions);

Specifications

 * improve kanban view of modules;
 * add a discover button that jumps on the website of the application;
 * do not fill text description in description html for apps as it is not
   user friendly;
 * remove deprecated index.html used as description_html;
 * update names and summaries of applications;
 * update names and summaries of website applications;
 * update some categories;
 * update website links;

See subcommits for more details.

This merge is related to task ID 47179 and 1861544. It closes PR #22689
and #25556. First one is about classic applications while second one is about
website applications.
2018-08-03 15:42:44 +02:00
David Beguin 9434f7b64e [REF] Portal Controller : Remove domain from account and purchase
The list of visible records are anyway based on access_rights.
State has been removed from the domain.
If the portal must be customized for a model,
access rights / rules can be added to do so.

Task ID : 30985
2018-08-03 15:20:42 +02:00
Mitali Patel 84f528bcff [IMP] Portal - Share link : Easily share the url of a document
Purpose
=======
- Quickly share the url to someone else (a client, a colleague,...)
- Ensure that the recipient can access at least
  the portal view of the shared record.
- Typically used when a client cannot retrieve the mail to access his order.
  The share link can be used in this case.

Specifications
==============
For any object inheriting form portal.mixin:
    - Add a button SHARE (not visible in edit mode)
    - When clicking on this button, a popup opens with :
        - A warning message for tasks and projects only (see below)
        - the link (like in gmail) that can be copied
        - Recipients
        - mail composer (with preselected template) ==> see below
        - button [Send Link] [Copy Link] Discard
        - After sharing document, put internal note like
          "Document shared to xyz,...." with template message
    - Anyone with the link, even anonymous user (not logged in) can have access
      to the document with the access token provided in the url.

Impacted models:
    - account.invoice (Community)
    - project.project (Community)
    - project.task (Community)
    - purchase.order (Community)
    - sale.order (Community)
    - helpdesk.ticket (Enterprise)

Warning messages and access rules:
    Allowed :
        - SO canceled or draft will be accessible with the link
          with access_token
        - If the customer account is B2B (signup not enabled), the recipient
          will anyway see the document as the user specifically wants the
          recipient to see the document.
    Restrictions :
        - For Project and Task, if the privacy is not public, then, there is a
          contradiction between the access_token mechanism
          and the privacy of the document.
        - A warning message will be displayed in the share wizard to inform the
          user if the document cannot be visible by the recipients and to
          ask him to set the privacy to 'Visible by following customer'.
          The send button will, in that case, be hidden.
        - To avoid to block the share for a new project, default privacy value
          is now set to 'Visible by followong customer'

Technical implementation
========================
- Move the access_token mechanism (field + methods + mail controller)
  to the portal.mixin to be able to use it in a generic way for each object
  inheriting the portal.mixin
- Generalise a part of the _*model*_get_page_view_values method
  into a single one in portal
- Generalize the _*model*_check_access into the portal controller of the
  portal module
- Remove the init_column + default value for the access_token
  > old records have an access_token,
  > new one won't but it will be generated on demand via the get_access_token
  Done for performance reasons
- Add share button into action menu separately. + kanban view context menu
  (except for task and project where button not in action menu but 'simple'
  button for task and project because other modules already provide action
  to send documents by email, which is not the case for project and task.)
- Add a sign_token used to authentify the recipient in the portal view chatter,
  if any. The message will be posted as if the user was logged in.
- Set the _get_share_url as private for security reason
- Add a redirect parameter to _get_share_url to get
    If false : The direct portal view url
    If True : The redirect url (mail/view/?)
- Cleaning up unnecessary code

- Bug fix :
    - Before, if user was not logged and record had partner_id,
      if partner id was null, post message was done as admin.
      Now, the post message is done as public user.
    - If the user had an uid but had no access_token, he could be able
      to gain the access token of the record.
      check_access_rights was missing in the get_access_action.

Task ID : 30985
Closes #25629
2018-08-03 15:20:42 +02:00
Laurent Smet 766a1025b1 [IMP] l10n_be_invoice_bba: make structured comm working per company, not partner (#26154)
The structured communication is no longer configured for each partner independently. It can be configured like others communication type through the settings.

task: 32254
PR: 26154
co-author: Haresh Shyara (hsh)
2018-08-03 15:07:45 +02:00
Priyanka Kakadiya 66d87a6e55 [IMP] note, purchase: rename main menu name
This commit renames main menu name same as module name in order to be less
confusing to users. This implies a small fix in test main flow because it
is based on the menu name.

This commit is related to task ID 47179 and PR #22689.
2018-08-03 14:55:08 +02:00
Priyanka KakadiyaandNimesh Jethva f5a96effb4 [REF] various: update manifests for better wording and names
Time has come to update a bit applications name, summary and website links.
Purpose is to have a website page correctly set for applications to be used
in conjunction with the newly-introduced discover button.

Names and summaries are updated to be more updated and shiny.

This commit is related to task ID 47179 and 1861544. Related PR are #22689
and #25556. First one is about classic applications while second one is about
website applications.

Co-Authored-By: Nimesh Jethva <nje@odoo.com>
2018-08-03 14:55:04 +02:00
Priyanka KakadiyaandNimesh Jethva c7eae6552e [REM] various: remove index.html for apps.
Several applications have an index.html file that is used to fill the html
description of the module. However those descriptions are generally not
up to date: they contain outdated screenshots, feature descriptions are
not maintained, ...

Instead we just rely on the discover button that redirects on the application
website. It has more chance being up to date. Moreover updating a website
is easier than updating the index.html of a module.

This commit is related to task ID 47179 and 1861544. Related PR are #22689
and #25556. First one is about classic applications while second one is about
website applications.

Co-Authored-By: Nimesh Jethva <nje@odoo.com>
2018-08-03 14:54:42 +02:00
Priyanka Kakadiya f8ce302529 [IMP] base: do not fill description_html with description for applications
For applications we don't want to have an html description based on the
text field description. This description is just a small summary and does
not add much value to the Apps view. If no description_html is given let
us just use the newly-introduced discover feature instead of filling
ugly content in html description.

This commit is related to task 47179 and PR #22689.
2018-08-03 14:54:09 +02:00
Priyanka Kakadiya 4ed7690d43 [IMP] base: add dropdown on modules kanban view and add a discover button
Purpose of this commit is to ease application finding and use by improving
kanban view of modules. A dropdown with action is added. It includes a
discover functionality letting users go to the App page see their description.
This page is based on the website of the application.

When a module has a website page it is used as link for the discover feature.
It allow to directly link to a webpage to discover the features of the
application instead of relying on the description and/or index.html that
are not up to date in most applications.

Future commits will gradually remove description from modules that have
a website page in order to use the discover button and avoid having outdated
content.

This commit is related to task 47179 and PR #22689.
2018-08-03 14:53:52 +02:00
Thibault Delavallée aeb381c06e Revert "[FIX] mail, sale: button texts are translatable"
This reverts commit c4af8f95d0.

Break master, not tested, blocks other pending merges.
2018-08-03 13:59:14 +02:00
Fabien Pinckaers c4af8f95d0 [FIX] mail, sale: button texts are translatable
[IMP] mail: improve email templates and simplify DOM
2018-08-03 13:39:15 +02:00
Pratima Gupta 31497ee79e [FIX] base, mail : fix typo in bel(l)ow
Below takes only one 'l', not two. Fix typo in

 * tooltip of create button;
 * mail demo data;
 * comment in stock

This commit is related to task/bug ID 1870964 and closes PR #26099.
2018-08-03 12:35:02 +02:00
RomainLibert f0589d3351 [MERGE] sale,pos_sale,website_sale: prepare for sale_enterprise
We want to add a dashboard view for sale in enterprise, for this we need
to make changes in the way views are defined on the actions (use
act_window.views) in sale.

We also need to modify the demo data in order to have beutiful display
in demo mode.

Task: #59409
Closes #25940
2018-08-03 11:18:20 +02:00
RomainLibert 7cf785ee3c [IMP] website_sale: change demo data sale_order create_date
In order to beautifully display data in the cohort view in enterprise,
we need to be able to define the create_date of sale_order
2018-08-03 11:18:19 +02:00
RomainLibert c77824c471 [IMP] sale,pos_sale: use act_window.views in
In order to be able to add some enterprise views to sale, we need to
define some act_window.views.

We also make some slight changes in the sale_report for use in
sale_enterprise
2018-08-03 11:02:46 +02:00