Commit Graph
118631 Commits
Author SHA1 Message Date
Alexandre Kühn cb7add2ebd [MOV] mail: move thread models in specific folder for thread models
The `model` folder contains several files, so this groups files related
to threads directly.
2018-07-19 13:58:34 +02:00
Alexandre Kühn 12f4f9a51d [REMOVE] mail: remove unused 'mail model' class
The intent of this class was to have all mail model be RPC/service calls out of
the box. This is a bit overkill for just 2 lines per new mail models, which is
why this is not used at all.
2018-07-19 13:58:34 +02:00
Alexandre Kühn 067ae915b7 [REF] im_livechat,mail: renamed "livechat" to "website livechat"
Renamed "livechat" model into "website livechat", in order to avoid confusion
with backend livechat.

- `im_livechat.model.LivechatMessage` becomes `im_livechat.model.WebsiteLivechatMessage`
- `im_livechat.LivechatWindow` becomes `im_livechat.WebsiteLivechatWindow`
2018-07-19 13:58:34 +02:00
Alexandre Kühn a6f6bbb46f [IMP] mail: update documentation of params in thread.xml templates
Some parameters in the templates were not documented, which is now
the case with this commit.
2018-07-19 13:58:33 +02:00
Alexandre Kühn 4925d53562 [FIX] mail: improve names of option parameter, classname, and template name
- `displayEmptyChannel` thread rendering options becomes `displayEmptyThread`
- classname `o_chat_content` becomes `o_thread-window_content`, as it is used
  only for thread windows.
- template `mail.EmptyChannel` has been renamed to `mail.widget.Thread.Empty`
2018-07-19 13:58:33 +02:00
Rémi Rahir af2f12b136 [IMP] iap: generic method to recharge an account manually
Up until now, services developed (sms) relied on the get() and
InsufficientCreditError mecanism to create iap_accounts on the fly and
recharge it.

This particular workflow does not work well with automated processes which
is why we modify the function get_credit_url such that it will allow the
client to generate the 'recharge' link manually for better integration
of iap services.
2018-07-19 11:53:13 +02:00
Thibault Delavallée 8eec939a78 [MERGE][ADD] digest, various: add recurrent digest emails
This commit adds a new digest module allowing to send recurrent digests by
email. Those contain a summary of the activity and display various KPIs
allowing to see the activity at a glance. It is also a great tool to improve
user engagement.

First commit adds the digest module holding the base mechanics of digest
implementation as well as first KPIs / tips. Other commits add KPIs and
tips based on the specific extended application.

This merge is related to task ID 30655. Closes PR #18318.
2018-07-19 11:31:50 +02:00
Mitali Patel 9231d42c41 [REM] project: remove onboarding mail
Removed current onboarding mail which was send when module was installed.
It is considered as not necessary now that we have a digest module sending
KPIs and tips by email.

This commit is related to task ID 30655 and PR #18318.
2018-07-19 11:26:49 +02:00
Mitali Patel 5a0696050e [REM] website_mail: remove onboarding mail
Removed current onboarding mail which was send when module was installed.
It is considered as not necessary now that we have a digest module sending
KPIs and tips by email.

This commit is related to task ID 30655 and PR #18318.
2018-07-19 11:26:48 +02:00
Mitali Patel d00382d569 [REM] crm: remove onboarding mail
Removed current onboarding mail which was send when module was installed.
It is considered as not necessary now that we have a digest module sending
KPIs and tips by email.

This commit is related to task ID 30655 and PR #18318.
2018-07-19 11:26:48 +02:00
Mitali Patel 54d7e7fd52 [IMP] sale_expense: implement digest KPIs / tips
Purpose of this commit is send a tip in digest emails so that people
can configure expense modules later.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:48 +02:00
Mitali Patel 4f9e4283d4 [IMP] website_sale: implement digest KPIs / tips
Purpose of this commit is send ecommerce sales details KPIs in digest email.
Those are added in the default digest template.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:48 +02:00
Mitali Patel 1909a70cee [IMP] sale_management: implement digest KPIs / tips
Purpose of this commit is to send sales details KPIs in digest email. Those are
added in the default digest template.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:47 +02:00
Mitali Patel 870b05f693 [IMP] project: implement digest KPIs / tips
Purpose of commit is to implement KPIs about opened tasks for project
digest emails. Opened tasks are nor archived nor in a final stage. Those
are added in the default digest template.

