Commit Graph
143606 Commits
Author SHA1 Message Date
xO-Tx ebfa28638b [IMP] website, *: allow to handle snippets with a list of items
*: web_editor

The goal of this commit is to add the "MultipleItems" option
to be able to add new elements in snippets with a list of items.

In this commit, the option is used for "Media List" & "Tabs".

Part of https://github.com/odoo/odoo/pull/68061
task-2431484
2021-07-12 08:30:57 +00:00
xO-Tx 33b74a0fba [IMP] website: improve carousel options
In this commit, the following changes have been made:

- Add "Add Slide" button for carousel snippet.
- Add tooltips and update style for slide-related buttons.

Part of https://github.com/odoo/odoo/pull/68061
task-2431484
2021-07-12 08:30:57 +00:00
xO-Tx 7ea2350255 [IMP] web_editor: set tooltips on sidebar elements
The goal of this commit is to add BS tooltips for editor
sidebar elements using "data-tooltip" attribute to select targets.

The code used to show tooltips on sidebar tab buttons is removed
in this commit since it has no effect after [1].

[1]: c71cf6c618b48da36fbc5063140703312248bc09

Part of https://github.com/odoo/odoo/pull/68061
task-2431484
2021-07-12 08:30:56 +00:00
Demesmaeker c5e9e03578 [IMP] delivery: mandate the tracking reference for amazon SO
Added a hook in delivery to check if an Amazon order's delivery is Amazon compliant.

task-2573260

closes odoo/odoo#73494

X-original-commit: eb23d10b22c0cafc935d01effc680aebdbdf0057
Related: odoo/enterprise#19578
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-09 11:59:31 +00:00
Josse Colpaert 6ab7290c36 [FIX] l10n_latam_invoice_document: do not restrict the inverse/onchange too much
The onchange/inverse would only be triggered in the case of manual document number (vendor bills)
or not highest_name, but in other localizations there are cases where we want to be more flexible
to when we change it and instead of inheriting the method, we can relax it here.

Also, it should have been avoided before already to change the document number and type in those situations
through the attributes in the view e.g.  This seems to have been more like an extra fail-safe blocking us
elsewhere.

closes odoo/odoo#73397

X-original-commit: a3f8e53deb45034250820ff54ba76288af167b6e
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-07 17:42:10 +00:00
Nils Hamerlinck 5b3bf7254f [ADD] http: allow env variable to disable session_gc
Introduce the env variable ODOO_DISABLE_SESSION_GC to disable session_gc
on high-volume systems and avoid random slow calls as discussed in
https://github.com/odoo/odoo/pull/70063

closes odoo/odoo#73376

X-original-commit: a61d459a200a56fba74f655f73b10d1ddd8e3a1e
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-07-07 13:17:03 +00:00
Mohammed Shekha ef21b193cd [FIX] web: datepicker week date offset
PURPOSE

The week dates computed by our datepicker do not meet the ISO 8601 standard:

The ISO 8601 definition for week 01 is the week with the first Thursday of the
Gregorian year (i.e. of January) in it.
The following definitions based on properties of this week are mutually
equivalent, since the ISO week starts with Monday:
- It is the first week with a majority (4 or more) of its days in January.
- Its first day is the Monday nearest to 1 January.
- It has 4 January in it. Hence the earliest possible first week extends from
Monday 29 December (previous Gregorian year) to Sunday 4 January, the latest
possible first week extends from Monday 4 January to Sunday 10 January.
- It has the year's first working day in it, if Saturdays, Sundays and 1
January are not working days.

If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in W01. If
it is on a Friday, it is part of W53 of the previous year. If it is on a
Saturday, it is part of the last week of the previous year which is numbered
W52 in a common year and W53 in a leap year. If it is on a Sunday, it is part
of W52 of the previous year.
https://en.wikipedia.org/wiki/ISO_week_date#First_week

Since Jan 1st 2021 falls on a Friday, according to the ISO 8601 standard above,
the first week of 2021 is the one starting on Jan 4th.
Nevertheless, it looks like our datepicker simply assumes that the first week
of the year is simply the one including Jan 1st.

SPECIFICATION

Fix the week dates of our datepicker to meet the ISO 8601 standard.

Task - 2458112

