Commit Graph
129528 Commits
Author SHA1 Message Date
qsm-odoo 05f9b1f4e6 [REF] web_editor: do some linting and ES6 adaptation before UI refactor
This commit aims at linting and converting to ES6 some parts of
web_editor JS to avoid as much noise as possible in UI refactor in next
commit.

Part of https://github.com/odoo/odoo/pull/36068
task-1942370
2019-08-28 09:04:49 +00:00
qsm-odoo b47f097feb [FIX] web_editor, *: review assets organisation
* mass_mailing, point_of_sale, website

- Lib files were included twice
- Variables files were split but added multiple times in the same assets
  bundle
- Useless assets templates were defined or split
- ...

Part of https://github.com/odoo/odoo/pull/36068
Related to task-1942370
2019-08-28 09:04:25 +00:00
qsm-odoo 7acb22a5e5 [FIX] web_editor: restore moving snippets to nearest dropzone
Hard to say when this was broken since the current work and revert of
the editor: when dropping a snippet outside of a dropzone it was not
dropped in the nearest one anymore because the dropzones were somehow
destroyed first in the current code.

Part of https://github.com/odoo/odoo/pull/36068
Discovered while working on task-1942370
2019-08-28 09:04:18 +00:00
Priyanka Kakadiya 5f35819fff [IMP] web: remove 'ID' field from custom groupby dropdown
purpose of this commit is to remove ID from the fields to group by on the
searchview as it does not work nor does it make sense.

removed field 'ID' from custom group by on search view.

task-2028105

closes odoo/odoo#34752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-28 08:43:03 +00:00
Aaron Bohy 9a4123995f [FIX] base_import: layout issues
This rev. makes the 'Formatting Options' area responsive.

Closes #34257

Task 2007558

closes odoo/odoo#36159

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-28 07:35:50 +00:00
Odoo's Mergebot 70a65b0132 [ADD] pos_adyen: generic payment interface and Adyen integration
This does two things:

- Makes it easy to implement new electronic payment methods in the POS by extracting a generic payment interface from the `pos_iot` enterprise module, and
- Uses this new interface to implement Adyen's Point of Sale Terminal API

For more info see individual commits.

Internal task: https://www.odoo.com/web#id=1981799&model=project.task&view_type=form&menu_id=

closes odoo/odoo#35702

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-28 10:57:36 +02:00
Mohammed Shekha 555a2fd93e [IMP] stock: add inline form view for move_ids_without_package o2m
Before this commit the default form view was opened for this o2m on mobile
but there was too much fields.

As we want to show the same fields as the editable list in desktop, we
added an inline form view that will be used on mobile.

Task ID : 2031163

closes odoo/odoo#34830

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-08-28 07:37:09 +00:00
Hardik Prajapati 272b041e53 [FIX] web: keep nocontent tooltip in center
Before this commit: nocontent tooltip was not diplayed in center

After this commit: nocontent tooltip will be displayed in center,
toggle o_list_view class which should not be added if nocontent
help is displayed, as there is no listview to display so remove
o_list_view class

task-2008371

closes odoo/odoo#34178

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-28 07:25:32 +00:00
william-andre d201a39357 [IMP] account: rework the reconciliation widget
Task 36284
Change the visual aspect of the reconciliation widget:
* Use a tab system to change modes
* Matching for receivable/payable (and liability)
* Matching for types not above
* Create a new line
* Batch Payment
* Sale Order
* Add a keyboard navigation
* Improve the search bar and use a real search view to do so
* Remove the constraint that prevent to select a line already selected
on another statement. Instead remove it when a reconciliation is
validated
* The lines already proposed are proposed last on other statement
lines
* Put the lines with exact amount matching first in the propositions
* Improve when Rainbowman shows
* Change the order of the propositions: older show first
* Remove the title on top of the view (and the ability to edit it)
* Fix some breadcrumb issues
* Also add lines from receivable/payable without partners in the manual
reconciliation widget.
* Propose things to do if there are no lines found in the manual
reconconciliation

closes odoo/odoo#32631

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-27 11:26:50 +00:00
Martin Trigaux ca9ea81932 [REV] base: revert 2486259ef9
The commit was for performance reasons but introduced regressions as
explained at
https://github.com/odoo/odoo/pull/29779#issuecomment-524346268

Reverting until finding a better patch