A tip is added to remind to use the mail gateway.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:47 +02:00
Mitali Patel 220ac81fa6 [IMP] point_of_sale: implement digest KPIs / tips
Purpose of this commit is to send POS sales details in digest emails. Those
are added in the default digest template.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:46 +02:00
Mitali Patel d61534ac87 [IMP] hr_recruitment: implement digest KPIs / tips
Purpose of this commit is to send KPIs about hired colleagues in digest
emails. Those are added in the default digest template.

A tip to remind to use the mail gateway is also added.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:46 +02:00
Mitali Patel 707bd1bfb4 [IMP] crm: implement digest KPIs / tips
Purpose of this commit is send lead / opportunity creation as well as
won opportunities KPIs in digest emails. Those are added in the default
digest template.

A tip to remind to use the mailgateway is also integrated.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:46 +02:00
Mitali Patel 9751417102 [IMP] account_invoicing: implement digest KPIs / tips
Purpose of this commit is to add revenue details KPIs in digest emails as well
as in default digest send to all users.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:45 +02:00
Mitali PatelandSiddharth Gajjar 2d1abe64e4 [ADD] digest: add new module to send recurrent digests by email
This commit adds a new digest module allowing to send recurrent digests by
email. Those contain a summary of the activity and display various KPIs
allowing to see the activity at a glance. It is also a great tool to improve
user engagement.

Digest module contain the core implementation of digests emails as well as
first basic KPIs. Future commits will gradually add KPIs in various main
addons.

Digests consist in email templates that have to call some methods on digest
module (compute_kpis, compute_tips, compute_kpis_actions) and render it
accordingly. A default digest is given in data allowing to tune it or to
duplicate and modify it.

Frequency is configurable on the digest; digests can be weekly, monthly or
send every 3 months. New employee users are added to the default widget.
KPIs are computed for each subscribed users so that results match its
groups and related access rights. Default digest therefore work for all users
as displayed results depend on their right without having to define separate
digests just for that purpose.

Implementation is done with Studio in mind. KPIs are computed fields on the
digest model. It means using Studio custom computed fields can be defined
to add customization to the digests, using fields named x_kpi_... .

Digests also holds tips to remind and warn users of features to activate
or configure like mailgateway.

KPIs can be linked to actions so that the section contain a link allowing
to directly jump on a given menu, allowing to directly link reporting
menus for example.

This commit is related Task ID 30655 and PR #18318.

Co-authored-by: Siddharth Gajjar <sga@odoo.com>
2018-07-19 11:26:45 +02:00
qsm-odoo ca9aa5f286 [FIX] account: typo in reconciliation tests
A <button/> is always not a <hidden/>... and asserts were not testing
the correct behavior (checked with chm).
2018-07-19 10:32:12 +02:00
RomainLibert c6396c36e7 [DOC] dashboard: add clickable attribute on aggregates
Closes: #25710
2018-07-19 09:51:54 +02:00
Atul Patel db403e6dd7 [IMP] base_import: Import images via URL
Task 32132

Currently, importing image requires either uploading them
one-by-one (after the initial import), scripting that upload, or
converting all images to base64 and putting that in the import
file (leading to a huge unreadable file) before actually doing the
import.

This is problematic for non-technical users, especially when they're
deploying or synchronising e-commerce products.

This change matches URLs in image fields and goes to read the URL &
load that as image data. It performs the read inline which is reactive
but means the imports will be very slow (wallclock) as each URL will
have to be fetched and encoded.

Configuration: via config file only

* import_image_timeout (seconds, default 3), initial connection timeout (not
  overall file download)
* import_image_maxbytes (bytes, default 10MB): maximum image size to
  download, checked before download (Content-Length) and validated
  during (in case Content-Length is missing)
* import_image_regex (str), matches field content as "probably an
  image", by default checks that the field value starts with
  http|https and ends with an image-type extension (e.g. bmp, png, jpg)

Hard Limits:

* only works on fields actually called "icon", "image", "logo" or
  "picture"
* the image can't be more than 42MP (checked after all data is
  downloaded)

Hooks:

* _can_import_remote_urls (on res.users) checks whether the current
  user is allowed to import via URLs
* _import_image_by_url (on base_import.import) performs the actual
  download, could be overridden to store urls to import and
  batch/queue the actual imports