closes odoo/odoo#73270

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-07-12 06:44:24 +00:00
Arnaud Joset 48592a6b75 [FIX] account,l10n_be_edi,point_of_sale,sale: improve terms and conditions
Before this commit, the narration field was not filled with default terms and conditions when it was defined in the company settigns.

closes odoo/odoo#73501

Taskid: 2587051
X-original-commit: 49ca71337c8e0f00a5f200d5e97c1c246a6ccd03
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-07-09 13:07:05 +00:00
Alvaro Fuentes d25b4b020d [FIX] account: fix tuple domain
Domains must be lists on calls to `_where_calc`.
```
 Traceback (most recent call last):
   File "/tmp/tmpjmcn3gby/migrations/base/tests/test_mock_crawl.py", line 162, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmpjmcn3gby/migrations/base/tests/test_mock_crawl.py", line 253, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmpjmcn3gby/migrations/base/tests/test_mock_crawl.py", line 366, in mock_view_tree
    self.mock_web_read_group(model, view, domain, group_by, fields_list, limit_group=5)
   File "/tmp/tmpjmcn3gby/migrations/base/tests/test_mock_crawl.py", line 442, in mock_web_read_group
    self.mock_web_search_read(model, view, [group["__domain"]], fields_list)
   File "/tmp/tmpjmcn3gby/migrations/base/tests/test_mock_crawl.py", line 402, in mock_web_search_read
    data = model.search_read(domain=domain, fields=fields_list, limit=80)
   File "/home/odoo/src/odoo/14.0/addons/account/models/account_move.py", line 3645, in search_read
    return super(AccountMoveLine, self.with_context(domain_cumulated_balance=to_tuple(domain or []), order_cumulated_balance=order)).search_read(domain, fields, offset, limit, order)
   File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4839, in search_read
    result = records.read(fields)
   File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3020, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3040, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5666, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1019, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1175, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4061, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/14.0/addons/account/models/account_move.py", line 3655, in _compute_cumulated_balance
    query = self._where_calc(self.env.context.get('domain_cumulated_balance'))
   File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4247, in _where_calc
    domain = [(self._active_name, '=', 1)] + domain
 TypeError: can only concatenate list (not "tuple") to list
```

Observed on upgrade request 11722
Ref 9d28c71a71 since saas-13.2

closes odoo/odoo#73522

X-original-commit: e24295da8436b4d24cd03f6ac1f22e86465f950d
Signed-off-by: Christophe Simonis <chs@odoo.com>
2021-07-09 20:50:24 +00:00
william-andre 10db78c7a5 [IMP] account: yearly sequence for sales journals
PURPOSE
Align default sequence numbering on customer's expectation per journal.
Because of some feedbacks received, we acknowledge that most users will
want an annual sequence on sales documents and a monthly sequence for
the rest.

SPECIFICATION
By default, on customer invoices/credit notes (the default sequence
should be annual.)
We don't want an option and therefore, we make a decision ; user can
change it by resequencing if he doesn't like it.

task-2591145

closes odoo/odoo#73278

Related: odoo/enterprise#19565
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-09 08:43:59 +00:00
Odoo's Mergebot dfe2380f86 [MERGE][ADD] mail(_list): move mailing lists to their own module
RATIONALE

Discussion channels currently have two main operating modes: Discuss channels
(classic, chat, livechat) and Mailing lists (activated through "send email"
checkbox). This current model has several drawbacks

  * mailing lists are meant to be used by external people. Discuss/Inbox
    display has no use for external people;
  * mailing lists have a frontend page (website_mail_channel) that also
    displays private channels (if people have access) content, which makes
    no sense;
  * moderation is available only on mailing lists, meaning the moderation
    mechanism is useless for a majority of channels;
  * incoming Discord-like behavior of channels will further make mailing
    lists different from chat channels;

PURPOSE

Split mailing list from discussion channels. Purpose of this new module
is to manage the mailing lists. Now they are no more <mail.channel>
with email_send set to True but instead use their own model.

SPECIFICATIONS

The mailing list is basically a public discussion that users can have
by email. They can respond to email, send new messages, etc... All the
members of the mailing list will receive the message by email.

Users can moderate the emails of the mailing list in the same way as
they did with the "email" mail channel.
- *accept*, will accept the emails and send it to the members of the
  mailing list
- *discard*, will drop the email without warning the author
- *reject*, will drop the email and send a notification email to the
  author
