Commit Graph
126133 Commits
Author SHA1 Message Date
Pierre Masereel 4483121739 [IMP] delivery: remove carrier from SO, when remove line 2019-04-01 09:23:03 +00:00
Pierre Masereel 47ee1666bb [IMP] delivery: only add lines on SO when rate_and_ship 2019-04-01 09:23:03 +00:00
Pierre Masereel 1882cd18e9 [IMP] delviery: remove useless field 2019-04-01 09:23:03 +00:00
Julien Giannone 230177ffa9 [IMP] mail: add a different layout for inactive followers
When displaying the followers of a document, followers who are set as inactive will be displayed in a different layout than the active ones. The purpose is to mark a clear difference between active and inactive followers.

Task #1957849

closes odoo/odoo#32084

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-03-27 15:54:46 +00:00
Robot Odoo d2c75b7e86 [MERGE] *: Improve graph view, replace nvd3 with Chart.js
The present work is part of an ongoing plan aiming to refactor/improve the reporting views (in particular the graph view).

The most notable changes are
- better support of comparison mode (comparison of different time periods)
- better tooltips and legend (content/style)

It has also been decided to use Chart.js instead of nvd3 to draw charts.
The main reasons are that Chart.js is better maintained/designed and offers many interesting features.

Thus we have rewritten all the code depending on nvd3, adapt it to the new library, and remove completely the nvd3 library and the references to it.

Task Ids: 1911201, 1946138

closes odoo/odoo#31766

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-04-02 10:47:52 +02:00
Mathieu Duckerts-Antoine 596206cdf6 [IMP] web: remove nvd3 library
It has been decided to use Chart.js instead of nvd3 to render charts.
Now that nvd3 is no more in use, we remove it.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 0eba50dd1c [IMP] survey: use Chart.js instead of nvd3 in survey results
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Géry Debongnie 8b7891044d [IMP] *: use Chart.js in website_links/website_sale_link_tracker.
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 0d7ebb6d14 [IMP] sales_team: remove useless css rules
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts. This makes old CSS rules
related to nvd3 useless.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Géry Debongnie 769806ad13 [REF] reimplement journal dashboard widget with Chart.js
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Géry Debongnie 2af74a5f53 [REF] web_kanban_gauge: reimplement gauge widget with Chart.js
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 3ab3082a32 [IMP] website: use Chart.js in community dashboard
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 604c43640a [IMP] web: use Chart.js in graph view
It has been decided to use Chart.js instead of nvd3 to render charts.
In this commit the graph view has been largely rewritten to benefit
from the options offered by Chart.js.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine a8d3ca771f [IMP] web: add library Chart.js
This commit makes possible to use the Chart.js library to create
various charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine a9bcb12f64 [IMP] web: graph view improvements
This commit extends the support of comparison mode for the graph view
and refine the tooltips and rendering in line mode.
The graph view code has also been slightly refactored.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine d23419fd86 [FIX] web: call super in AbstractAction willStart
The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has
modified how libraries are loaded at several places and has
introduced a bug in sale_subscription_dashboard where the
libraries are no longer loaded at all. We fix that situation
by calling super in the willStart method of AbstractAction
that inherits from Widget. Abstract actions can now also
benefit from the mechanism present in Widget willStart.
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 4315e1b4aa [FIX] web: on_attach_callback of form renderer widgets
Before this commit, the 'on_attach_callback' method of a subwidget of
the form renderer would not be called when the renderer renders
itself but is already in the dom. This can cause problems when a
subwidget has to know if it is in the dom for its own rendering.
This commit fixes that situation.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine a804585700 [FIX] web: correct quarter format in mockReadGroup
Before this commit the value of a field (of date/datetime type)
used as a groupby was not correctly formatted in the test environment
when the granularity was 'quarter'. This commit fixes that situation.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine 863de16a91 [FIX] web: correctly update this.widgets
Old subwidgets of a widget inhereriting from BasicRender were not
correctly destroyed. This was the cause of various problems when
cycling over this.widgets.
2019-04-01 14:38:44 +00:00
jem-odoo a742279ad2 [REF] sale,sale_expense: clean and optimize reinvoice code
In the previous commit the analytic entries generation when posting a
move was optimized to be done in batch. The performance is break
when sale module is installed. Indeed, in case of reinvoicing a
analytic line, AAL creation will trigger a sale.line creation.

This mecanism is very inefficient because
1/ AAL creation and Sales line creation are not batched
2/ sale line creation is done after the AAL creation, and then linked
with a `write` operation. So one `create` and one `write` per AAL to
reinvoice.
3/ To determine on which Sales Order to reinvoice, many `search` can
be performed per AAL.

