From c9e29e5917d1bd1b9ef584b0e013deaca03ee8d8 Mon Sep 17 00:00:00 2001 From: luz paz Date: Fri, 5 Feb 2021 16:38:31 +0000 Subject: [PATCH] [FIX] *: correct typos Various user facing an non-user-facing typos Found via `codespell` Closes odoo/odoo#65648 Signed-off-by: Martin Trigaux (mat) --- doc/howtos/profilecode.rst | 4 ++-- doc/howtos/web.rst | 2 +- doc/python3.rst | 4 ++-- doc/reference/actions.rst | 2 +- doc/reference/cmdline.rst | 2 +- doc/reference/javascript_reference.rst | 6 +++--- doc/reference/mixins.rst | 20 ++++++++++---------- doc/reference/orm.rst | 2 +- doc/reference/security.rst | 2 +- doc/reference/testing.rst | 10 +++++----- doc/reference/views.rst | 4 ++-- doc/setup/deploy.rst | 10 +++++----- doc/webservices/extract_api.rst | 6 +++--- doc/webservices/iap.rst | 6 +++--- doc/webservices/odoo.rst | 4 ++-- doc/webservices/upgrade.rst | 8 ++++---- odoo/cli/server.py | 2 +- odoo/exceptions.py | 2 +- odoo/fields.py | 6 +++--- odoo/http.py | 8 ++++---- odoo/loglevels.py | 2 +- odoo/models.py | 16 ++++++++-------- odoo/modules/graph.py | 2 +- odoo/modules/migration.py | 6 +++--- odoo/modules/module.py | 2 +- odoo/modules/registry.py | 2 +- odoo/netsvc.py | 2 +- odoo/service/model.py | 2 +- odoo/service/server.py | 18 +++++++++--------- odoo/sql_db.py | 2 +- odoo/tools/image.py | 2 +- odoo/tools/mail.py | 2 +- odoo/tools/misc.py | 2 +- odoo/tools/populate.py | 2 +- 34 files changed, 86 insertions(+), 86 deletions(-) diff --git a/doc/howtos/profilecode.rst b/doc/howtos/profilecode.rst index 26bd5c967df..55c8d008c1e 100644 --- a/doc/howtos/profilecode.rst +++ b/doc/howtos/profilecode.rst @@ -10,7 +10,7 @@ Profiling Odoo code Graph a method ============== -Odoo embeds a profiler of code. This embeded profiler output can be used to +Odoo embeds a profiler of code. This embedded profiler output can be used to generate a graph of calls triggered by the method, number of queries, percentage of time taken in the method itself as well as the time that the method took and its sub-called methods. @@ -84,7 +84,7 @@ Dump stack Sending the SIGQUIT signal to an Odoo process (only available on POSIX) makes this process output the current stack trace to log, with info level. When an -odoo process seems stucked, sending this signal to the process permit to know +odoo process seems stuck, sending this signal to the process permit to know what the process is doing, and letting the process continue his job. Tracing code execution diff --git a/doc/howtos/web.rst b/doc/howtos/web.rst index e430460fc35..474175803c2 100644 --- a/doc/howtos/web.rst +++ b/doc/howtos/web.rst @@ -1783,7 +1783,7 @@ When a client action must be executed, the action manager looks up its tag in the registry, walks the specified path and displays the widget it finds at the end. -.. note:: a client action handler can also be a regular function, in whch case +.. note:: a client action handler can also be a regular function, in which case it'll be called and its result (if any) will be interpreted as the next action to execute. diff --git a/doc/python3.rst b/doc/python3.rst index cfa3389a650..1bdab386b88 100644 --- a/doc/python3.rst +++ b/doc/python3.rst @@ -109,7 +109,7 @@ library: Since `requests`_ and `werkzeug`_ are already hard dependencies of Odoo, replace ``urllib[2].urlopen``/``urllib2.Request`` uses by `requests`_, and - ``urlparse`` and a few utilty functions (``urllib.quote``, + ``urlparse`` and a few utility functions (``urllib.quote``, ``urllib.urlencode``) are available through ``werkzeug.urls``, a backport of Python 3's ``urllib.parse``. @@ -138,7 +138,7 @@ next to it before checking if there is a package called that on the PYTHONPATH. Furthermore if a sibling file is named the same as top-level package, the -library becomes inaccessible to both the file itself ans siblings, this has +library becomes inaccessible to both the file itself and siblings, this has actually happened in Odoo with :mod:`odoo.tools.mimetypes`. Additionally, relative imports allow navigating "up" the tree by using diff --git a/doc/reference/actions.rst b/doc/reference/actions.rst index fef80a12737..8f799564fe4 100644 --- a/doc/reference/actions.rst +++ b/doc/reference/actions.rst @@ -237,7 +237,7 @@ corresponding behaviors) are shared between states: * ``object_write``: Updates the current record(s) following ``fields_lines`` specifications -* ``multi``: Executes serveral actions given through the ``child_ids`` argument. +* ``multi``: Executes several actions given through the ``child_ids`` argument. State fields ------------ diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst index d5acf811fa0..e10fef54443 100644 --- a/doc/reference/cmdline.rst +++ b/doc/reference/cmdline.rst @@ -166,7 +166,7 @@ Database .. option:: --db_sslmode Control the SSL security of the connection between Odoo and PostgreSQL. - Value should bve one of 'disable', 'allow', 'prefer', 'require', + Value should be one of 'disable', 'allow', 'prefer', 'require', 'verify-ca' or 'verify-full' Default value is 'prefer' diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst index 70a58d1b798..8ad49f0c507 100644 --- a/doc/reference/javascript_reference.rst +++ b/doc/reference/javascript_reference.rst @@ -178,7 +178,7 @@ to add a file from that addon. In that case, it should be done in three steps: Note that the files in a bundle are all loaded immediately when the user loads the odoo web client. This means that the files are transferred through the network - everytime (except when the browser cache is active). In some cases, it may be + every time (except when the browser cache is active). In some cases, it may be better to lazyload some assets. For example, if a widget requires a large library, and that widget is not a core part of the experience, then it may be a good idea to only load the library when the widget is actually created. The @@ -1784,7 +1784,7 @@ integer (FieldInteger) - type: setting the input type (*text* by default, can be set on *number*) On edit mode, the field is rendered as an input with the HTML attribute type - setted on *number* (so user can benefit the native support, especially on + set on *number* (so user can benefit the native support, especially on mobile). In this case, the default formatting is disabled to avoid incompability. .. code-block:: xml @@ -1825,7 +1825,7 @@ float (FieldFloat) - type: setting the input type (*text* by default, can be set on *number*) On edit mode, the field is rendered as an input with the HTML attribute type - setted on *number* (so user can benefit the native support, especially on + set on *number* (so user can benefit the native support, especially on mobile). In this case, the default formatting is disabled to avoid incompability. .. code-block:: xml diff --git a/doc/reference/mixins.rst b/doc/reference/mixins.rst index 953b604ffa3..f1bcd234160 100644 --- a/doc/reference/mixins.rst +++ b/doc/reference/mixins.rst @@ -110,7 +110,7 @@ to manage followers on your record: Helper method to send a mail with a template :param template_id: the id of the template to render to create the body of the message - :param `\**kwargs`: parameter to create a mail.compose.message wizzard (which inherit from mail.message) + :param `\**kwargs`: parameter to create a mail.compose.message wizard (which inherit from mail.message) .. rubric:: Receiving messages @@ -252,11 +252,11 @@ Subtypes are created as data in your module; the model has the following fields: ``res_model`` - :class:`~odoo.fields.Char` model the subtype applies to; if False, this subtype applies to all models ``default`` - :class:`~odoo.fields.Boolean` - wether the subtype is activated by default when subscribing + whether the subtype is activated by default when subscribing ``sequence`` - :class:`~odoo.fields.Integer` used to order subtypes in the notification customization popup ``hidden`` - :class:`~odoo.fields.Boolean` - wether the subtype is hidden in the notification customization popup + whether the subtype is hidden in the notification customization popup Interfacing subtypes with field tracking allows to subscribe to different kind @@ -379,7 +379,7 @@ yourself by overriding the function ``_notification_recipients``. following the thread). True by default for new groups, False for portal / customer. - button_follow - dict with url adn title of the button + dict with url and title of the button - has_button_unfollow whether to display Unfollow in email (if recipient is currently following the thread). True by default for new groups, False for portal / customer. @@ -576,7 +576,7 @@ some default values these records may have depending on the parent object: tasks getting created in the right project) by setting a dictionary of default values in the alias' ``alias_defaults`` field. - :return: dictionnary of values that will be written to the new alias + :return: dictionary of values that will be written to the new alias :rtype: dict The ``_get_alias_values()`` override is particularly interesting as it allows you @@ -639,7 +639,7 @@ you to make your alias easily configurable from the record's form view. def _get_alias_values(self): """ Specify some default values that will be set in the alias at its creation """ values = super(BusinessTrip, self)._get_alias_values() - # alias_defaults holds a dictionnary that will be written + # alias_defaults holds a dictionary that will be written # to all records created by this alias # # in this case, we want all expense records sent to a trip alias @@ -704,7 +704,7 @@ you to make your alias easily configurable from the record's form view. of the expense, try to find a partner with this email address and do a regex match to find the amount of the expense.""" name = msg_dict.get('subject', 'New Expense') - # Match the last occurence of a float in the string + # Match the last occurrence of a float in the string # Example: '50.3 bar 34.5' becomes '34.5'. This is potentially the price # to encode on the expense. If not, take 1.0 instead amount_pattern = '(\d+(\.\d*)?|\.\d+)' @@ -756,7 +756,7 @@ widgets, respectively). name = fields.Char() # [...] - We modify the form view of our trips to display their next activites: + We modify the form view of our trips to display their next activities: .. code-block:: xml @@ -779,7 +779,7 @@ You can find concrete examples of integration in the following models: * ``crm.lead`` in the CRM (*crm*) Application * ``sale.order`` in the Sales (*sale*) Application -* ``project.task`` in the Project (*poject*) Application +* ``project.task`` in the Project (*project*) Application .. _reference/mixins/website: @@ -869,7 +869,7 @@ case for this mixin is any object that has a frontend-page; being able to contro the visibility of the page allows you to take your time while editing the page and only publish it when you're satisfied. -To include the functionnality, you only need to inherit ``website.published.mixin``: +To include the functionality, you only need to inherit ``website.published.mixin``: .. code-block:: python diff --git a/doc/reference/orm.rst b/doc/reference/orm.rst index 5a2be63dc04..7cc97cd7fae 100644 --- a/doc/reference/orm.rst +++ b/doc/reference/orm.rst @@ -192,7 +192,7 @@ Date / Datetime comparison best practices: date string, therefore this practice is **heavily** discouraged. -Common operations with dates and datetimes such as addition, substraction or +Common operations with dates and datetimes such as addition, subtraction or fetching the start/end of a period are exposed through both :class:`~odoo.fields.Date` and :class:`~odoo.fields.Datetime`. These helpers are also available by importing `odoo.tools.date_utils`. diff --git a/doc/reference/security.rst b/doc/reference/security.rst index 6e072372257..488de51d914 100644 --- a/doc/reference/security.rst +++ b/doc/reference/security.rst @@ -11,7 +11,7 @@ data-driven mechanisms to manage or restrict access to data. Both mechanisms are linked to specific users through *groups*: a user belongs to any number of groups, and security mechanisms are associated to groups, -thus applying security mechamisms to users. +thus applying security mechanisms to users. .. _reference/security/acl: diff --git a/doc/reference/testing.rst b/doc/reference/testing.rst index dc0b9e1823a..5c5d3b0b506 100644 --- a/doc/reference/testing.rst +++ b/doc/reference/testing.rst @@ -152,7 +152,7 @@ default you can remove the ``standard`` tag: ... This test will not be selected by default, to run it the relevant tag will -have to be selected explicitely: +have to be selected explicitly: .. code-block:: console @@ -180,7 +180,7 @@ ones: When you write a test that does not inherit from the :class:`~odoo.tests.common.BaseCase`, this test will not have the default tags, -you have to add them explicitely to have the test included in the default test +you have to add them explicitly to have the test included in the default test suite. This is a common issue when using a simple ``unittest.TestCase`` as they're not going to get run: @@ -197,7 +197,7 @@ Special tags ^^^^^^^^^^^^ - ``standard``: All Odoo tests that inherit from - :class:`~odoo.tests.common.BaseCase` are implicitely tagged standard. + :class:`~odoo.tests.common.BaseCase` are implicitly tagged standard. :option:`--test-tags ` also defaults to ``standard``. That means untagged test will be executed by default when tests are enabled. @@ -211,7 +211,7 @@ Special tags will generally not want both ``post_install`` is usually paired with ``-at_install`` when tagging a test class. - *module_name*: Odoo tests classes extending - :class:`~odoo.tests.common.BaseCase` are implicitely tagged with the + :class:`~odoo.tests.common.BaseCase` are implicitly tagged with the technical name of their module. This allows easily selecting or excluding specific modules when testing e.g. if you want to only run tests from ``stock_account``: @@ -341,7 +341,7 @@ testing system, since this means that a test in the addon web will fail whenever the voip addon is installed (note that the runbot runs the tests with all addons installed). -At the same time, our testing sytem is good, because it can detect whenever +At the same time, our testing system is good, because it can detect whenever another module breaks some core functionality. There is no complete solution to this issue. For now, we solve this on a case by case basis. diff --git a/doc/reference/views.rst b/doc/reference/views.rst index 5bae6be941c..e79a2fe3a9e 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -987,7 +987,7 @@ take the following attributes: ``consolidation`` field name to display consolidation value in record cell ``consolidation_max`` - dictionnary with the "group by" field as key and the maximum consolidation + dictionary with the "group by" field as key and the maximum consolidation value that can be reached before displaying the cell in red (e.g. ``{"user_id": 100}``) ``consolidation_exclude`` @@ -2187,7 +2187,7 @@ Possible children elements of the search view are: 2018 2017 - Muti selection of options is allowed. + Multi selection of options is allowed. ``default_period`` (optional) only makes sense for a filter with non empty ``date`` attribute. diff --git a/doc/setup/deploy.rst b/doc/setup/deploy.rst index 9ce45d90fd7..1ce553657eb 100644 --- a/doc/setup/deploy.rst +++ b/doc/setup/deploy.rst @@ -70,7 +70,7 @@ in ``/etc/odoo.conf`` set: of securing your deployment. Once it is correctly working and only matching a single database per hostname, it is strongly recommended to block access to the database manager screens, - and to use the ``--no-database-list`` startup paramater to prevent listing + and to use the ``--no-database-list`` startup parameter to prevent listing your databases, and to block access to the database management screens. See also security_. @@ -172,7 +172,7 @@ SSL Between Odoo and PostgreSQL Since Odoo 11.0, you can enforce ssl connection between Odoo and PostgreSQL. in Odoo the db_sslmode control the ssl security of the connection -with value choosed out of 'disable', 'allow', 'prefer', 'require', 'verify-ca' +with value chosen out of 'disable', 'allow', 'prefer', 'require', 'verify-ca' or 'verify-full' `PostgreSQL Doc `_ @@ -239,8 +239,8 @@ Configuration sample * Server with 4 CPU, 8 Thread * 60 concurrent users -* 60 users / 6 = 10 <- theorical number of worker needed -* (4 * 2) + 1 = 9 <- theorical maximal number of worker +* 60 users / 6 = 10 <- theoretical number of worker needed +* (4 * 2) + 1 = 9 <- theoretical maximal number of worker * We'll use 8 workers + 1 for cron. We'll also use a monitoring system to measure cpu load, and check if it's between 7 and 7.5 . * RAM = 9 * ((0.8*150) + (0.2*1024)) ~= 3Go RAM for Odoo @@ -387,7 +387,7 @@ notifications. The solutions to support livechat/motifications in a WSGI application are: -* Deploy a threaded version of Odoo (instread of a process-based preforking +* Deploy a threaded version of Odoo (instead of a process-based preforking one) and redirect only requests to URLs starting with ``/longpolling/`` to that Odoo, this is the simplest and the longpolling URL can double up as the cron instance. diff --git a/doc/webservices/extract_api.rst b/doc/webservices/extract_api.rst index f79a3ff2484..b49a2128247 100644 --- a/doc/webservices/extract_api.rst +++ b/doc/webservices/extract_api.rst @@ -65,7 +65,7 @@ Request Body corresponding to a pdf will be processed. If no pdf is found, the first string will be processed. This field is a list only for legacy reasons. The supported extensions are *pdf*, *png*, *jpg* and *bmp*. ``user_infos`` (required) - Information concerning the person to whom the invoice is intended. This informations is not required in order for the service to work but it greatly improves the quality of the result. + Information concerning the person to whom the invoice is intended. This information is not required in order for the service to work but it greatly improves the quality of the result. ``user_company_vat`` (optional) VAT number of the client. @@ -123,7 +123,7 @@ Response status_code status_msg ============= ============================================================== 0 Success -2 An error occured +2 An error occurred 3 You don't have enough credit 6 Unsupported file format 9 Server is currently under maintenance. Please try again later. @@ -211,7 +211,7 @@ Response ============= ============================================================== 0 Success 1 Not ready -2 An error occured +2 An error occurred 9 Server is currently under maintenance. Please try again later. ============= ============================================================== diff --git a/doc/webservices/iap.rst b/doc/webservices/iap.rst index b78beefc184..dccdfb4a3d0 100644 --- a/doc/webservices/iap.rst +++ b/doc/webservices/iap.rst @@ -172,7 +172,7 @@ on Odoo (https://iap.odoo.com/my/home) and select *In-App Services*. on sandbox to ease the tests. Log in then go to :menuselection:`My Account --> Your In-App Services`, click -Create and provide the informations of your service. +Create and provide the information of your service. The service has *seven* important fields: @@ -568,7 +568,7 @@ care how they are implemented. Test the API ------------ -In order to test the developped app, we propose a sandbox platform that allows you to: +In order to test the developed app, we propose a sandbox platform that allows you to: 1. Test the whole flow from the client's point of view - Actual services and transactions that can be consulted. (again this requires to change the endpoint, see the danger note @@ -582,7 +582,7 @@ The latter consists in specific tokens that will work on **IAP-Sandbox only**. * Token ``000111``: Represents an account without sufficient credits to perform any service. Returns an :class:`~odoo.addons.iap.tools.iap_tools.InsufficientCreditError` on authorize attempt. * Token ``111111``: Represents an account with enough credits to perform any service. - An authorize attempt will return a dummy transacion token that is processed by the capture + An authorize attempt will return a dummy transaction token that is processed by the capture and cancel routes. .. note:: diff --git a/doc/webservices/odoo.rst b/doc/webservices/odoo.rst index cdbbd036e46..e4e223e6144 100644 --- a/doc/webservices/odoo.rst +++ b/doc/webservices/odoo.rst @@ -13,7 +13,7 @@ all of its data are also available from the outside for external analysis or integration with various tools. Part of the :ref:`reference/orm/model` API is easily available over XML-RPC_ and accessible from a variety of languages. -.. Odoo XML-RPC idiosyncracies: +.. Odoo XML-RPC idiosyncrasies: * uses multiple endpoint and a nested call syntax instead of a "hierarchical" server structure (e.g. ``odoo.res.partner.read()``) * uses its own own manual auth system instead of basic auth or sessions @@ -889,7 +889,7 @@ Records can be updated using :meth:`~odoo.models.Model.write`, it takes a list of records to update and a mapping of updated fields to values similar to :meth:`~odoo.models.Model.create`. -Multiple records can be updated simultanously, but they will all get the same +Multiple records can be updated simultaneously, but they will all get the same values for the fields being set. It is not currently possible to perform "computed" updates (where the value being set depends on an existing value of a record). diff --git a/doc/webservices/upgrade.rst b/doc/webservices/upgrade.rst index 13f7e8472ce..7b3b1d28e0d 100644 --- a/doc/webservices/upgrade.rst +++ b/doc/webservices/upgrade.rst @@ -136,7 +136,7 @@ Here are 2 examples of database upgrade request creation using: * one in the python programming language using the requests library * one in the bash programming language using `curl `_ (tool - for transfering data using http) and `jq `_ (JSON processor): + for transferring data using http) and `jq `_ (JSON processor): .. rst-class:: setup doc-aside @@ -248,7 +248,7 @@ should be empty if everything went fine. The ``request_sftp_access`` method ---------------------------------- -This method is recommanded for big database dumps. +This method is recommended for big database dumps. It uses the SFTP protocol and supports resuming. It will create a temporary SFTP server where you can connect to and allow you @@ -324,7 +324,7 @@ explanation about the JSON dictionary returned in case of failure. ''''''''''' If the call is successful, the value associated to the *request* key -will be a dictionary containing your SFTP connexion parameters: +will be a dictionary containing your SFTP connection parameters: * ``hostname``: the host address to connect to * ``sftp_port``: the port to connect to @@ -642,7 +642,7 @@ Beside downloading your migrated database using the URL provided by the protocol as described in the :ref:`request_sftp_access method ` -The diffence is that you'll only be able to download the migrated database. No +The difference is that you'll only be able to download the migrated database. No uploading will be possible. Your database upgrade request should be in the ``done`` state. diff --git a/odoo/cli/server.py b/odoo/cli/server.py index 455f7d72a7b..0b91dba1fae 100644 --- a/odoo/cli/server.py +++ b/odoo/cli/server.py @@ -162,7 +162,7 @@ def main(args): sys.exit(0) # This needs to be done now to ensure the use of the multiprocessing - # signaling mecanism for registries loaded with -d + # signaling mechanism for registries loaded with -d if config['workers']: odoo.multi_process = True diff --git a/odoo/exceptions.py b/odoo/exceptions.py index d0587176b65..afaf4870bd3 100644 --- a/odoo/exceptions.py +++ b/odoo/exceptions.py @@ -121,7 +121,7 @@ class ValidationError(UserError): # Deprecated exceptions, only kept for backward compatibility, may be -# removed in the future *without* any futher notice than the Deprecation +# removed in the future *without* any further notice than the Deprecation # Warning. class except_orm(UserError): diff --git a/odoo/fields.py b/odoo/fields.py index 442f23ef3f6..d1eb4e160cd 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -93,7 +93,7 @@ _global_seq = iter(itertools.count()) class Field(MetaField('DummyField', (object,), {})): """The field descriptor contains the field definition, and manages accesses and assignments of the corresponding field on records. The following - attributes may be provided when instanciating a field: + attributes may be provided when instantiating a field: :param str string: the label of the field seen by users; if not set, the ORM takes the field name in the class (capitalized). @@ -1280,11 +1280,11 @@ class Float(Field): .. admonition:: Example - To round a quantity with the precision of the unit of mesure:: + To round a quantity with the precision of the unit of measure:: fields.Float.round(self.product_uom_qty, precision_rounding=self.product_uom_id.rounding) - To check if the quantity is zero with the precision of the unit of mesure:: + To check if the quantity is zero with the precision of the unit of measure:: fields.Float.is_zero(self.product_uom_qty, precision_rounding=self.product_uom_id.rounding) diff --git a/odoo/http.py b/odoo/http.py index d4475b2936c..6f912fefa9e 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -334,7 +334,7 @@ class WebRequest(object): first_time = True - # Correct exception handling and concurency retry + # Correct exception handling and concurrency retry @service_model.check def checked_call(___dbname, *a, **kw): nonlocal first_time @@ -560,7 +560,7 @@ class JsonRequest(WebRequest): wrapped in the `JSON-RPC Response `_ - Sucessful request:: + Successful request:: --> {"jsonrpc": "2.0", "method": "call", @@ -1459,7 +1459,7 @@ class Root(object): # the registry. That means either # - the database probably does not exists anymore # - the database is corrupted - # - the database version doesnt match the server version + # - the database version doesn't match the server version # Log the user out and fall back to nodb request.session.logout() if request.httprequest.path == '/web': @@ -1500,7 +1500,7 @@ def db_filter(dbs, httprequest=None): dbs = [i for i in dbs if re.match(r, i)] elif odoo.tools.config['db_name']: # In case --db-filter is not provided and --database is passed, Odoo will - # use the value of --database as a comma seperated list of exposed databases. + # use the value of --database as a comma separated list of exposed databases. exposed_dbs = set(db.strip() for db in odoo.tools.config['db_name'].split(',')) dbs = sorted(exposed_dbs.intersection(dbs)) return dbs diff --git a/odoo/loglevels.py b/odoo/loglevels.py index bbf7204607b..f737e4d2425 100644 --- a/odoo/loglevels.py +++ b/odoo/loglevels.py @@ -46,7 +46,7 @@ def ustr(value, hint_encoding='utf-8', errors='strict'): for decoding `value`, and defaults to 'utf-8' first. :param value: the value to convert - :param hint_encoding: an optional encoding that was detecte + :param hint_encoding: an optional encoding that was detected upstream and should be tried first to decode ``value``. :param str errors: optional `errors` flag to pass to the unicode built-in to indicate how illegal character values should be diff --git a/odoo/models.py b/odoo/models.py index 00419e61979..96215434e2b 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -168,7 +168,7 @@ class MetaModel(api.Meta): "Invalid import of %s.%s, it should start with 'odoo.addons'." % (self.__module__, name) self._module = self.__module__.split('.')[2] - # Remember which models to instanciate for this module. + # Remember which models to instantiate for this module. if self._module: self.module_to_models[self._module].append(self) @@ -1557,7 +1557,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): # try to find a view_id if none provided if not view_id: - # _view_ref in context can be used to overrride the default view + # _view_ref in context can be used to override the default view view_ref_key = view_type + '_view_ref' view_ref = self._context.get(view_ref_key) if view_ref: @@ -1629,7 +1629,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): result['arch'] = xarch result['fields'] = xfields - # Add related action information if aksed + # Add related action information if asked if toolbar: vt = 'list' if view_type == 'tree' else view_type bindings = self.env['ir.actions.actions'].get_bindings(self._name) @@ -1883,7 +1883,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): @api.model def _read_group_expand_full(self, groups, domain, order): - """Extend the group to include all targer records by default.""" + """Extend the group to include all target records by default.""" return groups.search([], order=order) @api.model @@ -3232,7 +3232,7 @@ Fields: Returns rooturl for a specific given record. By default, it return the ir.config.parameter of base_url - but it can be overidden by model. + but it can be overridden by model. :return: the base url for this record :rtype: string @@ -3397,7 +3397,7 @@ Fields: if not query.where_clause: return self - # detemine ids in database that satisfy ir.rules + # determine ids in database that satisfy ir.rules valid_ids = set() query.add_where(f'"{self._table}".id IN %s') query_str, params = query.select() @@ -3960,7 +3960,7 @@ Fields: # The problem then becomes: how to "estimate" the right size of the batch to have # good performance? # - # This requires extensive testing, and it was prefered not to introduce INSERTs in + # This requires extensive testing, and it was preferred not to introduce INSERTs in # batch, to avoid regressions as much as possible. # # That said, we haven't closed the door completely. @@ -4238,7 +4238,7 @@ Fields: :rtype: osv.query.Query """ # if the object has an active field ('active', 'x_active'), filter out all - # inactive records unless they were explicitely asked for + # inactive records unless they were explicitly asked for if self._active_name and active_test and self._context.get('active_test', True): # the item[0] trick below works for domain items and '&'/'|'/'!' # operators too diff --git a/odoo/modules/graph.py b/odoo/modules/graph.py index cb9a761cc51..664212ec84a 100644 --- a/odoo/modules/graph.py +++ b/odoo/modules/graph.py @@ -117,7 +117,7 @@ class Node(object): Node acts as a per-module singleton. A node is constructed via Graph.add_module() or Graph.add_modules(). Some of its fields are from - ir_module_module (setted by Graph.update_from_db()). + ir_module_module (set by Graph.update_from_db()). """ def __new__(cls, name, graph, info): diff --git a/odoo/modules/migration.py b/odoo/modules/migration.py index bd5e8f3a132..0b7ad8f736c 100644 --- a/odoo/modules/migration.py +++ b/odoo/modules/migration.py @@ -30,8 +30,8 @@ class MigrationManager(object): """ This class manage the migration of modules Migrations files must be python files containing a `migrate(cr, installed_version)` - function. Theses files must respect a directory tree structure: A 'migrations' folder - which containt a folder by version. Version can be 'module' version or 'server.module' + function. These files must respect a directory tree structure: A 'migrations' folder + which contains a folder by version. Version can be 'module' version or 'server.module' version (in this case, the files will only be processed by this version of the server). Python file names must start by `pre-` or `post-` and will be executed, respectively, before and after the module initialisation. `end-` scripts are run after all modules have @@ -103,7 +103,7 @@ class MigrationManager(object): def convert_version(version): if version.count('.') >= 2: - return version # the version number already containt the server version + return version # the version number already contains the server version return "%s.%s" % (release.major_version, version) def _get_migration_versions(pkg, stage): diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 5631f506c62..b18eaa07905 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -208,7 +208,7 @@ def get_resource_from_path(path): """Tries to extract the module name and the resource's relative path out of an absolute resource path. - If operation is successfull, returns a tuple containing the module name, the relative path + If operation is successful, returns a tuple containing the module name, the relative path to the resource using '/' as filesystem seperator[1] and the same relative path using os.path.sep seperators. diff --git a/odoo/modules/registry.py b/odoo/modules/registry.py index c9e0497637a..91ba425b362 100644 --- a/odoo/modules/registry.py +++ b/odoo/modules/registry.py @@ -213,7 +213,7 @@ class Registry(Mapping): At the Python level, the modules are already loaded, but not yet on a per-registry level. This method populates a registry with the given - modules, i.e. it instanciates all the classes of a the given module + modules, i.e. it instantiates all the classes of a the given module and registers them in the registry. """ diff --git a/odoo/netsvc.py b/odoo/netsvc.py index 5d2c7cd0395..adf373b060d 100644 --- a/odoo/netsvc.py +++ b/odoo/netsvc.py @@ -54,7 +54,7 @@ class PostgreSQLHandler(logging.Handler): BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, _NOTHING, DEFAULT = range(10) #The background is set with 40 plus the number of the color, and the foreground with 30 -#These are the sequences need to get colored ouput +#These are the sequences needed to get colored output RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" diff --git a/odoo/service/model.py b/odoo/service/model.py index 3165c6c0ead..e6e08f334f7 100644 --- a/odoo/service/model.py +++ b/odoo/service/model.py @@ -50,7 +50,7 @@ def check(f): def tr(src, ttype): # We try to do the same as the _(), but without the frame - # inspection, since we aready are wrapping an osv function + # inspection, since we already are wrapping an osv function # trans_obj = self.get('ir.translation') cannot work yet :( ctx = {} if not kwargs: diff --git a/odoo/service/server.py b/odoo/service/server.py index 62f080701bf..32eff6ac216 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -129,7 +129,7 @@ class RequestHandler(werkzeug.serving.WSGIRequestHandler): class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer): """ werkzeug Threaded WSGI Server patched to allow reusing a listen socket - given by the environement, this is used by autoreload to keep the listen + given by the environment, this is used by autoreload to keep the listen socket open when a reload happens. """ def __init__(self, host, port, app): @@ -498,11 +498,11 @@ class ThreadedServer(CommonServer): test_mode = config['test_enable'] or config['test_file'] if test_mode or (config['http_enable'] and not stop): - # some tests need the http deamon to be available... + # some tests need the http daemon to be available... self.http_spawn() def stop(self): - """ Shutdown the WSGI server. Wait for non deamon threads. + """ Shutdown the WSGI server. Wait for non daemon threads. """ if getattr(odoo, 'phoenix', None): _logger.info("Initiating server reload") @@ -845,7 +845,7 @@ class PreforkServer(CommonServer): raise def start(self): - # wakeup pipe, python doesnt throw EINTR when a syscall is interrupted + # wakeup pipe, python doesn't throw EINTR when a syscall is interrupted # by a signal simulating a pseudo SA_RESTART. We write to a pipe in the # signal handler to overcome this behaviour self.pipe = self.pipe_new() @@ -970,7 +970,7 @@ class Worker(object): raise def check_limits(self): - # If our parent changed sucide + # If our parent changed suicide if self.ppid != os.getppid(): _logger.info("Worker (%s) Parent changed", self.pid) self.alive = False @@ -1034,7 +1034,7 @@ class Worker(object): len(odoo.modules.registry.Registry.registries)) self.stop() except Exception: - _logger.exception("Worker (%s) Exception occured, exiting..." % self.pid) + _logger.exception("Worker (%s) Exception occurred, exiting...", self.pid) # should we use 3 to abort everything ? sys.exit(1) @@ -1052,7 +1052,7 @@ class Worker(object): break self.process_work() except: - _logger.exception("Worker %s (%s) Exception occured, exiting...", self.__class__.__name__, self.pid) + _logger.exception("Worker %s (%s) Exception occurred, exiting...", self.__class__.__name__, self.pid) sys.exit(1) class WorkerHTTP(Worker): @@ -1062,7 +1062,7 @@ class WorkerHTTP(Worker): # The ODOO_HTTP_SOCKET_TIMEOUT environment variable allows to control socket timeout for # extreme latency situations. It's generally better to use a good buffering reverse proxy - # to quickly free workers rather than increasing this timeout to accomodate high network + # to quickly free workers rather than increasing this timeout to accommodate high network # latencies & b/w saturation. This timeout is also essential to protect against accidental # DoS due to idle HTTP connections. sock_timeout = os.environ.get("ODOO_HTTP_SOCKET_TIMEOUT") @@ -1311,7 +1311,7 @@ def start(preload=None, stop=False): # On 32bit systems the default size of an arena is 512K while on 64bit systems it's 64M [3], # hence a threaded worker will quickly reach it's default memory soft limit upon concurrent requests. # We therefore set the maximum arenas allowed to 2 unless the MALLOC_ARENA_MAX env variable is set. - # Note: Setting MALLOC_ARENA_MAX=0 allow to explicitely set the default glibs's malloc() behaviour. + # Note: Setting MALLOC_ARENA_MAX=0 allow to explicitly set the default glibs's malloc() behaviour. # # [1] https://sourceware.org/glibc/wiki/MallocInternals#Arenas_and_Heaps # [2] https://www.gnu.org/software/libc/manual/html_node/The-GNU-Allocator.html diff --git a/odoo/sql_db.py b/odoo/sql_db.py index c5af069728e..7df9f6011fb 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -401,7 +401,7 @@ class Cursor(BaseCursor): else: # If a serializable cursor was requested, we # use the appropriate PotsgreSQL isolation level - # that maps to snaphsot isolation. + # that maps to snapshot isolation. # For all supported PostgreSQL versions (8.3-9.x), # this is currently the ISOLATION_REPEATABLE_READ. # See also the docstring of this class. diff --git a/odoo/tools/image.py b/odoo/tools/image.py index 7e1a09e7144..ff0c8f1749b 100644 --- a/odoo/tools/image.py +++ b/odoo/tools/image.py @@ -42,7 +42,7 @@ EXIF_TAG_ORIENTATION_TO_TRANSPOSE_METHODS = { # Initial side on 1st row/col: 8: [Image.ROTATE_90], # left/bottom } -# Arbitraty limit to fit most resolutions, including Nokia Lumia 1020 photo, +# Arbitrary limit to fit most resolutions, including Nokia Lumia 1020 photo, # 8K with a ratio up to 16:10, and almost all variants of 4320p IMAGE_MAX_RESOLUTION = 45e6 diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py index b08fd15f621..609af0289f3 100644 --- a/odoo/tools/mail.py +++ b/odoo/tools/mail.py @@ -513,7 +513,7 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non return res def email_split_tuples(text): - """ Return a list of (name, email) addresse tuples found in ``text``""" + """ Return a list of (name, email) address tuples found in ``text``""" if not text: return [] return [(addr[0], addr[1]) for addr in getaddresses([text]) diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 8aa037d0877..88413cbeb01 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -1530,7 +1530,7 @@ def get_diff(data_from, data_to, custom_style=False): :return: a string containing the diff in an HTML table format. """ def handle_style(html_diff, custom_style): - """ The HtmlDiff lib will add some usefull classes on the DOM to + """ The HtmlDiff lib will add some useful classes on the DOM to identify elements. Simply append to those classes some BS4 ones. For the table to fit the modal width, some custom style is needed. """ diff --git a/odoo/tools/populate.py b/odoo/tools/populate.py index 9cd897fefe7..0ef7bdf2907 100644 --- a/odoo/tools/populate.py +++ b/odoo/tools/populate.py @@ -19,7 +19,7 @@ def format_str(val, counter, values): def chain_factories(field_factories, model_name): - """ Instanciate a generator by calling all the field factories. """ + """ Instantiate a generator by calling all the field factories. """ generator = root_factory() for (fname, field_factory) in field_factories: generator = field_factory(generator, fname, model_name)