- *allow*, will accept the email and all other pending emails of the
  same author and create a whitelist for him
- *ban* will drop the email and all other pending emails of the same
  author and create a blacklist for him

Now a portal view is available (in /groups) and replace the old module
"Website Mail Channel" that was removed in the previous commit. In this
view, users can subscribe / unsubscribe to the mailing lists and some
links to this portal view are added in the footer of the emails of the
mailing list.

As before with mail channels, you can send guidelines to the members,
notify the moderators whose an action is required (in a CRON), send back
an email to the author of an email to say "Your message is waiting
moderation"...

LINKS

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600

closes odoo/odoo#71599

Related: odoo/enterprise#19296
Related: odoo/upgrade#2600
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-09 20:07:18 +02:00
Jeremy Kersten f7c43b4343 [FIX] website: parse result of_render as html
`_render('<h1> quick &amp; flupke </h1>') `=>` '<h1> quick & flupke </h1>'`
what cannot be parsed in xml after.

Before this commit, if you try to install a page that contains a '&' via
the configurator, you had a traceback:
   xmlParseEntityRef: no name, line 1, column 13

closes odoo/odoo#73509

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-09 14:42:10 +00:00
Ivan Yelizariev 9289cc03ab [IMP] point_of_sale: store related company_id field in pos.payment
it speeds up checking multi-company rule, partically, computed field
`total_payments_amount` works faster in large databases: 2,8 sec -> 0,01
sec (see fe3e84085f )

closes odoo/odoo#73505

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-07-09 13:53:48 +00:00
std-odoo 8b814947d3 [ADD] website_mail_group: re-add the <mail.group> website snippets
Purpose
=======

This snippets was originally in the "Website Mail Channel" module,
but it has been removed.

The snippet allow the user to subscribe to a specific mailing list.

If the current user has no access to the mailing list (because of ACL
rule) the widget will be invisible for him.

Links
=====

Task-2510267
See odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 12:32:28 +00:00
std-odoo 2d359b909b [ADD] mail_group: add a new module to manage the mailing lists
Purpose
=======

The purpose of this new module is to manage the mailing lists. Now they
are no more <mail.channel> (will email_send set to True) but they have
their own model.

Specifications
==============

The mailing list are basically a public discussion that users can have
by email. They can respond to email, send new messages, etc... All the
members of the mailing list will receive the message by email.

Users can moderate the emails of the mailing list in the same way as
they did with the "email" mail channel.
- *accept*, will accept the emails and send it to the members of the
  mailing list
- *discard*, will drop the email without warning the author
- *reject*, will drop the email and send a notification email to the
  author
- *allow*, will accept the email and all other pending emails of the
  same author and create a whitelist for him
- *ban* will drop the email and all other pending emails of the same
  author and create a blacklist for him

Now a portal view is available (in /groups) and replace the old module
"Website Mail Channel" that was removed in the previous commit. In this
view, users can subscribe / unsubscribe to the mailing lists and some
links to this portal view are added in the footer of the emails of the
mailing list.

As before with mail channels, you can send guidelines to the members,
notify the moderators whose an action is required (in a CRON), send back
an email to the author of an email to say "Your message is waiting
moderation"...

Links
=====

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 12:32:28 +00:00
xO-Tx a075536837 [FIX] website, web: fix first link of table of content snippet
The first element is now selected once the snippet is visible at the
bottom of screen.

task-2431484

closes odoo/odoo#73499

X-original-commit: e2cfaf8e58c3f267503fc7ec81d78f728e75b506
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-09 12:07:24 +00:00
std-odoo 583cc5d439 [REM] website_mail_channel: remove the module "website_mail_channel"
Rationale
=========

Currently, mail channels have 2 modes
- They can be used like Discuss channel (chat, livechat, group)
- They can be used like a Mailing List (with the "email_send" field)

The mix of both feature in the same model cause some code complexity.
Several fields are not used in both cases (moderation related field)
and the future "Discord like" Discuss will even push the mail channel
further than the usage of the mailing list.

Because of all those reasons, we want to split the 2 mains features of
the mail channels into 2 different modules and models.

Purpose
=======

Remove the module "website_mail_channel" because we will merge it into
a new one, "mail_group" and "website_mail_group".

This new module "website_mail_group" will contains the website snippets
but this snippets will only work the the new <mail.group> model and
not with <mail.channel> like before.

