Skip to content

[12.0] update upstream c53081f10be#3631

Merged
pedrobaeza merged 4 commits into
OCA:12.0from
ForgeFlow:12.0-update-upstream-c53081f10be
Nov 28, 2022
Merged

[12.0] update upstream c53081f10be#3631
pedrobaeza merged 4 commits into
OCA:12.0from
ForgeFlow:12.0-update-upstream-c53081f10be

Conversation

@MiquelRForgeFlow
Copy link
Copy Markdown
Contributor

Remains.

std-odoo and others added 4 commits June 20, 2022 13:59
…tion

Purpose
=======
The flow where we copy / paste the authorization code will be
depreciated. Because of that, we know use the newest authentication
system which use redirect URI.

Technical
=========
Now, the user is redirected to an Odoo endpoint "google_gmail/confirm"
and the access token / refresh token are automatically fetched.

Documentation
https://developers.google.com/identity/protocols/oauth2/native-app

Task-2852560

closes odoo/odoo#91282

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fix 3 problem

Don't count studio field
------------------------

the commit odoo/odoo@75b8c4e
was supposed to stop counting count field generate by addins a smart
button with studio.

It works fine when base import module is not installed which is never
the case.

When base_import_module the field is counted as a field that belong
to a imported module installed : studio_customization

studio_customization should not be counted as an imported module
installed

Count Field with standard xml_id
--------------------------------

With odoo/odoo@9afce48
Each manual can end up with an xml_id from a standard module:
the original module of the model

A standard module should never create a manual field so we can consider
they should be counted unless they match the criteria of the first
problem

If a field has a standard module xml_id and no other the module
should be odoo/studio and not the name of the standard module

Make possible to exclude some db record from cloc
-------------------------------------------------
It's possible to exclude some file in python module
but it's not possible to exclude some field or SA in
the database from the count

Make it possible if they are link to an xml_id
from the module __cloc_exclude__

The exclude record will be shown in cloc report with
the verbose mode

closes odoo/odoo#95046

Related: odoo/enterprise#29026
Signed-off-by: Christophe Simonis <chs@odoo.com>
When there are many `calendar.event`s (700K+), MemoryError happens when they are tried to be sorted
before returning them in `get_recurrent_ids` method.

[upg-377987](https://upgrade.odoo.com/web#action=150&cids=1&id=377987&menu_id=107&model=upgrade.request&view_type=form)
Traceback from the upgrade request:
```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/12.0/odoo/addons/base/maintenance/migrations/base/tests/test_mock_crawl.py", line 220, in crawl_menu
    self.mock_action(action_vals)
  File "/home/odoo/src/odoo/12.0/odoo/addons/base/maintenance/migrations/base/tests/test_mock_crawl.py", line 347, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
  File "/home/odoo/src/odoo/12.0/odoo/addons/base/maintenance/migrations/base/tests/test_mock_crawl.py", line 368, in mock_view_form
    records = model.search(domain, limit=3)
  File "/home/odoo/src/odoo/12.0/odoo/models.py", line 1581, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
  File "/home/odoo/src/odoo/12.0/addons/calendar/models/calendar.py", line 1802, in _search
    events = self.browse(events.get_recurrent_ids(args, order=order))
  File "/home/odoo/src/odoo/12.0/addons/calendar/models/calendar.py", line 1261, in get_recurrent_ids
    return [r['id'] for r in sorted(result_data, key=key)]
  File "/home/odoo/src/odoo/12.0/addons/calendar/models/calendar.py", line 1259, in key
    for v, desc in vals_spec
  File "/home/odoo/src/odoo/12.0/addons/calendar/models/calendar.py", line 1259, in <listcomp>
    for v, desc in vals_spec
MemoryError

The issue is happening in the `key` function when data is being sorted before returning it. In this function to compare events for every key a list is returned.
Returning a list for every element leads to a memory error because lists over allocate memory when they are created to make Time complexity of [appending to a list O(1) in amortized time](https://stackoverflow.com/questions/46664007/why-do-tuples-take-less-space-in-memory-than-lists)
Over allocating memory a few times would not be a problem but given that this db has 700K+ `calendar.events`, over allocation causes a memory error. That's why it is better
to return tuples instead of lists, which do not over allocate because they are immutable, which will resolve the MemoryError.

closes odoo/odoo#102198

Signed-off-by: Christophe Simonis <chs@odoo.com>
@MiquelRForgeFlow MiquelRForgeFlow added this to the 12.0 milestone Nov 28, 2022
@pedrobaeza pedrobaeza merged commit 568c9c5 into OCA:12.0 Nov 28, 2022
@pedrobaeza pedrobaeza deleted the 12.0-update-upstream-c53081f10be branch November 28, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants