OCA / openupgradelib

A library with support functions to be called from Odoo migration scripts.
GNU Affero General Public License v3.0
85 stars 171 forks source link

[IMP] BS4->BS5: performance #370

Closed chienandalu closed 2 months ago

chienandalu commented 2 months ago

Avoid record values which html is empty using the same rules that odoo.tools.is_html_empty uses. This way we can simplify the call avoiding a default domain as well. In any case, we can use that domain to refine certain models.

cc @Tecnativa TT46020

please check @pedrobaeza

hhgabelgaard commented 2 months ago

@chienandalu @pedrobaeza What's the Python version compability requirements for OpenUpgradelib? 2.7 according to setup.py https://github.com/OCA/openupgradelib/blob/master/setup.py#L53

So please avoid f-strings - Some of us are using OpenUpgrade on older Odoo/Python versions

pedrobaeza commented 2 months ago

We are using them too in old versions, but look that this is something exclusively for version 16.0. Where are the problem?

StefanRijnhart commented 2 months ago

@pedrobaeza this is the problem

>>> from openupgradelib import openupgrade_tools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "openupgradelib/openupgrade_tools.py", line 415
    )"""
       ^
SyntaxError: invalid syntax
StefanRijnhart commented 2 months ago

Maybe we should bump the version with a major and drop compatibility with Python 2.x.

pedrobaeza commented 2 months ago

OK, I think we can remove the f-string, as it's not strictly needed. @chienandalu can you?

chienandalu commented 2 months ago

No problem

chienandalu commented 2 months ago

Addressing fixes here: https://github.com/OCA/openupgradelib/pull/371

hhgabelgaard commented 2 months ago

@chienandalu Thanks!

This community rocks!