Links
=====

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 11:16:38 +00:00
std-odoo 9183a86fde [REM] mail: remove "email_send" field on the mail channel
Purpose
=======

Remove the "email_send" field on the <mail.channel> (mass_mailing named
on the JS side).

This feature will be introduced with a new model (<mail.group>) in a
new module in the next commit.

Remove the email notification support on the channel, so now the mail
channels work only by chat.

Remove the "subject" on the Discuss side because this was used only on
"email" channel.

Technical
=========

In the mail channel model we can drop the usage of the blacklist as well
as the usage of the "email_to" field. Those two features were mainly
used for mailing list and have no utility for "chat like" channel.

Links
=====

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 11:16:38 +00:00
std-odoo 59d6bb23d7 [REM] mail: remove mail channel moderation
Rationale
=========

Currently, mail channels have 2 modes
- They can be used like Discuss channel (chat, livechat, group)
- They can be used like a Mailing List (with the "email_send" field)

The mix of both feature in the same model causes some code complexity.
Several fields are not used in both cases (moderation related field)
and the future "Discord like" Discuss will even push the mail channel
further than the usage of the mailing list.

Because of all those reasons, we want to split the 2 mains features of
the mail channels into 2 different modules and models.

Purpose
=======

This commit remove the moderation feature of the mail channel
(email_send=True). This will be re-implemented in a separate module
in the next commit.

Do not be able to check messages in Discuss anymore because this
feature is only used to moderate the message and this feature will be
spitted in a new module "mail_group".

Links
=====

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 11:16:38 +00:00
Francois (fge)andSergey Shebanin 7f10ca0d7c [IMP] web: make the hotkey service overlay modifier customizable
From this commit:
- It is possible to modify the overlayModifier allowing to display the
overlay and to access the data-hotkeys defined in the Dom.
- Adding a hotkey using the service or hook does not add the
overlayModifier anymore.

closes odoo/odoo#73279

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Sergey Shebanin <sergey@shebanin.ru>
2021-07-09 09:16:57 +00:00
Francois (fge) 20e157dd01 [FIX] web: doesn't apply the invisible data-hotkey
The purpose of this commit is to prevent the activation of data-hotkeys
associated with hidden elements of the dom.

Task-2591069 - BUG 1
2021-07-09 09:13:58 +00:00
Nicolas Bayet 4600086e7a [IMP] web_editor: move odoo-editor into odoo
The code of the Odoo editor was on another repository
and that created unnecessary overhead. This commit move
the code inside Odoo and slightly change the folder
structure.

Related PR:
saas-14.3: #73345
saas-14.4: #73348

closes odoo/odoo#73272

Master: #73272
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-08 15:31:45 +00:00
Younn Olivier ea3b1ec9a0 [IMP] web_tour: center tip on texts in tours
Before, the tour tip was centered on the container tag instead of the
text content. That asymmetry was visible for text with a text-align
different than center.

Therefore the _reposition method of the tip has been modified to better
handle such text elements. If its anchor element has inner text we
use a range to get the width of the text.

task-2477212

closes odoo/odoo#67771

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-09 07:53:06 +00:00
Florent de Labarre d6217a86a7 [FIX] point_of_sale : show reversed payment
- In POS with pos_six installed
- create an order
- add a payment with SIX, paid
- Click on reversed
- Pay in cash

--> Issue on the receipt the payment and refund by SIX doesn't appear on the ticket

closes odoo/odoo#73498

X-original-commit: 3e8d921318e86631b73c8c92c2e462fd0d761582
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-07-09 11:49:25 +00:00
Touati Djamel (otd) 511a87b488 [FIX] account: Fix clearing of the accounting date
Steps to reproduce the bug:
- Go to Accounting > Vendors > Bills
- Create a new Bills
- Delete the contents of the 'Accounting Date' field.
- Click off that field.

Problem:
-An AttributeError is triggered because we try to recalculate a new name via the function `"_compute_name"`
and we base ourselves on the date field, but we do not check if it is null or not before accessing it.

This field is only used for purchase receipts, vendor bills, vendor credit notes, payments
and regular journal entries. Other move types are unaffected here.

opw-2511799

closes odoo/odoo#73490

