Commit Graph
148233 Commits
Author SHA1 Message Date
Yannick Tivisse ee3bf990d9 [IMP] sale_product_configurator: Make module auto_install
Part-of: odoo/odoo#82999
2022-02-08 14:53:37 +00:00
Yannick Tivisse c1616b94e6 [IMP] account: Improve frenglish terms in configuration
Part-of: odoo/odoo#82999
2022-02-08 14:53:37 +00:00
Yannick Tivisse 04ff385290 [IMP] website_jitsi: Move domain configuration from website to event
Part-of: odoo/odoo#82999
2022-02-08 14:53:37 +00:00
Yannick Tivisse fd6bc0cb61 [IMP] base: avoid ormcache clear when setting ir.default to the same value
Purpose
=======

On the res.config.settings model for example, calling execute without
having changed a single parameter will make several writes on
ir.default records.

However, even if the written and the current values are the same,
the cache will be invalidated several times.

Part-of: odoo/odoo#82999
2022-02-08 14:53:37 +00:00
Yannick Tivisse f448b3314e [IMP] all: Improve res.config perf on method execute
Purpose
=======

Several actions are done even if nothing has changed on the configuration.

Example:
Writing on a cron the same value makes a dummy write-lock on the table
...

Part-of: odoo/odoo#82999
2022-02-08 14:53:36 +00:00
Odoo's Mergebot 57e15bc039 [REF] web, *: icons review
PURPOSE
Review how current icons are used, introduce v16 icons.

SPECIFICATIONS
Reduce fontAwesome's footprint by removing legacy font-files and discontinued classes from the library CSS.
Introduce new icons for v16.
Part of v16 overall restyle (task-2704984).

task-2745275

Enterprise:
- https://github.com/odoo/enterprise/pull/23848

Documentation:
- https://github.com/odoo/documentation/pull/1462

closes odoo/odoo#83501

Related: odoo/enterprise#23848
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-08 13:05:56 +01:00
stefanorigano (SRI) 4e53953756 [REF] web, mail: apply odoo icons
This commit is part of v16 overall restyle (task-2704984).

enterprise: https://github.com/odoo/enterprise/pull/23848
task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:55 +00:00
stefanorigano (SRI) 546477dafa [ADD] web: .oi, odoo ui icons
This commit introduces our own icons meant to be extended over time and
to coexist with FontAwesome 4.7.

The goal is to provide a wider range of icons specifically made for our
UI and cover FontAwesome's lack of iconography for specific businesses
and functionalities.

Classes' names are available in our documentation website and the SVG
source files can be found in our `design-assets` repo.

This new bundle mirrors fontAwesome architecture; icons are rendered
applying classes to standard HTML flow-tags (normally an `<i>`), eg:

`<i class="oi oi-odoo"/>`

This implementation applies size and alignment rules directly to the
`:before` pseudo-element rather than to the class itself. The aim is to
prevent misalignment when icon classes are applied to buttons and other
UI elements, eg:

`<button class="btn btn-success oi oi-arrow--right"/>`

Note: Despite being technically feasible, this approach is highly
discouraged and should be avoided.

This commit also introduces utility-classes specifically made for
our UI. In detail:

- Fours sizes: '.oi-small', '.oi-normal', '.oi-large', '.oi-larger'

  Relative to the parent font-size, these classes cover a range from
  `0.8em` to `1.77em`. Each size has been designed to match our default
  text-fonts in the attempt to compensate font-icons common alignment
  issues (https://css-tricks.com/icon-fonts-vs-svg/#aa-positioning ).

- Responsive classes: `.oi-[screen]-[icon_size]`

  Responsive classes mirror Bootstrap ones and can be combined to
  achieve different size results at specific resolutions, eg:

  `<i class="oi oi-studio oi-larger oi-md-normal oi-lg-small"/>`

- Fixed width: '.oi-fw'

  Mirrors FontAwesome 'fa-fw' by setting icons at a fixed width.
  Our implementation adapts according to size and responsive classes.

- Animations: '.oi-spin', '.oi-pulse'

  Mirrors FontAwesome default animations.

This commit is part of v16 overall restyle (task-2704984).

enterprise: https://github.com/odoo/enterprise/pull/23848
task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:55 +00:00
stefanorigano (SRI) 04f74c0d7f [REF] web: optimize font-awesome
This commit reduces fontAwesome footprint by removing legacy font-files
(~750kb). It keeps WOFF(s) formats for browsers and TTF format for PDF
and ICON to PNG generations.

TTF format has been removed from the CSS [@]fontface rule, but it's
still called directly in python when needed[1].

This commit reviews the CSS too, removing obsolete vendor-prefix rules
and discontinued fontAwesome classes.

Part of v16 overall restyle (task-2704984).

task-2745275

[1] https://github.com/odoo/odoo/blob/15.0/addons/web_editor/controllers/main.py#L45

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00
stefanorigano (SRI) 0f64e506f2 [MOV] web, * : move font-awesome library in an editable location
This commit "forks" fontAwesome into `src/libs` in order to allow
further customization.
Part of v16 overall restyle (task-2704984).

task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00
stefanorigano (SRI) 4a5dbf6a57 [FIX] web, *: float utility-classes
'pull-[left/right]' classes are discontinued since Bootstrap v3 [1].
The reason why we never noticed is that we were unknowingly
relying on fontAwesome utility classes that are basically the same.

Since v3 we were supposed to use 'float-[left/right]' classes [2], but
these classes will be renamed again in v5 with 'float-[start/end]'[3].

This commit introduces "v5 ready" utility-classes and replaces v2 legacy
occurrences across the UI.
These classes definitions can be safely removed when v5 migration will
be completed.

Notes:
- this commit will *not* adapt frontend occurrences since its CSS
  already relies on a "migration table" [4]. 
- this commit will *not* adapt the few v3 'float-[left/right]'
  occurrences since are supposed to be handled in the v5 migration
  task (task-2704984).

This commit is part of v16 overall restyle (task-2704984).

enterprise: https://github.com/odoo/enterprise/pull/23848
task-2745275

[1] https://getbootstrap.com/docs/4.3/migration/#utilities
[2] https://getbootstrap.com/docs/4.3/utilities/float/#classes
[3] https://getbootstrap.com/docs/5.1/utilities/float/#overview
[4] https://github.com/odoo/odoo/blob/15.0/addons/website/static/src/scss/compatibility/bs3_for_12_0.scss#L49

Part-of: odoo/odoo#83501
2022-02-08 12:05:53 +00:00
Yannick Tivisse e98e7d762b [IMP] note: Allow company specific notes
Purpose
=======

Allow to restrict note to users having access to a specific company

For example, when creating a new company, it create a "Useful Links" note
that is used on the payroll dashboard (With granted access to payroll officers
who belongs to this company).

This note should be restricted to people having access to the company,
and shouldn't be mixed all the time for people having multi company accesses.

closes odoo/odoo#84155

Related: odoo/enterprise#24128
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-08 11:08:05 +00:00
Thomas Beckers e92087e8f1 [FIX] Remove the context to disable prediction when importing invoices
Allow the bill prediction when data like facturx is imported.
This revert #68311 stating prediction might cause traceback when no account_id is found.
Now, this error seems to not occur anymore.
When importing data like facturx and no account_id is predicted, the default account set on the
vendor journal will be set.

opw-2662158

closes odoo/odoo#84092

X-original-commit: 1acece31eaf1417dea6ed330ac25c3b8de162baf
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-08 11:07:54 +00:00
Victor Feyens a2991e458c [IMP] base: prefetch actions models in batch during /web menus loading
Gain of ~80% of the SQL queries & ~50% of execution time in a database
with test_main_flows & dependencies installed.

On a benchmark of 100 calls of (load_menus(True) + load_menus(False))

* 266 > 56 queries
* 0.38 > 0.21 sec of execution (mean)

Note that this only impacts the first request since this method is cached.
Unless user groups (or debug status) are different, the cached results
are returned.

closes odoo/odoo#83172

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-08 11:07:50 +00:00
Victor Feyens d369c1304f [REM] sale: redefined field from auth_signup
without any change

closes odoo/odoo#83104

Related: odoo/enterprise#23626
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-08 11:07:46 +00:00
Victor Feyens 65baadeb75 [IMP] core: do not try to translate selection values for nothing
When we are only trying to know accepted raw values, there is no
need to fetch the translations for the description part of the
selection tuples.

This performance problem was first observed on res.config.settings
record creation, where the values are pruned to avoid writes and
invalidation for unmodified related values (cf create override
in base/models/res_config.py & 5a4e7b711e).

After more analysis, the 'problem' also impacts record updates on
any related field (readonly or not).

* Res.config.settings performance gains:

In a database with test_main_flows (& its diverse dependencies),
this reduces by ~50% the number of queries done when triggering
the creation of res.config.settings record through the interface
(aka with all the related updatable fields receiving their current
value as create value).

For the creation of 150 res.config.settings records, with full cache
invalidation between each record creation, we notice a gain of:

* 11853 to 6303 total queries
* 11.2s to 7.5s total creation time

Part-of: odoo/odoo#83104
2022-02-08 11:07:46 +00:00
Victor Feyens 856c1691c7 [IMP] core: improve test coverage of selection fields
Part-of: odoo/odoo#83104
2022-02-08 11:07:46 +00:00
Victor Feyens 3d9efc7b5c [IMP] base: clean modules installation logic
* batch module data prefetch in res.config.settings flows.
* manipulate ir.module.module records instead of a strange list of tuples
* Only keep the missing module names logic where useful (useless for the
res.config.settings scope, modules must exists to be referenced by
a settings field).
* drop the support of module fields of type selection, they are not used anymore,
it's not even sure they still work and this feature doesn't bring much added value anyway.

Part-of: odoo/odoo#83104
2022-02-08 11:07:45 +00:00
Benoit Socias 63114f138d [FIX] website: require palette to be closed before showing options steps
Before this commit the target of options and nested options tour steps
could be hidden under an opened palette.

After this commit the tips of options and nested options tour steps
require that no palette is opened.
An 'allowPalette' parameter can be used to remove this condition, for
example if 'changeOption' is used to select an option within the
palette during a test tour.
A step is added to close the color palette - which, while opened,
prevents the next `changeOption` step from being activated.

task-2728994 (was task-2675252)

closes odoo/odoo#84093

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-08 10:04:09 +00:00
Victor Feyens 9a0bf4785d [IMP] base: display query counts on profiling records
closes odoo/odoo#83746

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-02-08 10:03:59 +00:00
Merlin (megu) c1aae31127 [FIX] stock: remove products not present in the package
Delivery slip packages contains products not present in the package

Steps to reproduce:
1. Install Sales and Inventory
2. Go to Settings > Inventory > Operations and enable Packages
3. Create and confirm a sale order with product A, B and C
4. Click on the delivery smart button and create and assign different packages for products A and B
5. Set done quantities for products A and B
6. Validate the delivery with no backorder
7. Click on Print > Delivery Slip
8. Product C is in both packages

Solution:
Don't print empty moves when packages are used

Problem:
`_get_aggregated_product_quantities` returns all move lines related to a certain `stock.picking`, even the empty ones
It is called for each package so the same empty lines will be displayed for all packages

OPW-2727659

closes odoo/odoo#84138

X-original-commit: 1b39e170537d48a29a0dda06776cfacef41b9c8f
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-02-08 09:06:29 +00:00
Antoine Guenet 3b7a9671fd [FIX] web_editor: ensure fontawesome icons displayed on buttons
The undo-redo buttons on top of the snippets menu of mass_mailing had no
icon when website was not installed. This was because there was css
forcing the font family to something other than fontawesome. This
ensures we don't do that for elements with the "fa" class.

task-2746002

closes odoo/odoo#84126

X-original-commit: b3a91899cd7e6772a241badfc0bd9699bb6e0e74
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-08 07:20:06 +00:00
Christophe Simonis beb6a719bc [FIX] core: do not translate html attributes without actual content
The issue has been introduced by 1fe4b0cc1981382cc3d944ec44276f0aee90945d.

A simple example is an element with attribute "string" like

    <field name="foo" string=" "/>

When the translation process is parsing the value of the attribute as
some HTML fragment html.from_string(" "), it raises an exception.  This
was not a problem before the commit above, but it now is.  For instance,
updating the view "event.view_event_form" triggers the error.

closes odoo/odoo#84144

X-original-commit: 5ffc1704162d8918985964b08f4b2b49e6054958
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-02-08 00:07:26 +00:00
qsm-odoo 43ccc78554 [FIX] website: update modal scrolling behavior after image loading
With commit [1] (and the parent commit here which reviews it), we
move the scrollbar to the modal instead of the website content if the
modal has scrollable content even in the case there is no backdrop. An
exemple would be the cookie bar, configured in popup mode, with a tall
content inside.

This was however not enough: the computation which determines if the
modal should be scrollable or not was not re-done after an image was
loaded. So if the popup was around the height of the window, it could be
smaller than the window's height before images loading and taller after
which would result in having the scrollbar on the body instead of the
scrollable popup.

[1]: https://github.com/odoo/odoo/commit/8f1dd6d6087ad8252d6e7b22d13aad2c4a3f19c6

closes odoo/odoo#84139

X-original-commit: b83b465dd98345afeca3844a4796e4a83d15f72b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-08 00:07:22 +00:00
qsm-odoo a0ddaa8931 [FIX] website, *: restore unconventional dialogs opening + review scroll
*: web_editor

Commit [1] was not coded defensively enough: after it, dialogs not using
a proper bootstrap structure triggered a traceback once they were opened
(this was discovered on odoo.com where such unconventional dialogs do
exist). Bad luck: there was actually a check to allow unconventional
dialogs but it was not done at the right location.

However, fixing this, it was found that more than this was not ok. There
is actually no need to consider the modal-content element at all. Just
using our `hasScrollableContent` method is enough and requires no extra
search in the DOM. This actually also properly computes if the modal
overflows or not while it was not the case before as it did not consider
the modal-dialog element's paddings.

Finally, the whole customized behavior of the modal scrollbar here was
only designed to affect our Odoo modals with the s_popup_no_backdrop
class (see original commit [2]). Indeed, only in that case we want to be
able to switch between body scrolling and modal scrolling while the
modal is opened. In custom cases and other Odoo cases, we want the
standard Boostrap behavior of only being able to interact with the modal
while opened. This commit cleans the code to restore that spirit
(hopefully this does not cause stability issues as [1] was introduced
only a week ago). Sorry for any inconvenience.

[1]: https://github.com/odoo/odoo/commit/8f1dd6d6087ad8252d6e7b22d13aad2c4a3f19c6
[2]: https://github.com/odoo/odoo/commit/e5a5f98819b3a70b3e2564fb91722cab415ceea9

X-original-commit: a2363337355ccf4363249657000cd85bfcb3ab4e
Part-of: odoo/odoo#84139
2022-02-08 00:07:22 +00:00
Benoit Socias e9b3671a7b [FIX] website_event: not consume non-displayed tour step
This commit adds the 'consumeVisibleOnly: true' marker on the "+New"
step of the website_event tour, and requires the "new content menu" to
not be opened.

This is a part of [1] but for a tour that did not exist in 14.0.

[1]: https://github.com/odoo/odoo/commit/0fa40e37e596798665a098ee999f49749b6012a2

task-2728994 (was task-2675252)

closes odoo/odoo#84137

X-original-commit: 9c6d5c038a6d3888a329d2140169e52389b3b5c8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-07 23:11:51 +00:00
Benoit Socias 58a3fca917 [FIX] website: fix typo in configurator tour selector
Since [1] there was a typo in a configurator tour selector.

After this commit the typo is fixed.

[1]: https://github.com/odoo/odoo/commit/e8a5af2e28a4724f86783746706cb59175f086bf

task-2728994 (was task-2675252)

X-original-commit: 3435236ac4c76e97705ac5634382f8b9ca1a6f5e
Part-of: odoo/odoo#84137
2022-02-07 23:11:50 +00:00
Sébastien Theys cff09308cd [IMP] mail: rename composer view "hasFocus" to "isFocused"
Consistency in naming with other models.

Part of task-2694206, split from main PR to ease its diff

closes odoo/odoo#84130

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-07 19:04:03 +00:00
Benoit Socias 96d2016cf6 [FIX] web, website: allow scrolling when only cookies bar remains
Since [1] when web was migrated to OWL, the cookies bar was considered
as a parent modal of any openend modal that got closed - thus preventing
scrolling the full page.

After this commit the cookies bar in the front end is not considered as
a remaining modal anymore, and therefore does not prevent scrolling on
the currently displayed website page.

[1]: https://github.com/odoo/odoo/commit/29731b404fe624b733d784cd4321113d6b0d27b7

task-2741894

closes odoo/odoo#84128

X-original-commit: c1aab97e6b4e8b916c7d79db5f278c746fd6b119
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-07 19:04:00 +00:00
Sébastien Theys 2d5a144898 [IMP] mail: rename newItem/itemNew to addingItem
Consistency in naming. Remove CSS as a bonus.

Part of task-2694206, split from main PR to ease its diff

closes odoo/odoo#84127

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-07 19:03:56 +00:00
Yannick Tivisse 67713706b5 [IMP] note: Allow name edition on notes
closes odoo/odoo#83836

Related: odoo/enterprise#23928
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-07 19:03:43 +00:00
William Braeckman 9e3b9317a1 [IMP] hr_contract: Improve demo data for payroll dashboard
Part-of: odoo/odoo#83836
2022-02-07 19:03:42 +00:00
Victor Feyens 64101c8d15 [FIX] sale: update_prices logic
The field show_update_pricelist, readonly, is not provided
to the server by the webclient, and therefore not updated on
new sale orders.

This fixes this problem and also reduces the recomputation by removing
the useless dependency on 'order_line' field.  The compute should
only be triggered on 'pricelist_id' field updates.

closes odoo/odoo#84105

X-original-commit: 365df4b1ed08f553397eab9619d369867162ed89
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-07 17:16:02 +00:00
Victor Feyens cf0d1eb80a [FIX] sale: compute the expected date based on the order state
The state of sale order lines is strictly related to the order state,
it's unnecessary to read the information line by line (and fetch/compute it)
when we already have it on the current order record.

X-original-commit: 660eaccbb417938bff0ffd8bd6a03aa1c42ce877
Part-of: odoo/odoo#84105
2022-02-07 17:16:02 +00:00
Victor Feyens 4d04ac2056 [FIX] sale: remove dumb onchange logic
Do not update the commitment_date everytime the expected date is
modified, otherwise there is no meaning to have two fields...

Furthermore, it seems that this onchange causes a performance loss
on SO/SOL updates, forcing the whole SOL data to be returned along
the SO data during the SO onchange.

Therefore removing this onchange improves the performance of SOL updates
and consequently the final save of the record by reducing the data wrongly
considered modified and given to the create/write call.

X-original-commit: 116ca30b2f5f27f8959961c786b88fdcec36338a
Part-of: odoo/odoo#84105
2022-02-07 17:16:02 +00:00
Nasreddin Boulif (bon) 2ca5fdcaac [FIX] web_editor: resize favicon preview image
Steps to reproduce:

  - Install Website
  - Go to Settings -> Website
  - Replace favicon with a 'big' image
  - Go to Website and edit any page
  - Click on Home

Issue:

  Favicon preview in popover is too big.

Solution:

  Set a max height/width for favicon preview (16x16).

opw-2744522

closes odoo/odoo#84101

X-original-commit: bb90ff7f320f815310ca8e76d19bccadf4204cc2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-02-07 17:15:52 +00:00
Victor Feyens bbcac30342 [FIX] payment,sale(_*): typos
closes odoo/odoo#84094

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-07 16:22:54 +00:00
Adrien Widart 31f29e5742 [FIX] purchase_stock: remove useless qty conversion in report
To reproduce the issue:
1. In Settings, enable "Units of Measure"
2. Create a product P:
    - Type: Storable
    - Unit of Measure: Units
    - Purchase UoM: Dozens
3. Create a PO with 1 (Dozens) x P
4. Open the Forecasted Report of P

Error: The value of "Requests for quotation" is 144, it should be 12.
The quantity has been converted twice.

OPW-2744195

closes odoo/odoo#84091

X-original-commit: 524a1c597fd409a488bb6af37aca8248727691c1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-07 15:25:07 +00:00
Sébastien Theys 96e355bcca [FIX] mail: prevent crash when destroying during attachment upload
File uploader might be deleted because it is linked to views, but the process of
upload should still happen for the related thread.

closes odoo/odoo#84085

X-original-commit: ddfcee8f35da4bcf16f258d1bdfd0cf08436d001
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-07 15:25:03 +00:00
Joseph Caburnay 30a92426e1 [FIX] point_of_sale: models[model].fields is no longer in pos
closes odoo/odoo#84084

X-original-commit: 4c77a117050539f1d9cd1759a055e3a4a65b0998
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-02-07 15:24:59 +00:00
Rémy Voet (ryv) 2904de7bac [FIX] website_event: add missing ir.model.access
There isn't `ir.model.access` on `event.event.ticket` for public and
portal users, but there is already the `ir.rule` to check the access.

In master, It causes an issue now, since https://github.com/odoo/odoo/pull/82896,
the `description` field of `event.event.ticket` isn't prefetch anymore
by the sudoed `event_registrations_open`
compute (that fill the cache with ticket data in sudo).
It crashes single app build:
https://runbot.odoo.com/runbot/build/12473674

We prefer to backport it in stable, there are maybe some corners where
it will raise an Exception and for sake of correctness.

closes odoo/odoo#84072

X-original-commit: d4f1be276d31215158b164f2f282afa8fa75f2b9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-07 15:24:54 +00:00
Victor Feyens 15440457b1 [IMP] sale: confirm demo orders in batch.
Minor setup performance improvement.

closes odoo/odoo#84055

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-07 15:24:50 +00:00
Victor Feyens 272d47868c [IMP] core: do not call create without values
Whenever a record is modified in a demo/data file,
create will still be called, but with an empty list of values.

This flow is correctly managed in the core orm code, but a lot of
custom logic in create overrides is triggered for nothing.

This commit makes sure that create is not called with an empty list
when there is no record to create (i.e. only records to update)
during files imports (including modules demo/data loading).

Part-of: odoo/odoo#84055
2022-02-07 15:24:49 +00:00
Victor Feyens e51537a430 [IMP] product: reduce forced cache invalidation & flushes
write call on product.template.attribute.line with an active value specified
will trigger cache invalidation & flush even if no record is specified in
the call.

_create_variant_ids is called on multiple places, including the unlink
of product.template.attribute.line records.  In this flow, self might
be an empty recordset, and there is no need to trigger early flushes and
cache invalidation if self is empty.

Part-of: odoo/odoo#84055
2022-02-07 15:24:49 +00:00
Audric Onockx (auon) 85268e1ae7 [FIX] hr_holidays : allow company leave second allocation
Steps :
Create a Leave Allocation :
	Mode : "By Company" (just to give it to every employee).
	Duration : 6 days
Create a Leave for 2 Employees A and B for week W.
Approve it.
Create a Leave for another Employee C for week W and next moday.

Issue:
Duration is 1. As a side effect, employee C still has 5 days left.

Cause:
At validation, requests with multpile employee create one leave per employee.
Then, a resource.calendar.leave is created fro eachone, including the firstone.
When creating the next request, _leave_intervals_batch looks for resource.calendar.leaves
with resource_id = C or False (which means several resources), that has been taken.
It finds the leaves taken by A and B, so it considers C is off too.

Fix:
We don't create a resource.calendar.leave for the multiple employee request.

opw:2739324

closes odoo/odoo#84078

X-original-commit: 4e3af83cdd455ae6cb82439d9e260c3f9ff0b564
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-07 14:18:18 +00:00
Goffin Simon b36e024cf1 [FIX] point_of_sale: Receipt not centered when printed
When printing the receip in the POS, the right margin was not equal to the left margin.
Introduce by https://github.com/odoo/odoo/pull/83130/commits/e14af37eb20453df8643b73f6007d6c986398b47

opw:2743902

closes odoo/odoo#83960

closes odoo/odoo#84077

X-original-commit: 26a55d017687190d7b45e3f6f86ba4fc86d81b71
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-02-07 14:18:14 +00:00
Adrien Widart 4911a26d2c [IMP] product: check barcode uniqueness
With GS1 nomenclature, products and packagins use the same pattern.
Therefore, we need to ensure the uniqueness between products' barcodes
and packagings' ones.

closes odoo/odoo#82883

Related: odoo/enterprise#23550
Related: odoo/upgrade#3180
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-07 14:18:00 +00:00
Adrien Widart 186537b90a [IMP] barcodes: remove size constraint on pattern
The size constraint on the barcode pattern is an old one and is no more
required. Moreover, if someone wants to add new GS1 patterns, he might
need more than 32 characters.

Part-of: odoo/odoo#82883
2022-02-07 14:18:00 +00:00
Adrien Widart cb8aded19a [FIX] barcodes_gs1_nomenclature: differentiate package and packaging
On Odoo, "package" and "packaging" do not represent the same thing. The
current terms are quite confusing

Part-of: odoo/odoo#82883
2022-02-07 14:17:59 +00:00
Victor Feyens 4d4108e3d1 [IMP] base: correctly prefetch currency fields on monetary updates
closes odoo/odoo#81423

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-07 14:17:50 +00:00