Commit Graph
147686 Commits
Author SHA1 Message Date
Miquel Raïch 70ae1cf628 [FIX] hr: avoid <footer> not found error in view
closes odoo/odoo#80554

X-original-commit: fc5ae487fc178d43c487271d174e27d060b56d1d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 11:17:15 +00:00
roen-odoo 341ad3f4dd [FIX] point_of_sale, pos_coupon, pos_hr, pos_restaurant : Check COA not used
Check COA parameter in the open_session_cb was actually never used

opw-2691615

closes odoo/odoo#80410

Related: odoo/enterprise#22522
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 11:17:11 +00:00
Sébastien Theys 8be118cf25 [FIX] mail: rename ambiguous get method in model manager
To ease debugging in general, avoid having multiple methods with the same name,
especially in the same file.

This is especially useful when the method name appears in a stack trace, for
example in the performance tool.

Part of task-2702450

closes odoo/odoo#81020

X-original-commit: c3673e63064c7f331754ef0e9d02cbbe7b1927f4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-08 10:23:55 +00:00
Sébastien Theys 560523e817 [FIX] mail: improve performance of listener removal
Avoid iterating over all listeners that are observing a field, instead store
the fields observed by a listener and access it immediately.

Part of task-2702450

closes odoo/odoo#81019

X-original-commit: bf69834b933c54598bbd82d8fbfcac4a0393c067
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-08 10:23:50 +00:00
Thibault Delavallée 03004aa95d [FIX] sale: do not force order responsible
With recent update to computed fields [1] order responsible is now always
changed to the partner responsible, or its commercial entity responsible.

This cause issues, notably with ACLs 'own documents only'. Indeed a salesperson
could update or set a partner on an order that would change the responsible and
lead to ACLs issues. Moreover some functional flows automatically set a partner
(online registrations, ...) that would make the responsible change without a
clear notification or warning.

We prefer to keep a less intrusive behavior, aka setting a responsible when
no one is set.

Task-2703285 (event performance)
Task-2703289 (event testing)

[1] odoo/odoo@210c9daebc

closes odoo/odoo#81025

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 09:35:08 +00:00
Antoine Guenet e466fdbaf7 [FIX] web_editor: properly convert overflowing row
closes odoo/odoo#80621

X-original-commit: 5a1d94d29004f0f0ddd81c25020a90083d6b8bea
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-08 09:35:04 +00:00
Antoine Guenet 2750bfa97f [IMP] web_editor: no empty class on convert grid
X-original-commit: 731ffadb08961b6aada283f96d82c0a35726cffe
Part-of: odoo/odoo#80621
2021-12-08 09:35:04 +00:00
Antoine Guenet 848fecb003 [FIX] mass_mailing: restore missing space in template class name
mass_mailing_demo has a missing space separating two classes in its
mass_mail_1 template. This restores it.

X-original-commit: a104d4279b0438a05dc4b739fbc4e95e7038e6aa
Part-of: odoo/odoo#80621
2021-12-08 09:35:03 +00:00
Antoine Guenet aceb086854 [FIX] base, web_editor, mail, digest: preserve comments in sent e-mails
For email design in the context of Microsoft Outlook, we want to keep
some magic Microsoft comments (Outlook conditional comment), which -
until this commit - were skipped by QWeb. These allow us to change the
rendering exclusively for Outlook so as to overcome some of its
limitations. This commit introduces a qweb rendering option
(`preserve_comments`) for when - like in mass mailing and digest - we
want to keep comments.

Part-of: odoo/odoo#80621
2021-12-08 09:35:03 +00:00
Antoine Guenet 0ba08b558b [ADD] mail: test for mass_mail mode sending mail with comments
This adds a test sending a mail with comments (MSO conditionals) in
mass_mail mode.

X-original-commit: 8778c10bc1856e57216785a8332b90878ff1b5ef
Part-of: odoo/odoo#80621
2021-12-08 09:35:03 +00:00
Antoine Guenet e4641a8e38 [FIX] web_editor: ensure unstyled tbody in every table on convert inline
This ensures that every `table` element has its contents wrapped in a
`tbody` element, and that that element has its default vertical
alignment replaced with "top" to mimick the grid it's converted from.

