Commit Graph
152817 Commits
Author SHA1 Message Date
Sébastien Geelen (sge) f41f5cf3df [FIX] web_editor: Properly remove link tools frame
In mass mailing the link tools borders were not removed properly
because the element couldn't be found inside the Iframe with a $() selector.
Changed to use the `this.$link` of the `link_tool` class.

task-2634073

closes odoo/odoo#78416

X-original-commit: 4acdd17eba2a4175d1bec33397aebeadb1d5bc04
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Sébastien Geelen <sebgeelen@users.noreply.github.com>
2021-10-15 06:16:46 +00:00
Raf Geens 11848e672c [FIX] point_of_sale: Wait for cancellation to finish before starting a new transaction
Previously, when cancelling an Ingenico transaction, the cancellation
was considered done from the POS' point of view even though it hadn't
actually finished on the terminal yet. Starting a new transaction from
the POS meant it would fail and the POS and terminal's states would get
out of sync.

In an enterprise PR for the pos_iot module, a fix was made so the
cancellation request is only considered done when the terminal has
confirmed that.

In the case of pressing cancel on a payment line, this means that the
button will block and remain in a loading state with a spinner until
the operation finishes. After this the user can press the retry button
the payment line.

There are two other workflows where waiting for the cancel operation to
finish wasn't done until now, and that's what this PR is for.

The first is when a transaction was requested and the
back button was pressed in the UI. This cancels the active transactions.
If you wait a while after pressing the back button, the UI will be
notified when the cancellation finishes, and the payment line's state
will be updated in the local db, even if it's not visible on screen.
When you go back to the payment screen, you'll be able to retry the
transaction again. In V13, if after pressing the back button you
immediately go back to the payment screen, you'll see the spinner of the
wait for the cancellation, but it would never update. That's because
while the local db gets updated when the cancellation finishes, the
payment screen lines didn't get refreshed. Hence in V13 a call was added to
`stop_electronic_payment` that re-renders the payment lines (if we are
present on the payment screen) once the cancellation finishes. In V14
the UI will already correctly update on its own, so no change is required.

The second case is when a transaction is requested and the user deletes
the payment line. This used to happen immediately without waiting for
anything. This PR changes that so the line goes to the `waitingCancel`
state instead, and will only be deleted once the operation finishes. If
there's nothing to be cancelled, the line will get deleted immediately
like before.

opw-2525010

closes odoo/odoo#78414

X-original-commit: 8c1f5dd711a074412b707d30ba3ff3f42945d8a0
Related: odoo/enterprise#21710
Signed-off-by: Raf Geens <raf-odoo@users.noreply.github.com>
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-10-14 21:25:05 +00:00
baa 6cd586d190 [FIX] base: missing Saudi Arabia in the gcc country group
closes odoo/odoo#78412

X-original-commit: 0a166956229544d9febe294c254cc578fd8b9f6e
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-14 19:18:48 +00:00
Bruno Boi cc3403ad47 [FIX] web: action context pollution from session storage
Before this commit
An action retrieved from the session storage may not take into account
changes in the user context because the user context is duplicated in
the action context. When the user context changes i.e. through the
switch company menu (allowed_company_ids) and the browser reloads,
the action service will make the action context concatening the new user
context with the context of the action stored in the session storage,
which has still values from the previous user context.

After this commit
The makeContext function can now take an initial evaluation context.
This is then used in the action service in order to make use of the user
context when the action context is generated but without appending
it into the action one.

closes odoo/odoo#78415

X-original-commit: 7354d1686915ec21437fc677f15a6c5409106492
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-14 18:15:13 +00:00
Sébastien Geelen (sge) fa92642d5c [FIX] web_editor: traceback when tab in table layout
When the editor was inside a table in the odoo view HTML,
The KeyDown detected that the selection was inside a table
and was trying to add a row bellow the table outside the editor.

task-2601451

closes odoo/odoo#78396

