Purpose of this commit is to globally improve code performance by limiting
search impact by using cache when accessing ir.model.
Note that tests are left untouched as they are generally done using admin
(or at least data preparation is done as admin). Diff is kept small currently.
Task-2638444
PR odoo/odoo#76005
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
This reverts commit 82f236d98e322efd84c873df54f8e728e1d2a1bf.
The fix is actually not solving all the issues, and also introduce
a behavior change. Actually, the expected result for filters like
<filter string="My Pipeline" name="my" domain="[('user_id', '=', uid)]"/>
will result into a evaluated filters, but invalid as the uid is set to
the person configuring the google configuration, not the user who will
use it.
As it is tricky (or even impossible) to solve the issue properly in all
the cases, we prefer to warn the user that the filter is invalid instead.
closesodoo/odoo#66042
X-original-commit: 5df2c1d10318cc53f1c3e90256cba6a48d246dcb
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit:
While creating new templates it will give a traceback
After this commit:
While creating new templates it will not give a traceback
LINKS
Task-2334852
closesodoo/odoo#59502
X-original-commit: d04a1b869ef73c302dcd9a1cb04f6d952b0a3db3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When simply need to parse a domain, it is easier
Add .strip() on ir.ui.view as ast.literal_eval produces an syntax
error if the node starts with spaces (as done in the xpath of
hr_attendance.view_employee_form_inherit_hr_attendance)
closesodoo/odoo#43831
Related: odoo/enterprise#7894
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When setting the authorization code, a refresh token is generated in
the background and stored in a system parameter.
However, when saving the general settings (res.config.settings)
without changing the authorization code, the refresh token is deleted.
The refresh token should only be deleted if the authorization was
removed.
This was not the case as the set_param is always called and a value is
only computed when the authorization code has changed. The current
value was never retrieved.
Set a ir.config_parameter only when it a value has changed.
closesodoo/odoo#35028
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
Improve the configuration setting of google drive to make it more userfriendly
Display a message when google drive is enabled but no token have been generated
Task: 1894961
closesodoo/odoo#29562
A many2one field that is required means that its column cannot contain
null values, however the default ondelete policy for all m2o fields is
`set null`, which contradicts `required=True`.
This patch will, by default, apply the `restrict` policy to required m2o
fields unless the ondelete attribute is explicitly specified. However,
if the policy specified is `set null`, a ValueError will be raised
whenever the registry registers the field as this makes no sense.
The default ondelete policy remains unchanged for non-required m2o
fields (set null)
closesodoo/odoo#30122
This commit replaces calls to pycompat helpers that were intended for
python 2 <-> python 3 interoperability for python 3 builtins, as python
2 is no longer officially supported by Odoo.
This includes:
* calls to imap/izip/ifilter replaced by map/zip/filter
* uses of text_type replaced by str
* uses of unichr replaced by chr
* calls to implements_to_string, implements_iterator removed
* string_types and integer_types replaced by str, int respectively
* calls to to_native replaced by calls to to_text
This is done in preparation to the removal of these deprecated helpers
in the following commit.
When saving the settings, the `google_drive_refresh_token` is never set.
This is due to the `ir.config_parameter` which was retrieved after being
saved.
opw-1882068
The google_drive module has not been converted to the new Odoo Javascript framework, and hence was not even started.
This commit corrects that.
The logic is essentially the same as in previous versions
The test implemented contains an inevitable hack that makes sure no other test is affected,
in particular by the new route that the module calls (and that any Sidebar will call)
OPW 801145
closes#21993
Currently, all the methods that start with `get_default_` and `set_` are called on a res.config.settings loading or saving.
This commit purpose is to replace all the occurences of `get_default_foo` and `set_foo`. As these methods won't be called anymore, a warning is logged to notice its deprecation.
The generic method `get_default_fields` and `set_fields` could be improved too. The method names and API are not so good:
Why "default" fields? What you ask for is the current value of the stuff, shown as fields in the model. The values are fed as default values in the wizard, but that's an implementation trick.
Why "fields"? What you ask for are configuration parameters, and such things.
Why passing a list of fields? Its value is never used.
We should further simplify the API of both methods to something like
def get_values(self):
return {}
def set_values(self):
pass
In Python 3, all of these were "consolidated" under urllib(.request,
.parse, .errors) which is inconvenient.
Since we already have hard dependencies on requests and
werkzeug(.urls, which is a backport of Python 3's unicode-aware
urllib.parse) migrate *everything* to that.
A sticking point is urllib2.URLError, those were (mostly) replaced by
the slightly more general IOError which URLError extends.
In odoo at many places the filter items are having repeated strings eventhough the
fiter works differently , so find all the places where this happens and give
proper string to each filter..