X-original-commit: f830efa1af28de4a4cc3b861643ac9b6fb352c8d
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-07-09 11:06:11 +00:00
Adrien Widart 997086ba5f [FIX] purchase: auto-complete bill with multi-currency
When adding several PO to a bill, if they don't have the same currency,
it will lead to incorrect amounts

To reproduce the error:
1. In Settings, enable "Multi-Currencies"
2. Invoicing > Configuration > Currencies:
    - EUR: Active, Current Rate = 2
    - USD: Active, Current Rate = 1
3. Create a PO:
    - Currency: USD
    - Products:
        - One product, no taxes, unit price 1000
4. Confirm PO
5. Edit PO:
    - Qty Received: 1
6. Repeat 3 -> 5 with EUR instead of USD
7. Open a new Bill
8. Add the first PO to the field "Auto-Complete"
9. Add the second PO to the field "Auto-Complete"

Error: Both invoice lines are now expressed in EUR and both subtotals
are equal to 1000 even though the exchange rate isn't 1

This commit suggests not to change the currency of the account move if
the latter already has some AML. Moreover, the amounts must be converted
if they come from a PO that uses another currency

OPW-2573748

closes odoo/odoo#73483

X-original-commit: b299e880417026688b2fbde23307bd011de8c44d
Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-07-09 10:11:42 +00:00
Robin Heinz e9b5556501 [FIX] pos_restaurant: fix kitchen ticket display with arabic
Printing a kitchen ticket with arabic product name lead to bad css layout.
The layout has been switched to make it no matter language is used.

closes odoo/odoo#73474

X-original-commit: 3ebfac79abb81a1ab5767c47fdc32f56b049b2df
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-07-09 09:26:10 +00:00
Julien Banken 66818982b6 [IMP] mail: Rename template menu item
PURPOSE

In Odoo, there exists many different templates (contacts, spreadsheets,
etc.). To help the users distinguish them in the settings, we will rename
the menu item 'Template' to 'Email Template'.

SPECS

- Rename the menu item 'Template' to 'Email Templates'

LINKS

Task id: 2587224

closes odoo/odoo#73430

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-08 13:28:54 +00:00
Lucas Perais (lpe) a935096e51 [FIX] web: webclient: remove bootstrap tooltips more accurately
Before this commit, when hovering a button with a bootstrap tooltip set on it
(form view with header button in debug mode) and then clicking while staying hover
the tooltip was not destroyed and there was no easy means to destroy it.

After this commit, any click within a legacy context remove any bootstrap tooltip from the DOM,
since popper and tooltip are not meant to be used in the future in a wowl setting.

closes odoo/odoo#73447

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-08 15:28:01 +00:00
Ivan Yelizariev fe3e84085f [FIX] point_of_sale: speed up reading computed session fields
Context
   * postgres 12.5
   * Odoo 14

DB Stats
   * pos.payment: 645 K
   * pos.order by company: 379 K, 1 K, 973 K, 19 K

total_payments_amount
=====================

Result: 0.02 sec vs 33.6 sec

POS Session Stats:
   * pos.order: 27 K
   * pos.payment: 39 K

BEFORE

   22 33.467 0.123 (number of queries, query time, rest time)

AFTER read_group refactoring:

   4 3.952 0.006

AFTER read_group + session_id index

   4 2.770 0.009

AFTER read_group + session_id index + store company_id

   4 0.009 0.006

_compute_cash_balance
=====================

Result: 0.1 sec vs 9.2 sec

POS Session Stats:
   * pos.order: 59 K
   * pos.payment: 82 K

BEFORE
   399 1.695 7.587

AFTER
   21 0.123 0.016

_compute_picking_count
======================

Result: 0.7 sec vs 3.5 sec

POS Session stats
   * pos.order: 107 K
   * stock.picking: 60 K

BEFORE
   126 1.007 2.452

AFTER
   5 0.723 0.011

---

opw-2514640

closes odoo/odoo#73444

X-original-commit: 68bed01a73505870fb4fa41ae9cd8471d055b27f
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-07-08 15:22:34 +00:00
Sébastien Mottet (oms) 16375995de [IMP] website_sale: show discount on dynamic product
Show discount on product for the dynamic product snippet. The discount is
displayed the same way it is for website_sale.product_item: the price with the
discount and the price without discount in red and strikethroughed next to the
other price. The discount is displayed for all the snippet templates displaying
a price: 'Add Product to Cart', 'Detailed Product' and 'Image with price'.