X-original-commit: d1ced1b5a6ad0099fbdcca2530e1e06034108755
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Sébastien Geelen <sebgeelen@users.noreply.github.com>
2021-10-14 16:16:09 +00:00
Bruno Zanotti (ADHOC)andJuan Jose Scarafia ab9f36db24 [IMP] l10n_cl: calculate removed latam fields
Adapt the module to calculate removed fields from latam localization

closes odoo/odoo#78296

X-original-commit: 9269ac23e86cfd0218234360ac8271785697a725
Signed-off-by: Josse Colpaert <jco@openerp.com>
Co-authored-by: Juan Jose Scarafia <jjs@adhoc.com.ar>
2021-10-14 16:16:04 +00:00
Bruno Zanotti (ADHOC)andJuan Jose Scarafia 33c7f7d437 [IMP] l10n_ar: calculate removed latam fields
Adapt the module to calculate removed fields from latam localization

X-original-commit: c9536ab129c96582a784efe6a5bce133cad0d650
Part-of: odoo/odoo#78296
Co-authored-by: Juan Jose Scarafia <jjs@adhoc.com.ar>
2021-10-14 16:16:04 +00:00
Bruno Zanotti (ADHOC)andJuan Jose Scarafia ee7e20f49d [IMP] l10n_latam_invoice_document: remove fields
Fields removed:
 * l10n_latam_amount_untaxed
 * l10n_latam_tax_ids
 * l10n_latam_price_unit
 * l10n_latam_price_subtotal
 * l10n_latam_price_net

Methods removed:
 * compute_l10n_latam_prices_and_taxes
 * compute_l10n_latam_amount_and_taxes
 * _compute_invoice_taxes_by_group

We move the removed methods to l10n_ar and l10n_cl and now it returns
a dictionary with the removed fields as the keys.

X-original-commit: 667ffb286d27f1e7a834b15d8f61536e530acd6f
Part-of: odoo/odoo#78296
Co-authored-by: Juan Jose Scarafia <jjs@adhoc.com.ar>
2021-10-14 16:16:04 +00:00
Hubert Van de Walle (huvw) 7fd7ac1f31 [FIX] base: Allow empty thousands separator in reports
Steps to follow

  - Set the thousands_sep of the current lang to an empty string or null
  - Create a report
  -> The thousand separator from the system locale will be used instead to format numbers

Solution

  Use an empty string if there is no thousands separator

opw-2507441

closes odoo/odoo#78384

X-original-commit: 767adf94c3162c1d93d93aa638200f73123f4ab6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
2021-10-14 15:08:51 +00:00
Dhwani Patelandjpr-odoo 4aacc0edb8 [IMP] website_forum: rename the title of question page
This commit changes the title of new question page from 'new_question' to
'New Post'.

task-2167561

closes odoo/odoo#45352

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: jpr-odoo <jpr@openerp.com>
2021-10-14 12:26:09 +00:00
Dhwani Patelandjpr-odoo d69c49349b [IMP] website_forum: improve the flagging question UX
Now, once the question is flagged, we show two options for it: 'Validate' and
'Mark as Offensive'.
So, one can directly validate (or not) directly from the question page.

task-2167561

Part-of: odoo/odoo#45352
Co-authored-by: jpr-odoo <jpr@openerp.com>
2021-10-14 12:26:09 +00:00
Dhwani Patelandjpr-odoo 7223f0e720 [IMP] website_forum: tooltip based on condition
This commit display the tooltip "only one answer per question is allowed" only
for question-answer type of forum.

task-2167561

Part-of: odoo/odoo#45352
Co-authored-by: jpr-odoo <jpr@openerp.com>
2021-10-14 12:26:09 +00:00
Mohammed Shekha 683f29add1 [FIX] web: No results to show item was not displayed in m2o
before this commit: when m2o has can_create=false and user try to search
something that doesn't exist then it should show 'No results to show' in m2o
autocomplete, because of commit: https://github.com/odoo/odoo/commit/4f116a0f9be26b91d95e019cda1aa620faf6d620
this has been broken.

after this commit: if user can not create m2o record and if user searches that
doesn't exist in m2o model then it will display 'No results to show'

task-2376435

closes odoo/odoo#78329

X-original-commit: a9e14acc3785c972bd037a8d4ca303c10dad265a
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-10-14 11:16:47 +00:00
Martin Trigaux 83530dabc7 [I18N] mass_mailing_{slides,event_track}: publish module on Transifex
Not much content but still to be translated

closes odoo/odoo#78259

X-original-commit: aba5e3877cfab96493fcfd073c101b4447f49a51
Related: odoo/enterprise#21643
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-10-14 09:28:09 +00:00
Martin Trigaux b588a9caae [FIX] mass_mailing: avoid Expected singleton error
When writing on more than one record (e.g. via
_process_mass_mailing_queue cron)

X-original-commit: b18614bf99df47de77650f431e2062b8d2eacd06
Part-of: odoo/odoo#78259
2021-10-14 09:28:08 +00:00
Martin Trigaux c5db9e8aac [FIX] pos_coupon: translate fallback
Translatable expressions need to be in an xml tag, not inline

X-original-commit: 65584e569fdf59978c0579de9936fc15a90956e1
Part-of: odoo/odoo#78259
2021-10-14 09:28:07 +00:00
Martin Trigaux 8ee1690bb7 [FIX] point_of_sale: avoid division by 0
When the quantity of a product is 0

X-original-commit: b824e0416bbdd65bac397f2c7fe3c03ac0e9ad16
Part-of: odoo/odoo#78259
2021-10-14 09:28:06 +00:00
Martin Trigaux 22856f1eb3 [FIX] point_of_sale: translate the product information
The uom and products names were untranslated

X-original-commit: 9ecbbcf4d38d477acde602bd32031f6729af5cd1
Part-of: odoo/odoo#78259
2021-10-14 09:28:06 +00:00
Martin Trigaux aa85e610dd [FIX] web: translate search_pannel options
Before this commit, the list of categories on the left, in the
ir.module.module kanban view, was untranslated

X-original-commit: d5feb987c523a3e188e87c181fe5aed7d03fabe3
Part-of: odoo/odoo#78259
2021-10-14 09:28:04 +00:00
Martin Trigaux 3a63b7fcfa [FIX] product: translate report
Introduced at d1dda79c2f

X-original-commit: dd6ad3977fda268b17edcc906c7825e85c8bbc56
Part-of: odoo/odoo#78259
2021-10-14 09:28:04 +00:00
yhu-odoo 7d3221c465 [FIX] repair: search location with company_id
When find a location_id for repair.line, we didn't restrict the location
to have same company_id with the repair.order. Add it.

closes odoo/odoo#78350

X-original-commit: dff911a1b006a542bf9b082c76910a2d8346fef1
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-14 08:13:04 +00:00
svs-odoo cdcdcd882a [FIX] product_expiry: lot expiration_date
This commit adresses to two issues:

Since 0c83542a93dde8dcaead04fadb7db95cf627a8b4, the move line's `expiration_date`
set by the user is always overrided at the creation of the move which
means the user has to modify it after the move was created.

To fix that, the compute doesn't override the `expiration_date` if there
is already one set.
Therefore, the onchange on the product who was removed is re-added to
force to recompute the `expiration_date` if the move line's product is
changed and it has already an `expiration_date` set.

closes odoo/odoo#78189

X-original-commit: db2881c4b6dc02b68ad61c1be8464d874f9115db
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
2021-10-14 08:12:43 +00:00
svs-odoo 714f2b49ce [FIX] stock: avoid attempt to create the same lot
How to reproduce:
  - Create a product tracked by lot;
  - Create two receipts for this product;
  - Use the same lot name in the two receipts;
  - Try to validate the two receipts in the same time
    => `ValidationError` will trigger in the `_check_unique_lot`
        constrain of the production lot.