X-original-commit: ddf047be9f49ac408c44de26b65ef50be88873b5
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet bd638117ae [FIX] mail: properly make urls absolute in escaped attributes
`_replace_local_links` ensures urls are given as absolute rather
relative paths, for link `href`, img `src` and within styles. This
failed when the style contained escaped single quotes (eg:
`background-image: url(&#34;/my_url/path&#34;);`). This commit adapts the
failing regex appropriately.

X-original-commit: 2af980e8cdc72d35729ef2fbaf5067fe7e72bbb8
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet b7e61e8c32 [ADD] mail: test for _replace_local_links in style urls
This adds a test for the _replace_local_links function of mail render
mixin, in the case of urls in style attributes.

X-original-commit: 199b45c7f6b0155d3828487b2f7771e1500820b1
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet 5c69d9e50a [FIX] web_editor: properly size masonry cells
On converting emails for mail client compatibility, masonry showed a few
sizing issues, which are fixed with this commit.

X-original-commit: cfcc498c828b542552b098d6f3a58924abddb091
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet 06225d8498 [FIX] web_editor: properly size media list images
When converting a mailing for mail client compatibility, we guarantee a
height for each image. When none can be found, or in the special case of
media_list, that height should however not be forced so the client can
make it take the full height of the cell automatically. This is what is
accomplished by this commit.

X-original-commit: e80433335020a52d8f683060e98047f5ce77b054
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Antoine Guenet 9ae5e637e1 [FIX] web_editor: prevent several blocks in one column on convert grid
The following structure is not always properly rendered in mail clients:

```html
<table>
    <tbody>
        <tr>
            <td>
                <h1>Text</h1>
                <p>Text</p>
            </td>
        </tr>
    </tbody>
</table>
```

where the h1 and p can be any block-level element.

This prevents that from happening by wrapping each block in a separate
row/column combo like so:

```html
<table>
    <tbody>
        <tr>
            <td>
                <h1>Text</h1>
            </td>
        <tr>
            <td>
                <p>Text</p>
            </td>
        </tr>
    </tbody>
</table>
```

X-original-commit: 01404499277b63dc64a5a26a93bc419cca092440
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Antoine Guenet d4b3daa871 [REF] web_editor: import odoo-editor utils into convertInline
Some code from odoo-editor utils is needed in convertInline. In order to
avoid duplication, we need to import that code. To that effect, we can't
have the utils being lazy loaded into mass mailing's iframe while
convertInline is loaded the usual way.
This loads the lightweight utils together with convertInline and turns
convertInline into an odoo-module, which makes it easier to simply
import the utils and delete duplicated code.

X-original-commit: 067c94b009609caa0bd78a75b826247e37557417
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Antoine Guenet 54a0b8d853 [FIX] web_editor: properly apply table padding to columns
When converting bootstrap grids into tables, we have to move the
containers' paddings into the cells, otherwise they would not render
properly in all mail clients. Before this fix, verical padding was moved
to each cell, which is wrong: it should be applied to the first (top)
and last cell (bottom) only, which it now is.

X-original-commit: 43112d417f70ac0086fbed2a704f208530d31f87
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Antoine Guenet 23df5ab4ed [FIX] web_editor: keep div inline styles on convert to table
When converting a div to a table, we apply some styles to undo the
table's default styles. This makes sure these styles don't override any
inline styles the div might have been holding.

X-original-commit: 0fad86b330a0e1a3228bbbe76fd2b7370cff3eb0
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Adrien Widart b0278a0221 [FIX] sale_mrp: not include consu components in kit's COGS
When selling a storable kits, the consumable components should be
ignored in account lines

To reproduce the issue:
(Need account_accountant,sale_management,mrp)
1. Create a product category PC:
    - Costing Method: FIFO
    - Inventory Valuation: Automated
2. Create 3 products P_kit, P_compo01, P_compo02
    - P_kit:
        - Type: Storable
        - Category: PC
    - P_compo01
        - Type: Storable
        - Category: PC
        - Cost: 5
    - P_compo02:
        - Type: Consumable
        - Category: PC
        - Cost: 6
3. Update P_compo02's on hand qty: 1
4. Create a bill of materials:
    - Product: P_kit
    - Type: Kit
    - Components:
        - 1 x P_compo01
        - 1 x P_compo02
5. Create & Confirm a sale order SO with 1 x P_kit
6. Process the related delivery
7. Create & Post the related invoice