Also, this looks strange that AAL creation might result into a sales line
creation.

This commit changes this in order to optimize and clean the code:
- the account.move.line (that creates the AAL) will also create the
Sales lines
- SO lines creation will be done in batch
- minimize the number of `search` done during the process
- the SO line will be linked to the AAL by passing the SO line id in the
create values of AAL (no `write` operation one AAL and SOL are created).

This was the last part of legacy code of 'sale_analytic.py' that we need
to get rid of. There are still work to do, but I think now, the
business case handled here can now breathe and have a peacefull life.

Task-1911898

closes odoo/odoo#28939

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-04-01 07:05:02 +00:00
jem-odoo bc9e5ea361 [IMP] account: generate analytic entries in batch
When posting an account.move.line, the ones with an analytic account set
will create analytic entries. As this is purely and simply data
generation,
they might be create in batch, using the new "create multi", in order to
perform only one INSERT query for all the lines to generate.
This commit aims to optimize the analytic.line creation by doing it in
batch.

Task-1911898
2019-04-01 07:05:02 +00:00
Romain Derie 9f5cdd86f2 [FIX] sale_coupon: upgrade discount when possible
/!\ Cherry-pick of odoo/enterprise@8b85628c65 that was lost between
coupon move from OE to OC and forward-port

It is possible to setup multiple global promotions, i.e. 5% discount
after 5 products and 10% discount after 10 products. Buying 10 products
gives the 10% discount. But if you select 5 products (5% is applied)
then add 5 more products, the 10% discount is not automatically applied,
the custommer must remove the 5% discount in order to get the 10% one.

This commit automatically upgrades the promotion to use the best
applicable discount.

opw-1953224

closes odoo/odoo#32314

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-01 15:47:40 +00:00
Romain Derie b327f2f3c3 [FIX] website_sale_coupon: forward-port on module move
website_sale_coupon was moved from enterprise to community just before a
forward-port bring changes to that module and before that module was removed
from enterprise.
2019-04-01 15:25:42 +00:00
Robot Odoo 2f238f6cda [IMP] website: improve reset view feature
- Store previous arch to be able to reset it (soft reset)
- Add the possibility to reset from file if possible (hard reset)
- Adapt frontend reset page to these new fields
- `arch_fs` hack to check if view was modified got moved to new field
  `arch_updated` as we now need to keep track of the `arch_fs` to reset a
  broken view.

Closes #32009 (task-1943001)

This commit also:
- adds the possibility to reset a view arch in its form view, including a diff
  viewer (github like).
- adds string helper on those arch fields, as they are not documented, it is not
  always obvious to get the purpose of each fields.
- adapts the font-size and headings to fit Odoo style on the error 500 page.
  The error page does not use Odoo's assets, just bootstrap.css (the cursor
  might be broken on the error 500 page so we can't use Odoo assets).
- raise the caller on unexisting t-call during QWeb rendering.
- adapts reset view code to single view as the code still had remains of its
  initial release (Odoo 9.0). Handling multiple views has no sense anymore.

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-01 19:14:42 +02:00
Sébastien Theys d3d58b60dc [IMP] base,product,website_sale: move image fallback mixin -> variant
Only the variant is using this code, so it was a bad idea to make the mixin
more complicated than it had to be.

Update the image tests to make sure this is working correctly. The test were
only testing the size of the images, now they also test the actual content.

Part of task-1949729

closes odoo/odoo#32253

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-30 11:25:19 +00:00
Christophe Simonis 7ac5ec628c [MERGE] forward port branch saas-12.2 up to 18c735361a 2019-04-01 16:20:00 +02:00
Jeremy Kersten 8de362fac6 [MRG] sale_coupon_delivery: move to community 2019-04-01 15:08:01 +02:00
Jeremy Kersten 8b7a717920 [MRG] sale_coupon_delivery: prepare move to community repo 2019-04-01 15:05:33 +02:00
Jeremy Kersten 7a2c9dab0c [MRG] sale_coupon: move to community
+ add i18n from website_sale_coupon
2019-04-01 14:17:42 +02:00
Jeremy Kersten 1d6487fcdd [MRG] website_sale_coupon: move to community 2019-04-01 14:11:05 +02:00
Jeremy Kersten ac5469646c [MRG] sale_coupon: prepare move to community repo 2019-04-01 10:41:55 +02:00
Jeremy Kersten 837a82a21c [MRG] website_sale_coupon: prepare move to community repo 2019-04-01 09:50:09 +02:00
Romain Derie 479585140c [IMP] website: adapt reset view code to single view
Reset view feature code still had remains of initial release (Odoo 9.0).
At that point all the view tree was returned, not only the broken view.