task-2646107

X-original-commit: cf018e9f215336ef19e0a517d4e116f0da26850e
Part-of: odoo/odoo#78189
2021-10-14 08:12:43 +00:00
Josse Colpaert f0b3250945 [FIX] l10n_pe: demo data should have correct invoice names
closes odoo/odoo#78352

X-original-commit: a35cd6a33cd27b13f8472f898f2a0eba0f7c6932
Related: odoo/enterprise#21683
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-13 23:33:44 +00:00
Daniel Blanco 01b27d593d [ADD] cla signature Hector Aular
closes odoo/odoo#78348

X-original-commit: 801463d905f854172bd3b323e8bf2e0c20f8ce2a
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-13 22:10:30 +00:00
Romeo Fragomeli 945ffb2d25 [FIX] web: avoid bad positioning for BlockUI on mobile
On mobile, since the commit [1], the BlockUI is not aligned with the
viewport due to its absolute position.

This commit restores the previous value ("fixed").

Steps to reproduce:
* Open Odoo
* Go to Apps
* Scroll a bit the page
* Install one App => BUG

Ref:
[1] odoo/odoo@0573acae23

closes odoo/odoo#78344

X-original-commit: 04db62a45f42aba72da7d36b94b3c5d03db37e20
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2021-10-13 19:32:33 +00:00
Yoshi Tashiro b37c212f7f [FIX] stock: allow creating a scrap with more than 2 decimals in qty
scrap_qty field was missing the digits attribute, and therefore the user
could not create a scrap with a quantity with more than two decimal places.
With this commit, scrap_qty will follow the 'Product Unit of Measure'
precision setting, just like any other quantity fields.

closes odoo/odoo#78338

X-original-commit: d9ed98f56e00f38cb3fd87bc9b7cad981a1c4400
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-13 18:24:52 +00:00
Mohammed Shekha 895498c616 [FIX] mail: pass default_activity_type_id in context
Before this commit: when creating scheduled activity from activity cell
activity type was not passed in context due to which default activity type not
set, to produce: CRM -> Activity View -> Click on existing record of activity
view which will open popover -> click on Scehdule Activity button, this will
open scheduled activity form but it will not have default activity type.

After this commit: when clicking on Scehdule Activity button from activity
popover, default activity type will be passed in context.

task-2568793

closes odoo/odoo#78330

X-original-commit: 17cbafdd1ce4f5f095512677d5b3750e3a8dc889
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-10-13 18:24:47 +00:00
Raphael Collet 56660e39e6 [FIX] core: one2many linking non-existing lines
The processing of the LINK command in a one2many should fail when the
line being linked does not exist.  However, there is one case where it
should not fail: when that line existed and was linked before applying
the commands.  That use-case may seem strange, but it actually exists:
deleting a line in a sales order automatically deletes the corresponding
reward lines.

closes odoo/odoo#78318

X-original-commit: 4bfe1b5cab10d3171d386d76799a7d7729f49154
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-13 18:24:42 +00:00
william-andre 8bbc6e7811 [FIX] account: forward port of 4c06b3c1180048b1c0db5067adf0c0bef5c02785
The method name is private since
d9287caf94

closes odoo/odoo#78317

X-original-commit: cb9ca92ae54abb707725097eecda5b12c4ad189f
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-13 18:24:37 +00:00
Romain Derie e2628d2dad [FIX] website_sale: restore the block ui loading on pay now click
The cart UX was improved with [1] at payment step by adding a block ui when the
user had clicked on "Pay now".
Indeed, that step could take some (long) time, and preventing the user to click
on anything would limit the possible issues: changing a delivery, a payment
provider or anything.
Also, it would be even clearer to the user that something is being processed,
even if the Pay now button was already spinning.

The payment refactoring [2] did not correctly adapt that behavior.
This commit restores it.

[1]: https://github.com/odoo/odoo/commit/eb3ed89f8440050fc32f9a7b29fb2b6ab8fd6b59
[2]: https://github.com/odoo/odoo/commit/573ed74c121c1572b3fab6f9553ed7f93f7b3f99