Error: The journal items of the invoice are incorrect, the value of
Expenses and Stock Interim (Delivered) are $11 instead of $5. The
consumable components should be excluded from this value

OPW-2604084

closes odoo/odoo#81015

X-original-commit: 5de451008552ef9b9c675b34178482d81ff42b89
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-12-08 08:47:01 +00:00
Arnaud Joset b4233a930b [FIX] sale_management: prevent crash when sale order template lines are mixed with rental product
Before this commit, the following traceback would appears when a sale order template was used in rental with rental products.

 ```py
    super()._compute_name()
  File "/home/arj/PycharmProjects/odoo/addons/sale_management/models/sale_order.py", line 187, in _compute_name
    line.name = line.with_context(lang=line.order_id.partner_id.lang).name + line._get_sale_order_line_multiline_description_variants()
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/arj/PycharmProjects/odoo/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/arj/PycharmProjects/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'sale.order.template.line' object has no attribute 'order_id'
2021-12-07 14:27:34,267 95502 INFO subscription werkzeug: 127.0.0.1 - - [07/Dec/2021 14:27:34] "POST /web/dataset/call_kw/sale.order.line/onchange HTTP/1.1" 200 - 16 0.009 0.025
 ```

closes odoo/odoo#80979

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 07:57:06 +00:00
Leo Tran b38845c94f [CLA] Viindoo signs Odoo's CLA
closes odoo/odoo#81012

X-original-commit: 567a83806db0e39403edd669940dbe077c04df41
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 20:23:46 +00:00
Joseph Caburnay 123b705677 [FIX] pos_discount: pos app is stuck when changing the discount
To reproduce:
1. Install pos_discount and pos_coupon.
2. Start a session and add item to the order.
3. Add global discount.
4. Change global discount. Stuck.

This is because in some modules, get_orderlines is overridden. Instead
of returning the original object containing the orderlines, it returns
a different array instance containing the lines. This is the reason the
while loop is stuck. With this change, whether get_orderlines return the
container or a copy, we are sure that it won't be stuck in the for loop.

closes odoo/odoo#81011

Task-id: 2697861
X-original-commit: 6d78748794a2db3f324312fc773f7a48fd0ffba4
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-12-07 19:27:40 +00:00
Kartik Chavda 7ca2c8e6e7 [FIX] project: fix default assigned to for rating in task
Before this commit, the default assignee set to a rating in a task is
always empty because we check if the `project.task` has a `user_id`
field to give the partner of this user.
Since it is no longer the case because we can recently assign many users
to a task. That is, it is `user_ids` field and no longer `user_id`
field.

This commit overwrites `rating_get_rated_partner_id` method to set by
default the partner of the user contained in `user_ids` field if this
field contains at most one user. Otherwise, we set no partner. We choose
to not select the first user in the user_ids field because we cannot
consider it is the responsible of the task and not another one.
We cannot create a rating per user because the rating average will no
longer right because at the beginning of the task we could have 5 users
and after we could have more users or less users and so the number of
ratings for this task could be different each time we send a rating
review to the customer.

Part of task-2696911

closes odoo/odoo#81009

X-original-commit: 88e7d270bee962d6e4d40f6b62d25a9519abfcf2
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2021-12-07 18:40:46 +00:00
Didier (did) 060096b872 [FIX] mail: make the delete button more visible
Before this PR, the delete button was completely invisible on image with white
background.

task-2709788

closes odoo/odoo#81000

X-original-commit: fd1e05cd131273504e7e6cd4f64f6ea63514b6b7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-07 17:55:43 +00:00
Raphael Collet 6af689fd0a [FIX] base: fix search on company depend fields
This is a bunch of fixes (65 corner cases) for the search on
company-dependent fields:

Without a default value:
- `char` fields:
    - operators `not like`/`not ilike` don't return records with unset value
    - `(..., '=', False)` doesn't return records with unset value
    - `(..., '!=', '<string>')` doesn't return records with unset value
    - `(..., 'in', [..., False])` doesn't return records with unset value
    - `(..., 'not in', value)` without `False` inside `value` doesn't return records with unset value
- `date` and `datetime` fields:
    - `(..., '!=', <Date/datetime>)` doesn't return records with unset value
    - `(..., '=', False)` doesn't return records with unset value
