Avoid `SELECT *` on `information_schema.columns` because specific access
right restrictions in the context of shared hosting (Heroku, OVH, ...)
might prevent a postgres user to read this field.
Seen that:
- a unicity constraint on a translated field may lead to unexpected results
- declaring records with xmlids of other modules (aka 'base') raises a warning
- some titles may be translated and are highly local
=> we let people manage titles of their countries, even if it may lead
to a few duplicates in case where more than 1 localization is installed
The world changes and some country names too :
- Anguilla is not a part of Saint Kitts and Nevis anymore (1980)
- East Timor is now called Timor-Leste and has a new ISO code (2002)
- Netherlands Antilles have been split in CW, SX, BQ (2010)
- Neutral Zone between Irak and Saudi Arabia does not exist anymore
(1991)
- The U.N. now use "State of Palestine" for West Bank and Gaza (2012)
- Yugoslavia has been split (1992) then some remaining parts renamed as
"Serbia and Montenegro" (2003)
- Zaire is now called Democratic Republic of the Congo (1997)
We also fixed/simplified names of other countries/territories when
there is a more vernacular name that is not ambiguous or simply a typo
source: https://www.iso.org/obp/ui/en/#search
(We also fix a test that count countries beginning by Z, and there is
no Zaire anymore)
In case `--db-filter` is not provided and `--database` is passed,
Odoo will not fetch the list of databases available in the postgres
server anymore because it does not have anything to match against this
list. Instead, `list_dbs()` will use the value of `--database` as a
comma separated list of exposed databases.
This allows better security hardening in postgres access rights.
Basically, that means that those commands
$ odoo-bin -d foobar
$ odoo-bin -d foo,bar,baz
are now respectively equivalent to those commands
$ odoo-bin -d foobar --db-filter='^foobar$'
$ odoo-bin -d foo,bar,baz --db-filter='^(foo|bar|baz)$'
The old behaviour can still be used with this command:
$ odoo-bin -d foobar --db-filter='.*'
This patch modifies Root#dispatch() in order to keep the httprequest url
in the current thread's attribute and use if for dumpstacks and the
phantomjs tests remaining requests handling.
Also added a counter in order to avoid looping forever when trying to join unclosed http requests
in phantomjs test suite after a phantomjs failure + added a log.warning in such a case so it's easier to troubleshoot runbot's ir.logging.
- Activate multi-company
- Company B is parent of Company A
- Admin is in Company A
- Demo is in Company B
- Create a rate with Demo
The rate is recorded on Company A, not Company B as expected.
This is because we call: `self.env.user._get_company()` which would be
equivalent to `self.env.user.env.user.company_id`. Since the user is
browsed as `sudo`, it returns the company of the Admin.
opw-753139
Bug introduced in https://github.com/odoo/odoo/commit/c8601f4384e0c95abc92d1f0b3092cfe2cb2a79d
Purpose
=======
If a module installation is supposed to load an action (example: a wizard like in l10n_eu_service) and if the related action is defined in this module (example: l10n_eu_service.wizard), currently we're using the environment defined on self, which is not updated after the module install, and the key is not defined in the registry.
Specification
=============
Instead of using the environment on self, let's use the new environment created after the cursor commit.
UserError uses a retrocompatibility function 'except_orm' which one can take a
second parameters. The default value of this second param is None, so if we
don't force an empty string, we will see a None on each raise UserError as last line.
In case Postresgl access rights prevents the pguser to access
`pg_database`, the server should not crash when trying to create the
database because the pguser does not have the right to check if the
database exists and he won't be able to create a new database anyway.
However the database might exists and in such a case the flow should
continue. This patch allows the flow to be resumed in such a case, and
in case the database did not actually exists, a warning will tell the
user that it was not possible to check if the db existed and the
registry for this database will fail to be loaded afterward.
In previous versions, readonly used to prevent sending the values
of the fields to the server. However, it was not working properly
for fields which have their own sub-arch in the view, as the value
used to be sent regardless of the readonly value.
In the new views, the readonly modifier is never overlooked, which
created a bug in the stock_picking_return wizard which was not
able to return products received from a po anymore. Basically the
value of the product_id field was not sent so the create crashed.
This commit introduces a new "force_save" modifier which is used
to express that we want to save the value of the field even though
it is readonly from a user interface point of view.
This module defines tours meant to test some cross-app workflows in Odoo.
At this time, it contains a 'tour' that do some important tasks like:
- product creation
- sale order creation
- reordering rule
- invoicing
- reconciliation
- ...
Use ``profile`` to decorate an entry point method.
If ``profile`` is used without params, log as shallow mode else log
all methods for all odoo models by applying the optional filters.
:param whitelist: None or list of model names to display in the log
(Default: None)
:type whitelist: list or None
:param files: None or list of filenames to display in the log
(Default: None)
:type files: list or None
:param list blacklist: list model names to remove from the log
(Default: remove non odoo model from the log: [None])
:param int minimum_time: minimum time (ms) to display a method
(Default: 0)
:param int minimum_queries: minimum sql queries to display a method
(Default: 0)
.. code-block:: python
from odoo.tools.profiler import profile
class SaleOrder(models.Model):
...
@api.model
@profile # log only this create method
def create(self, vals):
...
@api.multi
@profile() # log all methods for all odoo models
def unlink(self):
...
@profile(whitelist=['sale.order', 'ir.model.data'])
def action_quotation_send(self):
...
@profile(files=['/home/openerp/odoo/odoo/addons/sale/models/sale.py'])
def write(self):
...
NB: The use of the profiler modifies the execution time