task-2659450

closes odoo/odoo#78307

X-original-commit: b2a66370a9b6f37ae7177d40b7d43b82fb83cc8b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-10-13 18:24:32 +00:00
Andrea Grazioso (agr-odoo) 0744aaf6f7 [FIX] point_of_sale: cogs entries wrong currency conversion
1) Have Accounting and POS.
2) Activate multi-currencies (EUR and USD available).
3) Main currency should be USD, set a rate to EUR (i.e. 0.5).
4) Activate automated inventory valuation [CATEG].
5) Create storable product [TEST]:
  - Storable, Category [CATEG]
  - with public price $10 and cost $1
  - available in POS
  - no taxes needed
6) Have a POS in EUR (Pricelists, Journal, Payment methods +
their journal in EUR).
7) Sell [TEST] (it costs ($10/2) = 5EUR)
8) Close the session and post entries.

Result: in the journal Items, some of the COGS entries (110300
Stock Interim (Delivered) and 600000 Expenses) are multiplied by
the ratio between $ and EUR. This occur because the system attempts to
convert an amount which has been created in company currency.

opw-2613739

closes odoo/odoo#78227

X-original-commit: 91d6a81fef551a03e6af94c356b7e943ef53c473
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-10-13 18:24:25 +00:00
Rémy Voet (ryv) b33983d532 [REF] stock*,mrp*: clean setUp vs setUpClass
In a lot of test class, we use `setUp` instead of
`setUpClass`. `setUp` is execute for each test method and `setUpClass`
will be execute only once by Class (and use savepoint + rollback).

Then change setUp into setUpClass reduce the time to make all tests
and avoid to repeat this error for the future.

closes odoo/odoo#78082

Related: odoo/enterprise#21563
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-13 18:24:16 +00:00
Yenthe Van Ginneken c3f593db78 [FIX] account: allow overriding portal domain
Before this commit the only way to modify the domain is to completely override portal_my_invoices.
Since this function is so big this is not clean/easy to do.
By creating a separate function we can simply override it and we can reuse the function on two places.

closes odoo/odoo#77446

X-original-commit: b7effc442cd7ff47e00718adf5b1af43e9f326ee
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
2021-10-13 18:24:02 +00:00
Nicolas (vin) 66b721236c [IMP] account: Log changes on bank statements
With bank synchronization, having information about changes done by
the user on the bank statements can be useful when looking into issues.

We'll now log changes in the starting/ending balance as well as the
state of the statement to keep better track of what is happening on
the statements.

Task id #2647224

closes odoo/odoo#78264

X-original-commit: 3f2379347dae2482669aded034f3a5249aececa5
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-10-13 16:33:57 +00:00
baa dfd75f39f8 [FIX] l10n_ae: missing if statement to avoid executing UAE related code when COA is not UAE
closes odoo/odoo#78303

X-original-commit: db21ea740a49dd98004bd75ad9fc7412e5686c0e
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-10-13 15:23:01 +00:00
Kevin Baptiste 5437dbf5dc [FIX] hr: fix avatar generation on employee rename
It was not possible to rename an employee with an existing image
profile, as it was trying to assign the size of the avatar (coming from
the webclient) as the avatar itself.

closes odoo/odoo#78299

Taskid: 2660773
X-original-commit: 425ddb217664ba3fdae9e8c1527317fee0fe9368
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-13 15:22:56 +00:00
Bruno Boi b710b6d323 [FIX] web: missing test for usePosition hook
The commit a27bbda37f1ad4 did not add a unit test.

Here it is.

closes odoo/odoo#78297

X-original-commit: e3a32191b6b9411abaf4c15550e537c666d615bd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-13 12:31:02 +00:00
William Braeckman 7529e4a15d [FIX] hr_holidays: fix displaying negative allocations
When the attendance app is installed and the extra hours option is
enabled, it could happend that we have an allocation with negative
virtual_remaining_leaves, however it does not make sense to display it
to the user.
This commit filters out that possibility from showing on the dashboard.
This commit also fixes a display mismatch between extra hours and other
time off types.

TaskId-2655689

closes odoo/odoo#78295

X-original-commit: c943b55237447ad58a994602e58702c952ac019d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
2021-10-13 12:30:57 +00:00
ijas ahammed 4542e1f540 [FIX] website_crm_partner_assign: removes traceback while opening opportunity
While we try to open an opportunity from front-end page it will throws a
traceback. In this commit we have fixed the traceback, the traceback occured
because while rendering the template `portal_my_opportunity` we were using
an invalid field `res_model_id` for searching the corresponding model activity
types, in this verssion we have `res_model` field instead of `res_model_id` thus
we have updated this field instead of using the invalid field which doesnt
exist.

TaskID-2443894

closes odoo/odoo#78288

X-original-commit: 25d5d7bbfbe4ce054ebd3494a04e028498dbd441
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-13 11:18:50 +00:00
qsm-odoo 05765de195 [FIX] website: properly re-show the header when scrolling to the top
Sometimes, when using the "standard affixed" header effect, when
scrolling to the top, the header was kept hidden and left a blank space.

This happened in fact systematically when scrolling to the top very
fast. Indeed, in that case, the code went through the header update
only once and was not able to go from state 3 (page scrolled header
visible) to state 1 (page not scrolled header visible) without going
through state 2 (page scrolled header invisible) and you thus ended
with a mix of state 1 and 2: page not scrolled and header invisible).

Closes https://github.com/odoo/odoo/issues/71449

closes odoo/odoo#78268

X-original-commit: 20648ef2134672587c25fd3c7c79ed3825728b38
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-13 10:02:38 +00:00
Sébastien Mottet (oms) 667a00a029 [FIX] website: use base-1 as default palette for configurator
When using the configurator the user can upload its logo to
generate a color palette. In this case we select the base-1
palette as default palette instead of the theme's default palette.
Doing so avoids the potential customizations the theme palette
may introduces.

task-2665885

closes odoo/odoo#78251

X-original-commit: 50019c8f68b89968615f87c365095c94caeef46c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-13 08:41:06 +00:00
Bruno Boi e8bbc5cd44 [FIX] web: pivot style in right-to-left
Headers of columns and rows are not properly aligned on RTL direction.

After this commit, they will be.

closes odoo/odoo#78261

X-original-commit: 2fb992d3ced438fd012d7702bdfbe23cce6000a6
Related: odoo/enterprise#21645
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-13 06:03:58 +00:00
Bruno BoiandSam Degueldre 3594b8cebd [FIX] web: fix crash when dropdown is unmounted quickly
Previously, when quickly mounting then unmounting a dropdown, a
traceback was shown. This is because the usePosition hook registered
listeners that were throttled/debounced, which would be called after the
component was already unmounted, causing the crash.

This commit fixes that by making cancelable the debounce timing util
and by introducing a new cancelable timing util: throttleForAnimation.
`debounce` and `throttleForAnimation` could be canceled i.e. when
a component is unmounted.

`throttleForAnimation` is used to replace throttle to avoid the popper's
scroll position not staying perfectly in sync with the page but instead
being slightly jittery, it effectively throttles a given function to the
display's refresh rate.

Also, the `throttle` util is kept unmodified but marked as deprecated.
Its implementation does not properly match its name, and we chose
to leave it as is because some code might already use it.

X-original-commit: a27bbda37f1ad444023cb1aae56675ac6c263cb2
Part-of: odoo/odoo#78261
Co-authored-by: Sam Degueldre <sad@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-13 06:03:58 +00:00
Bruno Boi 44c6946c7c [FIX] web: dropdown menus should not overflow viewport
Before this commit:
Dropdowns menus were overriding the positioning hook direction flip
order in order to always stay in the same axis.
But a dropdown menu has as its maximum height 70% of the viewport.
These two "rules" aren't enough to ensure the whole spectrum of
possibilities will always make the menus entirely visible on screen.
We could have chose a correctier formula (50vh - toggler height), but
this would have led to sadly short dropdown menus in many cases,
so we chose the following alternative...