Since it has been fixed in 12.0 and refactored in saas-12.3 with this PR, it
now only takes the broken view as argument, handling multiple views has no
sense anymore.

Thus, this commit remove the (unused) multiple view compatibility.

This commit also add a test to test the refactoring or this feature.

Coming from #32009 (task-1943001)
2019-03-29 18:57:06 +00:00
Romain Derie e57f7734ca [IMP] base, website: QWeb, raise the caller on unexisting t-call
Before this commit, when a t-call was calling an unexisting template, a QWeb
exception would be raised with the callee and not the caller as template.

That would be an issue since there was clean way to retrieve the view that did
the wrong t-call, for instance to be able to repair that view.

Now, in such a case the caller view will be returned.
That will avoid crapy code to retrieve the caller, eg searching on every Qweb
view archs.

Coming from #32009 (task-1943001)
2019-03-29 18:56:47 +00:00
Romain Derie da5ebdeccd [IMP] base, website: add ir.ui.view action to reset arch (wizard)
This commit adds the possibility to reset a view arch in its form view.
It also include a diff viewer (github like).

Closes #32009 (task-1943001)
2019-03-29 18:56:24 +00:00
Romain Derie 81df3c5f22 [IMP] website: improve reset view feature
- Store previous arch to be able to reset it (soft reset)
- Add the possibility to reset from file if possible (hard reset)
- Adapt frontend reset page to these new fields
- `arch_fs` hack to check if view was modified got moved to new field
  `arch_updated` as we now need to keep track of the `arch_fs` to reset a
  broken view.

Closes #32009 (task-1943001)
2019-03-29 18:53:56 +00:00
Romain Derie 11222f504d [IMP]: base: add help string on ir.ui.view arch fields
As there is a lot of arch fields, and those are not documented, it is not
always obvious to get the purpose of each fields.

This commit simply adds string helper on those.

It will be even more pertinent with the new reset view feature which adds two
new arch fields.

Coming from #32009 (task-1943001)
2019-03-29 18:53:48 +00:00
Romain Derie b496e0758d [IMP] website: nicer layout on error 500 page
The error page does not use Odoo's assets, just bootstrap.css (the cursor might
be broken on the error 500 page so we can't use Odoo assets).

This commit mainly adapts the font-size and headings to fit Odoo style.

Coming from #32009 (task-1943001)
2019-03-29 18:53:22 +00:00
qsm-odoo 04a715fb1f [REF] website_sale_coupon: adapt test to renamed class
See https://github.com/odoo/odoo/pull/30366
task-1866973

closes odoo/enterprise#3780

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-29 17:28:36 +00:00
Jeremy Kersten 7c68d2ac19 [FIX] website_crm_partner_assign: fix next activity on change + datepicker
next_activity broken by a previous refactoring of js.
date picker broken by bs4 and JS don't handle local format.

closes odoo/odoo#32263

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-29 14:23:11 +00:00
Jeremy Kersten 83e0fd7f05 [FIX] sale_quotation_builder: remove useless dismissable
task-1937700
2019-03-29 14:23:11 +00:00
Robot Odoo 1fbafa4e69 [MERGE][IMP] im_livechat: random assignation of conversation
Purpose
The assignation method should always give the new conversation to the operator who
has the less active conversation.
If two operators have the same amount of active conversation, it should chose one of
them randomly.
We also want the visitor to get the same operator (if available) from its last visit.

Specifications
The method 'get_mail_channel' on the 'im_livechat.channel' model used a simple random.choice in
the available users to select the operator.
It was improved to select the operator that has the lowest number of open livechat sessions. If multiple
operators share the same number (lowest) of open livechat sessions, it selects randomly between those.

For the visitor to get the same operator as during its last visit, we save that information in a cookie (1 week lifetime), and give this optional parameter to the server when asking for the livechat session.

To make the code clearer, some methods were reorganize and convert from `api.model` to `api.multi` (ensure_one) to be more API-compliant.

Task-1919871

closes odoo/odoo#29888

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-04-01 09:43:42 +02:00
jem-odoo 33f4980b02 [FIX] im_livechat: missing js files in assets
Like every changes in web client, and in the assets composition, "some
people" forget to update the specific assets of livechat.
Specific livechat assets allow to load a small part of odoo js
framework in order to be embedded on external website.

Task-1919871
2019-04-01 07:03:11 +00:00
Aurélien Warnon 594c6e8a2a [IMP] im_livechat: ensure that visitors always gets the same operator
Task #1919871