2018-07-18 16:56:47 +02:00
Thibault Delavallée bbbefd70cb [IMP] mail: correctly set message class in activities
Fixup of decoration integration: o_thread_message_note was not correctly set.
2018-07-18 14:47:38 +02:00
jem-odoo c30155c13c [IMP] mail: allow to decorate background of activity notes
In some case, we want to have a different style for activities that
require attention for users. Sometimes activities should attract the
user attention with actions to perform that are important.

This commit introduces a decoration option on the activity type. By default
no decoration is done. However decoration type can be set to warning or
error. This triggers the related bootstrap alert classes.

This commit is related to task ID #1860833. Closes #25479.
2018-07-18 14:40:56 +02:00
Prakash Prajapati b094fc6bf8 [FIX] l10n_be_invoice_bba: Installation fix the traceback
--change the group name acc_sale -> sale

TASK:1865319
2018-07-18 13:57:39 +02:00
Sébastien Theys da150e591d [FIX] account: fix the aged report test
The partner is present in the amls but as an empty array, so we need to test it this way.

Fixed with the help of @smetl (las)
2018-07-18 13:39:33 +02:00
Christophe Monniez ae87467d8c [FIX] packaging: make debian package depends on python3-chardet
Since b60de0db41 Odoo requires chardet to
be installed.

With this commit, the Debian package will depends on python3-chardet.
2018-07-18 09:30:14 +02:00
Yannick Tivisse 3031ab8f0f [IMP] mrp,purchase,pos: Improve demo data
SPECIFICATIONS
==============

PoS
---

https://drive.google.com/a/odoo.com/file/d/1BkVVQTR7V_kZpNsOO0CwqTQtxAH9boLB/view?usp=drivesdk
Add new products : Cola, Water, Orange Juice (+ images)
in internal category : All/Saleable/PoS
available in PoS

Traceability
------------