task-2519662

closes odoo/odoo#73059

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 18:10:58 +00:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
Jeremy Kersten 1bf9367c6f [FIX] http_routing: fix url_for with querystring
before this commit

url_for('/fr?a=b') -> /fr/fr?a=b because /fr?a=b not in ['fr', 'en']

Now we split query string before to check that first path is a lang
2021-07-07 13:45:51 +00:00
Jorge Pinna Puissant 54e9527ec2 [IMP] web, *: read session information from a module
* google_recaptcha, mail, partner_autocomplete, point_of_sale, website

Now, to read session information, the module "@web/session" must be
imported. Not that, there is also the user service with all the user
information.

closes odoo/odoo#73201

Related: odoo/enterprise#19434
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-08 14:13:39 +00:00
Anh Thao Pham (pta) e2fb83814e [FIX] web: fix resequencing after moving records with same sequence
- Install Sales > Configuration > Settings and activate Delivery Methods
- Create a SO as followed:
  * Add a section (i.e. Section 1)
  * Add a product (i.e. Product A)
  * Add a product (i.e. Product B)
  * Add a shipping (i.e. Delivery X)
  * Add a section (i.e. Section 2)
  * Add a product (i.e. Product C)
- Move (drag & drop) Delivery X to the first place
SO lines are reordered, but Product B is moved after Section 2.

It comes from the fact that some lines have the same sequence and that
only the lines between the source and the destination position are
re-sequenced.

Before the move, the sequencing is as followed:
 1) Section 1: 10
 2) Product A: 10
 3) Product B: 10
 4) Delivery X: 11
 5) Section 2: 12
 6) Product C: 13

After the move, only lines from 1 to 4 are re-sequenced. Leading to the
following sequencing:
 1) Delivery X: 10
 2) Section 1: 11
 3) Product A: 12
 4) Product B: 13

 5) Section 2: 12
 6) Product C: 13

As Product B has now a greater sequence than Section 2, it will be moved
after it.

If some lines between the source and the destination position have the
same sequence, all lines should be re-sequenced to prevent such a behavior.

opw-2531524

closes odoo/odoo#73456

X-original-commit: 8f64ac8ff2b94b66a8d8e94a8635727d0d53ca6b
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-07-08 17:56:36 +00:00
Benoit Socias efc470cbff [IMP] website: validate 308 redirections parameters
Before this commit 308 redirections could be configured with a malformed
route which made the routing fail.

After this commit 308 redirections validation makes sure all parameters
of URL from appear in URL to and no other parameter appears.

task-2451780

closes odoo/odoo#73457

X-original-commit: a0e9384f1e674a140b9ddb3424fed5a43155dd01
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-07-08 18:10:09 +00:00
Raphael Collet 376ed8dc5f [FIX] core: in onchange, do not force delegate fields to False
The use-case is when a "parent" field is put on the form view, as a
readonly field, and we create a new record.  Before the fix, the fields
that depend on the parent record are always False, until the record is
actually created.

closes odoo/odoo#73446

X-original-commit: ff2af932c3b73dc59620a4ce17da3a13cab12cbe
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-07-08 15:29:20 +00:00
Raphael Collet be73b9ae26 [FIX] core: in onchange, assign inherited fields that have changed
This allows onchange to recompute fields that depend on the inherited
field that has changed.  The use-case we have is a model that inherits
from 'account.move'.  On its form view, setting the (inherited) journal
field does not recompute the (inherited) company field.

When the field 'journal_id' is modified, the onchange should:
 - assign the new value to move_id.journal_id (*)
 - recompute move_id.company_id (related='journal_id.company_id')
 - recompute company_id

This commit adds the missing part (*).

X-original-commit: 2e05d0a361aa06a34eecf64613821f2e92295298
2021-07-08 15:29:17 +00:00
qsm-odoo f70ad06775 [FIX] web_editor: remove loading effect during snippet drag and drop
When starting a drag and drop of a snippet, a loading effect on the
editor panel was performed for the whole duration of the drag. Worse:
even if the drop was done immediately, the loading effect still occurred
for 400ms as it was only marked as finished after the scroll to the
dropped snippet.