- `many2one` fields:
    - operators `not like`/`not ilike` don't return records with unset value
    - `(..., 'in', [..., False])` doesn't return records with unset value
    - `(..., 'not in', value)` without `False` inside `value` doesn't return records with unset value
- `boolean` fields:
    - `(..., '=', False)` and `(..., '!=', True)` don't return records with unset and `False` values
- `integer`/`float` fields:
    - `(..., '!=', <number>)` doesn't return records with unset value

With a truthy default value:
- `many2one` fields:
    - operators `not like`/`not ilike` don't return records with unset value
    - `(..., '=', False)` returns the record with the default value (which isn't `False`)
- `boolean` fields:
    - `(..., '=', False)` doesn't return records with unset and `False` value
    - `(..., '!=', False)` returns records with unset and `False` value
- `integer`/`float` fields:
    - all `(..., operator, value)` which include value 0, return all records with unset value, even if the default value does not satisfy the domain

closes odoo/odoo#80994

X-original-commit: 3e3be652ece83420782070bdb13da2c3a4930046
Signed-off-by: Raphael Collet <rco@odoo.com>
2021-12-07 17:10:48 +00:00
thcl-odoo 9f7c17e018 [FIX] hr_timesheet: authorize project_manager to update task's project
Expected behavior :
Project manager can change task's project of any task including timesheets

Current behavior :
When Project manager with `Timesheets : See own timesheets` permission is updating task's project, an Access Error exception is raised `Only a Timesheets Approver or Manager is allowed to modify a validated entry.`

Steps to reproduce :
*Use demo data to make steps easier*
- Install Project and Timesheets
- Go to Project and select one
- Select any Task
- Edit it and try to change the Project

Reason :
When a user is a project administrator, he can still have basic permissions in Timesheets (`Timesheets : See own timesheets`), which prevents him from modifying the task's project if the task has some validated timesheet

OPW-2646233

closes odoo/odoo#80973

X-original-commit: 41907c6722da5b4777cc3b8065f4057b0a5f0801
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Simon Goffin <sig@odoo.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
2021-12-07 17:10:41 +00:00
William Henrotin 9bb5c31a92 [IMP] stock,mrp: add indexes on picking type
This commit adds an index on picking_type_id for models stock.picking
and mrp.production.

Filtering on picking_type_id is often done via the Inventory Overview.
This should speed up the list render in case of many object.

Task : 2648449

closes odoo/odoo#80434

Related: odoo/upgrade#3068
Related: odoo/enterprise#22535
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-12-07 16:20:07 +00:00
William Henrotin 56e7bcf0cb [REF] *{stock,mrp}*: rename reserved fields
This commit rename product_uom_qty into reserved_uom_qty and product_qty
into reserved_qty on stock move line to stop mistake them with the stock
move quantities fields.

Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
William Henrotin cd9833e4ad [REF] *stock*: rename location destination fields
The stock convention on location name is always to name the destination
`location_dest_id`. It was not the
case on the stock rule model

Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
William Henrotin c146c7d16f [REF] *stock*: rename model stock.location.route into stock.route
Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
William Henrotin 6a23b9bcd6 [REF] *stock*: rename model stock.production.lot into stock.lot
Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:05 +00:00
William Henrotin 71489e8fb6 [REF] mrp: remove unnecessary access
As mrp users are by definition stock users too, there is no to redefine
the same access rules on stock objects

Task : 2648449

Part-of: odoo/odoo#80434
2021-12-07 16:20:05 +00:00
Audric Onockx (auon) 61ae0b4e10 [FIX] hr_timesheet : round time on task
Steps :
- Install Sales & Timesheets
- Timesheets > Settings > Time Encoding :
	- Min duration : 60 min
	- Rounding up : 15 min
- Create a Project P
- Create a Product S :
	- Product Type : Service
	- Service Invoicing Policy : Timesheets on tasks
	- Service Tracking : Create a task in an existing project
	- Project : P
- Create a Sales Order SO and add S
- SO > 1 Tasks (smart button) as T > Timesheets (tab) > Add a line :
	- Employee : Mitchell Admin
	- Duration : 0

- Timesheets > Start :
	- Time : 1:09
	- Project : P
	- Task : SO:S
- T > Timesheets (tab) : Note Time = 1:15 (Min duration + Roundup)

- T > Start and Stop
- Confirm Time Spent Wizard : Note Duration = 1:00 (Min Duration)
	- Duration : 1:09
- Save and T > Timesheets (tab) : Note Time = 1:09

Issue:
- Unconsistent behaviors :
	The time is rounded when using Timesheets' timer and from Task's timer to Confirm Time Spent Wizard
	but it is not rounded when confirming the Wizard.

Fix:
- Round it in when confirming the wizard too.

opw-2672249

closes odoo/odoo#80977

X-original-commit: 3e78c0dbf4adb98e98affefe7da526f73aa529e8
Related: odoo/enterprise#22762
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-12-07 15:31:46 +00:00
Danny de Jong 6f82fa59cc [CLA] update Therp CCLA
Change the github username of Danny de Jong from personnal to
corporate account

closes odoo/odoo#78613

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 15:31:39 +00:00
FrancoisGe 13d0741a47 [FIX] js_transpiler: exported hoisting function
After this commit, the js_transpiler will support exported hoisting
function. So it will be possible to define a hoisting function and
exported in an @odoo-module.

Example of exported hoisting function which wasn't supported before
this commit:
```
  hoisted();
  export function hoisted() {
    ...
  };
```

closes odoo/odoo#80965

X-original-commit: 40ef9f7aeac8048cce8f002c84181abc64bcbe87
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-07 14:41:46 +00:00
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
Thibault Delavallée bd0d951eef [FIX] website_slides: fix choosing of templates in invite wizard
``channel_id`` field is used to compute ``render_model`` of invite wizard
used to filter templates to choose. It is a fake trigger ensuring the
render model field is computed, and then used in template domain
(see ``mail.composer.mixin`` and ``mail.render.mixin``).

As channel_id field is not available in view the domain computation for
template_id is not updated. No template is therefore available in template
m2o field in invite wizard. This commit fixes that by adding the channel_id
field in the view, meaning render_model is now computed.

Task-2709581

closes odoo/odoo#80947

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-07 11:50:54 +00:00
Thibault Delavallée 836428788d [FIX] sms: do not force a void context
When scheduling a mass sms with a template, do not force a void body in
context as default value. Indeed it takes precedence on computation of body
based on template and may lead to a void value being given to create.

Task-2709581

Part-of: odoo/odoo#80947
2021-12-07 11:50:54 +00:00
Thibault Delavallée e8796e6302 [IMP] sms: add precompute on fields
As body and composition_mode are required, an override of create has been
added to ensure they have a value. Indeed compute are computed after creation
which leads to required not being satisfied.

Now that precompute[1] are available this code can be safely replaced.

Task-2709581

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

Part-of: odoo/odoo#80947
2021-12-07 11:50:54 +00:00
Thibault Delavallée 4d4c66acc4 [IMP] website_slides: remove unnecessary create override
An override of invite wizard exists to give a value to body and subject.
However as those are computed field (not required) this is not necessary.

Task-2709581

Part-of: odoo/odoo#80947
2021-12-07 11:50:53 +00:00
yhu-odoo a9d9a258e4 [IMP] stock(_picking_batch): improve set/clear qty button
Add a "clear qty" button to revert the change by "set qty" button in
(batch) picking.
On the move, Whenever the qty_done != reserved, we consider it a
manual change from the user. "set/clear qty" buttons won't change the
line with manual change.
Show "set qty" button when there are moves with 0 qty_done and non-zero
reserved. Show "clear qty" button when we don't show "set qty" button
and there are moves with qty done == reserved but the number is not 0.

Task-2659233

closes odoo/odoo#78737

Signed-off-by: Steve Van Essche <svs@odoo.com>
2021-12-07 11:50:45 +00:00
Brieuc-brd 1e466775fe [IMP] web_editor: add new background shapes
This commit introduces two new background shapes (Float 13 and 14).

task-2687297

closes odoo/odoo#80658

Related: odoo/design-themes#529
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-07 11:00:46 +00:00
alt-odoo e1d1e1f2a5 [FIX] hr_holidays_attendance: allow non HR officer user to refuse leaves
When refusing a leave, we are deleting the associated overtime if any so it can be
used again by the employee. However, we need HR Officer rights to access overtime
field. The sudo() should be used before we try to read the field to avoid errors
in case the manager of the employee does not have HR rights.

closes odoo/odoo#80945

X-original-commit: 1ffbcf9787e5efe00d49f18baba0144f631ada51
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2021-12-07 10:08:17 +00:00
Kevin Baptiste e65a6f6eda [FIX] hr_holidays: bring back missing import
The custom calendar CSS was no longer imported.

Follow-up of #80397

closes odoo/odoo#80940

Taskid: 2675380
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-07 10:08:13 +00:00
Juan Jose Scarafia 2e75a77411 [IMP] l10n_ar: document types settings
1. disable document types that are not available https://www.afip.gob.ar/libro-iva-digital/documentos/Libro-IVA-Digital-Tablas-del-Sistema.pdf (remove "internal_type" value)
2. Add prefix and purchase_aliquots for every document type that usable (has an internal_type value)
3. Enable liquidacion primaria/secundaria de granos

closes odoo/odoo#80808

X-original-commit: 2cd1b449be537c545c153434536ddaae9975b717
Signed-off-by: Josse Colpaert <jco@odoo.com>
2021-12-07 09:14:09 +00:00
Alvaro Fuentes 525f7f1407 [FIX] hr_work_entry: improve query and add indices
The query below
https://github.com/odoo/odoo/blob/81497125d8100c6bdd2dc30434232a88a419a3e3/addons/hr_work_entry/models/hr_work_entry.py#L92-L115
has bad performance without the bespoken indices on `date_start` and
`date_stop`. We can speed it up more with an index on `employee_id`.

This is not enough for DBs with many work entries (500K+), specially
during upgrades.

Here we optimize the query to take into account only the work entries
being modified.

This issue was observed during an upgrade saas~12.3->13.0 where the
payslip recomputation never ends due to the increased amount of hr work
entries created. Note how the first 1K payslips are processed in 1 hour
(~16 payslips per minute), while the latest 3 (before the upgrade
was killed) took 1 min.
```
2021-11-02 21:05:44,403 2229 INFO db_42897 odoo.modules.migration: module hr_payroll: Running migration [$saas~12.4.1.0] end-compute-amount
2021-11-02 21:06:44,577 2229 INFO db_42897 odoo.upgrade: [1.61%] 1120/69635 payslip processed in 0:01:00.036716 (total estimated time: 1:02:12.729213)
2021-11-02 21:07:44,602 2229 INFO db_42897 odoo.upgrade: [2.66%] 1853/69635 payslip processed in 0:02:00.062972 (total estimated time: 1:15:11.918540)
...
2021-11-05 09:59:46,565 2229 INFO db_42897 odoo.upgrade: [47.95%] 33390/69635 payslip processed in 2 days, 12:54:02.025479 (total estimated time: 5 days, 7:00:30.261882)
2021-11-05 10:01:04,990 2229 INFO db_42897 odoo.upgrade: [47.95%] 33393/69635 payslip processed in 2 days, 12:55:20.450549 (total estimated time: 5 days, 7:02:32.725840)
```

opw-2672031

closes odoo/odoo#80898

X-original-commit: 47b7a760c5788782c65136e529c8283fe5f0cce2
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2021-12-07 07:33:07 +00:00
Florian Damhaut 23b459abdf [FIX] hr_holidays : no traceback on accrual plan with no level
How to reproduce :
-Create accrual plan with no level

Current Behaviour :
Traceback because num2words does not support all of odoo language
For supported language, the numbers showed are not ordinal

Behaviour After PR:
Show Basic numbers in every case

opw-2697987

closes odoo/odoo#80849

X-original-commit: 0cf2ade4e6e959170906b4b0143e07909980b1d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-07 07:33:03 +00:00
Florian Damhaut 57451578c0 [FIX] hr_holidays : no traceback on accrual plan with non-supported language
How to reproduce :
-Set language to portugese
-Try to access accrual plan in time off

Current Behaviour :
Traceback because num2words does not support all of odoo language
For supported language, the numbers showed are not ordinal

Behaviour After PR:
Show Basic numbers in every case

opw-2697987

X-original-commit: afa531b6c8a06f553784e90df7641024d9bb142c
Part-of: odoo/odoo#80849
2021-12-07 07:33:02 +00:00
Amin Dehghani 363cdd63e3 [CLA] signature for amindehghani
closes odoo/odoo#80934

X-original-commit: 06b3ba128081c8885da44a5b73845b03963a9f7b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 06:38:54 +00:00