After this commit:
Dropdown components are no longer overriding the positioning hook
direction flipping order option.
That way, the flipping axis is no longer enforced and therefore the
menus will have a greater spectrum of possibilities to reposition.
This has shown us that it fixes the visibility issue of the menus.
E.g. when the menu flips to a right-middle position it could take up to
100vh and still get displayed entirely.

The position hook directionFlipOrder option has also been made
unavailable as there is no use case anymore.

X-original-commit: b768d771018843d7bfa8aab2e1b2e624d088e3f6
Part-of: odoo/odoo#78261
2021-10-13 06:03:58 +00:00
Bruno Boi 9c0d5228d4 [REV] web: reintroduce mobile dropdown positioning
Revert "[FIX] web: dropdown: avoid positioning in mobile"
This reverts commit 1271ef80fafa4438271af0919dcca229aa20bf81.

Revert Reason:
A better alternative fix to the original
issue has been found. See preceding commit.

X-original-commit: 384169fb1b5874fd670f07fb2a6b1aca449f56c9
Part-of: odoo/odoo#78261
2021-10-13 06:03:57 +00:00
Bruno Boi 97f90b03cf [FIX] web: usePosition computations on small screens
To compute a positioning, the usePosition hook uses as the default container
the <html/> element... but in the positioning computations it is assumed
that the container is scrollable which is not the case for small screens
when web_enterprise module is installed, as its webclient_layout.scss
applies rules to make sure only the main content is scrollable.

When the <html/> element is not scrollable, it can be scrolled out of the
viewport, which is problematic as the positioning computations are based
on a fixed positionment strategy.

The way we chose to fix this is to account the scrollTop position of the
container only if the container is the <html/> node.
If so, further computations will now take into account the amount of
scrolling the <html/> node has, and thus will be correct.

See https://developer.mozilla.org/docs/Web/API/Element/scrollTop fur
further understanding.

X-original-commit: a050094cdaa5dd6b76c3f10fb49d3a9c0813425a
Part-of: odoo/odoo#78261
2021-10-13 06:03:57 +00:00
Bruno Boi 2bd8bb4d7b [FIX] web: align pivot row groupby menus to right
The row groupby menus are always aligned on the left, but when a
multiple levels of groupby has been selected, it feels weird and
counterintuitive to see them aligned on the left whereas the row
labels are right aligned.

This commit makes sure that the alignment is coherent between the menu
and the row labels.

X-original-commit: b11b760365c45409b8ea10dee2a58c2e677e9d61
Part-of: odoo/odoo#78261
2021-10-13 06:03:57 +00:00
JF Aubert 92049fc165 [FIX] mrp,mrp_workorder: Fix (+) generate serial number button
The generate serial number button uses the stock.lot.serial sequence by default
(default value for name of stock.production.lot)
Serial Mass Produce (and other parts) allow to generate serial numbers
starting from a user supplied initial value.
This fix makes the button generate the next serial number
according to the last generated.

task 2647238

closes odoo/odoo#78258

X-original-commit: b80259dff3aaafb9d11af9d936f5106bdf5ed781
Related: odoo/enterprise#21641
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Jean-François Aubert <ajf-odoo@users.noreply.github.com>
2021-10-13 06:03:37 +00:00
Didier (did) 2e2b49931f [FIX] mail: add the ability to invite on mobile
Before this commit, it was impossible for a user to invite people to a channel
or a group DM.
This commit add the invite button on the chat windows header only on mobile.

Part of task-2634175

closes odoo/odoo#78267

X-original-commit: 56ab9ffea28dd5f22a74ba269cbd5552c42953e3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-12 19:17:43 +00:00