closes odoo/odoo#36143

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-27 14:55:37 +00:00
Xavier-Do 7c21999537 [FIX] core: Correctly handle log_level in odooTestResult
Before this commit --log-level had no impact on test logs.

We need to check logger "isEnabledFor" before makeRecord
since logger will make this check in error,warn,log...
dedicated function before making call to _log.

We also need to use modules.py runner instead of unittest
logger in OdooTestRunner (test will allways be a suite there)

closes odoo/odoo#36142

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-08-27 15:01:38 +00:00
Julien Castiaux 24c92d8b95 [FIX] account: move group visible search to inherited view
Make sure your user does not have the "Analytic Accounting" group,
access the Invoices Management Report, traceback.

The problem is linked to groups. When they are used on model field, the
field is removed by the ORM. When they are used in view field, the field
is set as invisible. As both fields were restricted to the group, the
frontend was trying to render an invisible field using a removed field
causing the traceback.

The problematic field has been moved to a dedicated inherited view with
the group applied on the entire view. This cause the field not to be
rendered when the user does not have the group.

closes odoo/odoo#36122

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-08-27 11:11:10 +00:00
Raphael Collet c3ebc0b987 [FIX] fields: do not update translations for no record
When a translated field is set on new records, one should not update
translations in 'ir.translation'.

closes odoo/odoo#36138

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-27 14:25:44 +00:00
Christophe Monniez a893a51771 [FIX] account: install all l10n modules in one pass
Before this commit, the test was installing l10n_ modules one by one in
a loop. Since the orm improvements, this fails because
button_immediate_function creates a new registry and the test setUpClass
still uses the old one, leading to a CacheMiss.

With this commit, the button_immediate_install method is used on the
modules recordset.

closes odoo/odoo#36105

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-08-27 08:16:06 +00:00
Mohammed Shekha 6952ee18bc [FIX] web: crashmanager wrong syntax of arrow function
arrow function used for error handler and error function is defined
inside inner function so this will get changed, need to use self,
also arrow function doesn't have its own arguments object,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Issue raised from following commit:
https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab

task-2052484

closes odoo/odoo#35788

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-27 12:13:43 +00:00
David Beguin e74c6ef86a [FIX] website : fix visitor cookie expiration
Before this commit, the visitor cookie was expiring by default on
browser session close on firefox. On Chrome, the cookie was always
valid after browser session closing.

On Firefox, the expiration date must be set to make the cookie still valid
after closing the browser.

The same thing happened with livechat_session cookies set
in context of livechat request.

The cookie expiration date (100 years to 'never' expire) have been added.

Linked to original Task ID : 2028059

Task ID : 2060381
PR #36126

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-27 12:12:37 +00:00
Jeremy Kersten ed19f90992 [FIX] website: rte_translator try to try to fix
using the same trigger than l72 for the same action.

We just set the cat amount the pigeons, and hope to fix random red's runbot

closes odoo/odoo#36110

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-08-27 08:54:58 +00:00
Pierre Masereel 73d877eef2 [FIX] point_of_sale, pos_restaurant: order sequence
WHen you are creating a draft order, the sequence is not saved on the
server, and when we load the orders from the server the session id is
not correct too.

This leads to having inconsistant sequence numbers in the POS, almost
when we are synchronizing orders through the pos restaurant.

We now show the orders sequence number prefixed by login number when the
order is synchronized and don't have the same login number as current.

TASK-ID: 2057436

closes odoo/odoo#36032

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-27 09:45:04 +00:00
Pierre Masereel e8d52e0025 [FIX] point_of_sale: login to wrong session
When you are login to a session, the domain that was looking for the
session was wrong, so you could log into a session and connect to
another one.

TASK-ID: 2057436
2019-08-27 09:38:58 +00:00
Pierre Masereel af891695a3 [FIX] point_of_sale: order sequence number
The order sequence number was bad displayed since changes made in
pos_restaurant to synchronize the orders.

We are now displaying them like before, and when it is an order
synchronized from another instance of the session, we are displaying 2
numbers instead of one.

TASK-ID: 2057436
2019-08-27 09:38:58 +00:00
Pierre Masereel 1e0e7b59a2 [FIX] pos_restaurant: don't show guests on receipt
When you are in a pos session, and have installed pos_restaurant, you
get the number of guest ('1') printed on the ticket even if you are not
in a session of type restaurant.