The loading effect addition was in fact a side-effect of first disabling
all editor overlays at the start of the drag... but that action was in
fact entirely unnecessary because this is not possible to have any
overlay enabled when the snippet panel is opened (because opening it
already disables all editor overlays and enabling an overlay forces the
editor to switch out of the blocks panel).

closes odoo/odoo#73437

X-original-commit: adad8a33071fbbff16d78741904ec33b3595e00b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-08 14:01:23 +00:00
Géry Debongnie 46fdfdbd84 [IMP] web: update owl from 1.3.2 to 1.4.3
Github releases:

 https://github.com/odoo/owl/releases/tag/v1.4.0
 https://github.com/odoo/owl/releases/tag/v1.4.1
 https://github.com/odoo/owl/releases/tag/v1.4.2
 https://github.com/odoo/owl/releases/tag/v1.4.3

closes odoo/odoo#73436

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-08 14:14:14 +00:00
Sébastien Mottet (oms) 84f8a30e1f [IMP] website: rename website_type_preselection field
Rename field website_type_preselection to website_config_preselection since feature
preselection is not only based on website type anymore but also on website purpose.

task-2518565

closes odoo/odoo#73377

Related: odoo/enterprise#19498
Related: odoo/upgrade#2625
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:36:12 +00:00
oco-odoo 1c09e0e5bc [REF] l10n_eu_service: remove useless Warning
This warning had been added years ago instead of relying on the exception raised in case base.europe did not exist, as this country group had been added in stable and required a module update to be created. We don't need those checks anymore.

closes odoo/odoo#73169

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-07-08 13:14:09 +00:00
oco-odoo 89bc44f960 [IMP] l10n_eu_service: raise Error message when trying to open old MOSS wizard
l10n_eu_service has been modified in order to follow the new OSS regulation. We now auto-generate the mapping instead of relying on a wizard. Databases that were already using the module will still see the button to open this wizard, unless they upgrade the module. Wit this, we add an error message in case they try to do so, asking them to update the module, so that they can use the new OSS mapping.

X-original-commit: 7a94028a33451543cbd33ea5c9e846b15e92c234
2021-07-06 14:24:53 +00:00
Nicolas (vin) d2964e1a6f [IMP] account: change revert button icon on account.move.lines
The current icon used by the revert button on account.move.lines
group by view is a refresh icon. Change it by an undo icon like
on the bank statement lines.

Task id #2585445

closes odoo/odoo#73163

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-02 13:59:48 +00:00
William Braeckman 409cf08a84 [IMP] hr_expense: force margin for upload button
Force a small margin to the left of the upload button in the expense
list view.
Previously the create and upload button would be stuck to each other.

Task ID: 2582448

closes odoo/odoo#72951

Related: odoo/upgrade#2602
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-07-08 12:00:59 +00:00
William Braeckman a0fae57e5c [IMP] hr: department views
Moves a field from hr_holidays to hr (`total_employees` of hr.department)
to display it in the department list view.
Widen the department kanban view to display more information and allow
clicking on the department name in the kanban view to edit it.

Task ID: 2582448
2021-07-08 12:00:59 +00:00
Hardik PrajapatiandMohammed Shekha 2ebb34b7cd [FIX] web: open list optional fields dropdown position to right place
Currently, the optional field's dropdown displays outside of the form view when
columns are expanded. it happens because the left css property is applied when
the column is expanded.

This commit fixes the issue by applying the correct css property after this
commit, the optional field's dropdown should always be positioned on the
right side of the list in ltr mode.

closes #69727
TaskID-2510187

closes odoo/odoo#73411

X-original-commit: bbc338438518bbb7d0e9ad1a313e872f95a36870
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-07-08 10:03:09 +00:00
wan 28973f3ae4 [IMP] l10n_nl: keep only one tax group per amount
Do not make a distinction for domestic/eu/non eu taxes.

task-2508572

closes odoo/odoo#71903

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-09 09:36:33 +00:00
wan 44b3c07224 [IMP] account: adjust chart_template_id width in settings
Lots of unused space and the values can be long sometimes

task-2526878

closes odoo/odoo#71853

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-08 08:51:51 +00:00
wan 6fa3923c69 [IMP] account: prevent posting an entry in an archived journal
* Raise an exception if posting an entry in an archived journal.
* Do not copy the journal of an account.move if it is archived.

task-2516060

closes odoo/odoo#71851

Related: odoo/enterprise#18954
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-11 11:57:57 +00:00