Purpose
=======

If a visitor comes on the website and launches a livechat, it will be randomly assigned operator A.
If he comes the next day and opens a livechat again, we want him to have the same operator if he's available.

To handle that use case, we added a cookie that stores the "previous operator id" information for 7 days.
2019-04-01 07:03:11 +00:00
Aurélien Warnon 9b867cd12d [IMP] im_livechat: improve random assignation of conversations
Task #1919871

Purpose
=======
The method 'get_mail_channel' in the 'im_livechat.channel' model used a simple random.choice in
the available users to select the operator.

It was improved to select the operator that has the lowest number of active livechats. If multiple
operators share the same number (lowest) of active livechats, it selects randomly between those.

A livechat is considered 'active' if it has at least one message within the last hour.

Spec
=======
The assignation method should always give the new conversation to the operator who
has the less active conversation.

If two operators have the same amout of active conversation, it should chose one of
them randomly.
2019-04-01 07:03:11 +00:00
Aurélien Warnon c04b9c019e [REF] im_livechat: rework some 'im_livechat.channel' model methods
Purpose
=======

Several methods of the 'im_livechat.channel' model were passed a 'channel_id' to work on.
This has been changed so that the caller can use those methods on an instance of this model instead.

Some methods have also been switched to private because they had no apparent reasons to be public.

This is a preliminary cleaning for task #1919871

Specicial note for the "loader" template:
To load the livechat assets in a website page, the 'loader' template of livechat
is directly called (instead of being returned through a controller) in order
to avoid a new call to server.
As this commit moves 'sudo' to make method callable on the record directly, it
still needs to be sudo. First solution was to add the 'sudo' in the template, which
is a bad practise.
This commit creates a proxy method on website model returning the livechat info
with 'sudo'. This avoid having the 'sudo' done in template. Like always, explicit
is better than implicit.

Task-1919871
2019-04-01 07:03:11 +00:00
XavierDo 92e9e84b63 [IMP] mail, *: don't track fields at create
*: project, crm, maintenance, helpdesk,

It is useless to track fields during create since they
have no initial value and future tracking message will
show changes on tracked field.

We can log a default creation message instead
(as it is now if there is no mail_create_nolog context key)

This change will implies
- less queries when creating record
- cleaner creation messages
- less occurence of mail_create_nolog ctx key

Removing tracking at create could break the creation subtypes
mechanism (example: following task creation subtype on project)
Instead of using _track_subtype to give a subtype at create,
a new _creation_subtype method can be override. If a creation
subtype is set on a specific modlel, creation messages will be
create by message_post instead of _message_log.

We also need to adapt the message_track_post_template in order to
keep this feature whithout tracking.

Task: #1916916

closes odoo/odoo#31945

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-29 15:28:43 +00:00
Romain Derie 98b20333d6 [IMP] website_sale: avoid misconfiguration in multi-website/multi-company
Before this commit, a pricelist could be easily misconfigured when
multi-company and multi-website were both activated.
Eg: website 2 is for company 1, create a pricelist and set website 2 and
    company 2, it would make no sense and code would not behave as expected.

Now, we prevent this type of misconfiguration by ensuring a pricelist can't
have a website which is from another company than the company set to the
pricelist.
We also filter website in m2o widget to only show company's websites.

Closes #25109

---------------

With this new constraint, l10n module would need to force company:

l10n modules install will change the company currency, creating a pricelist for
that currency. Do not use user's company in that case as module install are
done with OdooBot (company 1).

Step to reproduce:
  - Active multi-company and create a new company
  - Switch to that company and try to install any l10n module not in EUR or USD
  - It will create a new pricelist for that company for that new currency
  - It will crash as module install are done as OdooBot which is in company 1.
    It will search websites in OdooBot company (self.env.user).
    It will then create the pricelist with company 1's website which is
    uncompatible with the new company, thus raising the constraint.

closes odoo/odoo#31929

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-26 22:11:50 +00:00
Robot Odoo 3ccccd10af [MERGE] website_blog, *: review blog layouts
* website

Review the blog layouts to
- Use cards where necessary to match the forum / event redesign
- Use correct bootstrap / HTML

+ Some minor improvements

task-1948882

closes odoo/odoo#31749

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-29 19:52:29 +01:00
qsm-odoo 24aec084e2 [REF] website_blog: review blog redesign
- No cards for menus
- Use the grid system for better blog post card footers
- Correct grid system for blog list grid view
- Remove some useless custom css
- Restore 'groups' in xml data
- ...

Part of https://github.com/odoo/odoo/pull/31749
task-1948882
2019-03-29 16:37:37 +00:00