So we are now checking that you have a table (which mean you are in a
pos session of type restaurant) to show the guest number.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel b75d5964ca [FIX] point_of_sale, pos_hr: manager access rights
You can set up on your pos config to only allow manager to change the
price during a sale.

This feature doesn't work any more, because each user is enforced to be
manager if only point of sale module is installed. And if 'pos_hr'
module is installed, everybody is going to be cashier, because the users
are not correctly store on the pos to see if an employee is a manager or
not.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel ab0a207a59 [FIX] point_of_sale: force load discount product
When you set up a discount product on your pos config and also some
available categories, it is possible that the discount product is not
loaded in the point of sale, which lead to an error.

Now we are forcing the loading of the discount product to allow using it
even if it is not in the allowed categories, as we don't want to create
a discount product for each category if we want to use both features.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel d0840a5ba6 [FIX] point_of_sale: currency on default cashbox
When you are creating a cashbox as default on a config, it cannot find
the config as it is not linked to it yet.

So we are passing the currency of the config in the context to correctly
set it.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel 8fbbf1c696 [FIX] point_of_sale: vailable categories in POS
When you are selecting the some available categories of products for a
point of sale config, it won't let you select a start categories
anymore. This is caused by changes made on onchange in rev:f44571f550dfa34ddb1a62bbe03e78a4dadf8eda
that makes the records of One2many with new_ids instead of classical
ids.

The other problem is that if you return a in an ocnchange, the domain
does not apply when you are starting to edit a record.

To fix the behavior, we are comparing the ids, instead of the recordst
makes the records of One2many with new_ids instead of classical ids.

We've also created a computed fields that contains the ids that can be
selected.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel b8f7b472a6 [FIX] point_of_sale: specify views
In the module pos_iot, an AbstractAction overrides the buttons that
validate the session to send to terminal the balance of the day.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Joren Van Onder e6372c3cc6 [IMP] pos_adyen: avoid concurrent updates
Every time we check the status of a request (every 3 seconds) we also
launch another request to check the status of the terminal. This way
we can notify the user if the terminal is no longer reachable.

Even though we call Adyen's async endpoint for this it can still take
a while to complete (>2 seconds). Before this change the
pos_payment_table would be locked for this entire duration. This means
it's now likely that during this time Adyen calls us back to say the
transaction is finished. It needs to write on the payment method which
causes the concurrent update error.

Odoo's automatic retry mechanism would usually handle this fine but
it's not pretty solution.

Instead let's convert the methods that do the async call to @api.model
functions and pass in all the data they need. This solves the problem
because now we won't need to lock pos_payment_method for the duration
of the request.
2019-08-26 12:03:05 -07:00
Joren Van Onder 8bfeedb671 [IMP] pos_adyen: reduce logging noise
Adyen notifies us every time the screen on a terminal changes
etc. Let's only log the requests we will process.
2019-08-26 12:02:10 -07:00
Sébastien TheysandJuhil Somaiya 30d3ac79c7 [IMP] product, *: allow multiple lines for the same attribute
* = sale, website_sale, website_sale_comparison

Purpose
=======

This allows to handle use cases such as grape varieties for wine products where
multiple values need to be set for the same attribute, but they are all
informative and should not generate a choice or variants.

The general logic that existed previously is kept:
- multiple attribute lines on a product behave as an AND between them
- multiple values on a line behave as an OR between them

Example
=======

To generate 2 variants, with one possible value for each:
Line A: val 1, val 2

To generate 1 variant, with both informative values on it:
Line A: val 1
Line A: val 2

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

- remove the constraints that prevented this use case from working since the
refactoring done in the previous commit removed the ambiguity when two
different lines have the same value
- update the product and comparison views accordingly

Extra
=====

- make the attribute category translatable and improve its list view

Final part of task-1912579

PR: #32946

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>


Co-authored-by: Juhil Somaiya <jso@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-08-26 13:01:14 +00:00
Sébastien Theys 22a11a6f4d [REF] product, *: save product.template.attribute.value on variants
* account, hr_expense, mrp, sale, sale_product_configurator, stock_account,
  website_sale, website_sale_comparison

Before this commit, the `product.attribute.value` were stored on the variants.
This required filtering of attribute lines to find the appropriate matching
`product.template.attribute.value` that were used in most of the business code,
such as when computing the `price_extra`.