The [FURN_9666] Table (MTO) should be tracked by serial number
There should be one purchase order already received for 1 Table Top
There should be one purchase order already received for 4 Table legs
There should be one MO done for the table (consuming the products received in the PO you've created)
> The goal is to have a complete traceability report for one table
Delete SN/LN : https://drive.google.com/a/odoo.com/file/d/1cxdE-2laGYaZ2rnSFKjEbVg6k6MVyLdw/view?usp=drivesdk

Assign crm.lead to the admin user : when opening the pipe, there must be some leads and opportunities

Products
--------

https://drive.google.com/a/odoo.com/file/d/1qaO7MlufZbj7bw6z5S8DtmKPYiK0sQNK/view?usp=drivesdk
route buy should be ticked on pedal bin product

remove some ecommerce categories: https://drive.google.com/a/odoo.com/file/d/1sgIJE49BHVDcoF5CXngbJAvWb2fN_3Wk/view?usp=drivesdk
2018-07-17 17:37:42 +02:00
Jigar Patel b60de0db41 [IMP] import/export UIs
Task 40692

Various changes to import/export (mainly) UIs:

* default to excel & "full" (non-import-compatible) export
* auto-detect encoding of CSV using chardet
* remember column -> field mapping after having imported a file (useful
   for repeated imports where auto-matching failed)
* better handle localised booleans & column names
* automatically select source list view's fields when exporting
* better integrate import templates feature and add a number of templates
2018-07-17 15:19:05 +02:00
Sébastien Theys 57676dc7d1 [IMP] doc: remove duplicate line
The same content is already there 2 lines above.
2018-07-17 13:55:25 +02:00
Hetashree Chauhan 5836f1611a [IMP] website_sale_delivery: More discrete delivery section if single delivery carrier available
This commit will replace the delivery carrier list choice by a single and more
discrete line bellow the billing/shipping section when there is only one
carrier available.

opw-1832976
2018-07-17 13:49:21 +02:00
Ravi Gadhia 762adedece [IMP] various: improve section and add note on sale order and invoice
The goal is to be able to more easily create section and notes on sale order, invoice, and quote.

================================
Problems of the existing feature
================================

The problematic part in the existing feature was that the same section had to be defined again and again for every line, instead of being defined only once where it needed to be. There was also no easy way to move them. Those concerns are solved here.

Moreover, due to the complexity of the feature, it was hidden by default, requiring a setting and multiple overrides. The new feature is simple enough that it will always be present.

==================
New implementation
==================

Sections are lines solely used for display purpose, there is no business logic attached to them. They will show as a nice header at the top of the section, and a subtotal at the bottom of the section.

We also take the opportunity to add notes, which are just like sections except they are displayed differently and don't include a subtotal.

=========
Reasoning
=========

We decided to implement it this way, as opposed to creating a proper section model, because it creates less changes in the code.

Creating a intermediary section model between the sale order/invoice/quote and their lines would have required to rewrite the entirety of the code associated to them. It would also have required to create a new JS widget to handle on the same view a double-level One2many (or a One2many + group by).

The current solution is much easier because it just requires adding 2 buttons, 1 simple field on the corresponding models which even has a NULL default value, and making some business checks (don't apply business to section/note).

We tried our best to impact as less as possible the existing models. Notably we didn't want to add any extra field if this was avoidable. This also makes the migration easier.

No matter the implementation choice the views/reports had to be updated to display the sections and notes correctly, which has been done.

===========
Limitations
===========

The current solution has several limitations:

* since the sections don't have business logic, it's not possible to make any reporting based on them

* any business related to sections has to be computed on the fly by browsing in order all of the lines, notably the subtotal has to be computed on the fly at every display

- when sections are moved (drag&drop) on the back-end, the following lines that are part of the section are not moving with the section

===========
Technically
===========

The commit will:

* update the models to add the display_type field (along with related sql constraints to guarantee integrity)

* add new buttons at the bottom of the lists to allow creating section and note, along with the existing add a line/product button

* add some business checks to not apply business to section/note (product_id and account_id became non-required fields)

!!! The most likely cause of potential bugs introduced in this commit would be to have forgotten to add those checks on some places where they would be needed. This is tedious to check but fortunately easy to fix.

* update the views to display sections and notes correctly, also made various improvements/fixes to those views (notably to apply B2B/B2C setting more consistently)

!!! This is the second likely cause of potential bugs: if the updated views are inherited in a way that is not compatible with the changes. Or if we forgot to apply the changes to some other views. Again this is tedious to check but fortunately easy to fix.

Task #53996
PR #25209
2018-07-17 11:50:35 +02:00
Sébastien Theys 3ec6294739 [IMP] account,sale: move B2B/B2C setting into account
Since sale depends on account and not the other way around, it's better to have this setting inside account.

Functionally it will allow the user to benefit from this setting also if he uses only invoice without sale.

Technically it will allow us to remove all of the overrides that were previously necessary for this setting.

While we moved the setting, we also renamed the different variables so their name better convey their meaning.

PR #25209
2018-07-17 11:50:35 +02:00
Sébastien Theys 73d54999df [IMP] web: make X2Many Renderer more extensible
This allows a custom widget to cleanly override the Renderer of a X2Many.

PR #25209
2018-07-17 11:50:35 +02:00
Sébastien Theys f241441433 [IMP] web: add control + create tags to customize "add a line"
The default "add a line" button creates a new line with the default values from the model. Sometimes we want to create a new line with different default values (or more generally a customized context), which is possible with this commit. Moreover it is possible to create multiple buttons for multiple default values/contexts.

This works both for in-line creation ("editable=") and dialog creation.

The new tags are:

<control> defines custom controls for the current view.

Does not support any attribute, but can have children:

<create> adds a button to create a new element on the current list.

This makes sense when the parent tree view is inside a One2many field.

If any create is defined, it will overwrite the default "add a line" button.

For more information and example, have a look at the Views documentation.

Technically, the commit will:
- parse the new XML tags (+ add appropriate validation)
- display the buttons based on the XML
- on button click/keyboard: pull up the additional context information from the button event up to the default_get
- add unit tests
- add documentation

PR #25209
2018-07-17 11:50:35 +02:00
Sébastien Theys d1f1cc9c27 [FIX] web: prevent tab shortcut from crashing when no input field
Currently, using the shortcut "tab" inside a list will crash if the list has no input field (ex. if it has only a textarea field).

This commit prevents the bug.

Also moved the test for the orderedResIDs crash in the correct module.

PR #25209
2018-07-17 11:50:35 +02:00
Florent de Labarre 561d22feb7 [IMP] project: cleanup in test mail
Coutersy of @tde-banana-odoo

Closes #25792
2018-07-17 11:47:47 +02:00
Yannick Tivisse 9d27ee5441 [FIX] mail: avoid warning on view validation 2018-07-16 17:39:48 +02:00
Alexandre Kühn 3210f10827 [IMP] web: provide infos for close action
With this commit, when we perform a close action, we can provide infos to
the `on_close` handler, so that it can handle different cases that caused
the close action.
2018-07-16 14:08:40 +02:00
Yannick Tivisse 0b78516047 [FIX] website_sale_options: Declare the demo data in the correct module
Purpose
=======

A demo data is declared in an incorrect module.

website_sale_comparison declares the model and website_sale_options does not depend on that one (it works on the runbot by chance)

Specification
=============

Move the demo data to product and add its category in website_sale_options.
2018-07-16 13:18:54 +02:00
Christophe Simonis 182c2c6919 [MERGE] forward port branch saas-11.4 up to 8285630ad2 2018-07-16 12:34:20 +02:00
Xavier Morel e891313810 [IMP] base: disable demo data if they can't install
Task 1856935

Currently, if installing a module's demo data fails (because the
module was uninstalled and some were left over and can't be
reinstalled, or because they're broken, or…) the installation of the
module fails and further installations are skipped (?).

Since demo data are non-essential (though required to run tests),
rather than fail everything if they fail just roll them back and
notify the user.

This change generates a warning log *and* shows a notification popup
to the end user.
2018-07-16 11:44:33 +02:00
Xavier Morel 93c0d7e811 [IMP] de-commit-ify db/module install
Try to remove cr.commit (and rollback) from module and db install:

* put a savepoint around test data loading
* remove a bunch of commits sprinkled throughout
* remove rollback on data loading failure (assuming it bubbles up, the
  entire module's installation should be rolled back)
* add commit right before the tests are run, so they can run isolated
  and still see whatever was done when installing their module
* convert a few explicit closing to context managers
2018-07-16 11:44:32 +02:00
Xavier Morel 233874d5ef [IMP] web: use builtin crash manager hooks for special handling
* having a special case for session expiration seems unnecessary when
  the CM specifically supports hooking on the exception name
* and properly implement the special handling of HTTP 504 (Gateway
  Timeout) from #24854 using that same hook
2018-07-13 17:31:23 +02:00
Xavier Morel 35d452cffb [IMP] web: replace iframe-based get_file by XHR
The error handling in get_file has always been somewhat problematic
(sarcasm ho!). Pending PR #24854 attempts to add special handling for
gateway timeout aside from its base stuff, and that's really quite
terrible due to get_file's limitation of only being able to read the
content of the document loaded in the iframe (no proper access to status
codes & al).

That was the occasion to look up modern API and see if we could do
file downloads in JS without iframe crap.

Turns out we can: xhr2 is well supported so we can POST, get a blob
back, and create a "local download" for that in-memory blob using either
a[download] (most browsers) or msSaveBlob (IE10+, that's actually a
convenient-to-great API and it's a shame there's nothing like it in the
standard).

The changes are not trivial but save ~30LOC and most of the overhead
is replicating the old/weird error handling as that requires
additionally decoding the blob to a string & parsing that string to
a document before being able to get the content (whereas before we'd
just access to the document loaded in the iframe).

OTOH we can now properly forward non-200 status codes to the
crash manager (as name) which will allow using regular CM hooks to
provide custom warning and error messages.

Note that this requires two libraries:

* a stripped down version of the content-disposition NPM lib, as
  download file names are provided via that header and parsing the
  header is decidedly non-trivial
* the download.js library as it handles the various edge cases from
  different browsers, I'm don't think all of it is necessary for our
  use case but the library is not that big so no real point in trying
  to strip it out and potentially break it in the process
2018-07-13 17:31:22 +02:00
Xavier Morel ccbfa94d32 [FIX] the ; in content-disposition is a separator not a terminator
According to RFC 6266,

content-disposition = "Content-Disposition" ":"
                      disposition-type *( ";" disposition-parm )

disposition-parm can't be an empty string, and thus a ; in terminal
position is not legal, even though browsers apparently work around it.
2018-07-13 17:31:22 +02:00
Christophe Simonis 8285630ad2 [MERGE] forward port branch saas-11.3 up to 609491ad0e 2018-07-13 17:12:07 +02:00
Christophe Simonis af4df80283 [FIX] base: set default currency rate at date 2018-07-13 17:08:58 +02:00
RomainLibert 0bb5268cb3 [DOC] add measure attribute to aggregate
Closes #25713
2018-07-13 16:11:28 +02:00
Christophe Simonis 609491ad0e [FIX] sale: use new model & xmlid name in test 2018-07-13 15:11:16 +02:00