This also prevented to have multiple attribute lines for the same attribute,
which is needed to handle use cases such as grape varieties for wine products.
This will be done in the following commit.

After this commit, the combination of `product.template.attribute.value` will be
directly stored on the product variant.

Other changes
=============

Add `combination_indices` on product, which allows to quickly find a variant
matching a combination (1 simple indexed equality query as opposed to 1 query
with as many joins as there are attribute lines), and to add an easy
SQL constraint to ensure active combination uniqueness.

Add active field on `product.template.attribute.line` and
`product.template.attribute.value`, with the same behavior as variants:

They become archived if they can't be unlinked. This allows to keep the database
consistent, such as archived variants correctly keeping all their values, sales
order lines keeping their custom and no_variant. This is done with the help of
`ondelete=restrict` on the corresponding m2m fields, and the `unlink` methods
falling back to archiving when `unlink` is restricted.

Part of task-1912579

PR: #32946
2019-08-26 13:01:13 +00:00
Christophe Monniez 191213bca2 [FIX] tests: avoid warning during a setUpClass failure
Since 735ee54 the logs are improved by getting additional informations
from the traceback. When the test fails during the setUpClass, the test
object received by the getCallerInfo method is not a TestCase instance
but an _ErrorHolder. Although they should have the same API, as stated in
unittest documentation, the _ErrorHolder does not have  a
_testMethodName attribute leading to a warning.

With this commit, the warning is skipped in that particular case.

closes odoo/odoo#36108

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-08-27 08:43:09 +00:00
wan 8f4c8ef2db [IMP] account: add the ability to exclude from journal groups
Task 2034896

* Change the logic from selecting journals to include, to journals to exclude
* Add a placeholder for the account.journal.group name
* Rename the field name for back-to-basics

closes odoo/odoo#34779

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-08-27 08:02:52 +00:00
Florian Gilbert d28ba99905 [REF] account: Clean accounting settings
closes odoo/odoo#35534

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-08-27 06:40:24 +00:00
Raphael Collet a2d6acc0c0 [FIX] website_sale: avoid non-invertible dependency
closes odoo/odoo#36020

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-26 14:14:56 +00:00
Raphael Collet 6f1dde1c38 [FIX] ir_module: missing dependencies
The fields `ir.module.module.dependency.state` and
`ir.module.module.exclusion.state` were not recomputed when the state of
their corresponding module was modified.  Add the missing dependencies,
and make them searchable.
2019-08-26 14:14:55 +00:00
Raphael Collet e5c6904a40 [FIX] models: log non-invertible dependencies as errors 2019-08-26 14:14:55 +00:00
Pierre ParidansandDharmang Soni 9c8902ed57 [IMP] web: add extension hooks to Dialog
This commit adds two methods as hooks to customize the way Dialog deals
with its buttons :

* _setButtonsTo() : to render and set the buttons into a container
element;
* _setRemoveButtonOption() : to define the remove button and
set its destination zone (header, footer)

Task ID: 2038324

closes odoo/odoo#35474

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>


Co-authored-by: Dharmang Soni <dpr@odoo.com>
2019-08-26 14:13:06 +00:00
Pierre Paridans 96a52daa80 [REF] web: remove test coverage overlap in mobile test suite
The tests in the file `relational_fields_mobile_tests.js` - which is
part of the mobile test suite - are actually not specific to mobile.

This commit merges those tests asserts into the tests already present in
the regular test suite. It ensures that all the existing asserts remains
and the actual coverage stays the same.
2019-08-26 14:13:06 +00:00
Jeremy Kersten 0a540e0ef2 [IMP] website_blog: improve layout with latest specs
- Hide first post when latest not in full width mode
- Hide navigation Blogs when only 1, else always shown
- Compress image
- Show blog name when in one blog index, show latest when in all blogs
- Merge 2 controllers in one /blog and /blog/<record>
- ...

task-2057433

closes odoo/odoo#36091

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-26 14:49:43 +00:00
Romain Derie 269aa59411 [IMP] http_routing, website: allow to customize the lang in URL
With this commit it is now possible to change the lang displayed in the URL.
Eg, you could use `/fr` instead of `/fr_BE`, or even a fancier `/french`.

Task-32838

Courtesy of pla@odoo.com

closes odoo/odoo#35135

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-08-26 16:35:19 +00:00
Sébastien Theys f10f120de3 [IMP] base: remove default image from res.partner
Processing the default image takes too much time.

Creating 1000 partners without image takes around:
- 7s before this commit
- 1.5s after this commit

Moreover by saving the default image it's impossible to tell which partners
have a default image and which have an actual image.

After this commit, the views should handle displaying a placeholder when no
image is set, which is already the case since the default image could already be
missing if it was removed from `write`.

closes odoo/odoo#36093

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-08-26 15:50:28 +00:00
Thibault Delavallée cab25b690c [FIX] payment: fix error management in payment form
PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

Recent commit 5193f0d010 introduced a tool method to parse errors and ease
their management. A variable typo was done by mistake, fixed in this commit.

LINKS

Task ID 1937768

closes odoo/odoo#36085

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-26 13:33:26 +00:00
Aurélien Warnon bee50c4284 [FIX] website_slides: fix auto-completion of Youtube lesson
PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

A slide is supposed to be automatically completed in fullscreen mode when
Youtube player reaches the last 30 seconds of the video.

This feature was broken because of wrong Promise completion and also because
Youtube API has apparently changed the way they send "events". "Playing" event
was not sent every X seconds. Function running to check the video timer has
therefore been reworked to take that change into account.

LINKS

Task ID 1937768
2019-08-26 13:33:22 +00:00
Thibault Delavallée 4c6abbb5e1 [FIX] website_slides: fix placeholder and kanban images
PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

This commit fixes issues spotted when testing eLearning in backend

  * placeholder image was referring an unexisting image;
  * kanban was still using image fields prior to some image.mixin refactoring;

LINKS

Task ID 1937768
2019-08-26 13:29:49 +00:00
Raphael Collet c7f5c4afd2 [FIX] sql_db: add flush() in savepoint()
closes odoo/odoo#36060

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-26 13:39:16 +00:00
Raphael Collet eafdf1812d [FIX] sql_db: environment retrieval in cursor 2019-08-26 13:37:25 +00:00
Kevin Baptiste 054685875c [IMP] *: finetune search views (back2basics)
The goal of this commit is to finetune search views in several modules.

TaskID: 2055972

closes odoo/odoo#36058

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-26 07:40:02 +00:00
Martin Trigaux b247aa3252 [I18N] *: export saas-12.5 source terms
That will be used a the basis for the future 13.0 version
Without demo data

closes odoo/odoo#36057

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-26 09:38:09 +00:00
Joren Van Onder ee61c993cb [ADD] pos_adyen: integrate Adyen's Terminal API
This allows Adyen's POS terminals to be used in the POS. The
architecture is as follows:

Odoo <--> Adyen server <--> Adyen payment terminal

It means we don't have to communicate directly with the
terminal. Instead we send HTTP requests to Adyen's API and they take
care of the rest. Therefore this integration doesn't require an
IOTBox.

Unfortunately this module is more complicated than it needed to be due
to Adyen's API not supporting CORS. Because of this we can't directly
call their API from JS. Instead we need to proxy requests through the
Odoo backend. This complicates things further because this means we
can't use their synchronous API. With this API an HTTP request remains
open for the entire duration of a transaction. We can't afford to
block an HTTP worker this long. So this implements their asynchronous
API which calls us back when a transaction completes.

In addition to the regular sale requests we also poll the status of
the terminal using DiagnosisRequests while transactions are in
progress. This is to handle cases where a payment terminal loses
connection after a payment transaction is initiated. It also handles
cases where a terminal was recently disconnected (<1 min). In this
last case Adyen will process the payment request as usual, without
notifying us the terminal is offline. It's important to notify the POS
user to check the terminal, otherwise he'll have no idea something is
wrong. We store the DiagnosisResponse's unique ID and every time the
POS requests a status update we launch a new DiagnosisRequest. When we
no longer receive DiagnosisResponse ID updates we can notify the user
of this in the POS.

To test this locally use something like ngrok so Adyen can call you
back.

API docs: https://docs.adyen.com/point-of-sale

https://www.odoo.com/web#id=1981799&model=project.task&view_type=form&menu_id=
2019-08-23 16:22:00 -07:00
Joren Van Onder 69e071e1f3 [IMP] point_of_sale: allow custo of pos.payment.method write constraint
Allow another module to override this behavior for some fields.
2019-08-23 16:22:00 -07:00