Commit Graph
1243 Commits
Author SHA1 Message Date
Alexandre Kühn f38ace8de2 [DOC] fields: improve doc for trim attribute 2017-11-30 13:00:36 +01:00
Alexandre Kühn 289582bc2a [FIX] test_main_flows: rename menu entry 'Catalog', workaround for the_flow.customer
Menu entry 'Catalog' has been renamed into 'Products' (see https://github.com/odoo/odoo/commit/941037194d0644a0f2d3348aedd888bce5b1eb74)

The step 'the_flow.customer' with enterprise fails due to an unexpected out-of-focus issue.
2017-11-30 10:23:28 +01:00
Dave Lasley 8226aa1db8 [IMP] http.py: Allow to use odoo if unmet dependencies on uninstalled module
Purpose
=======

If an external dependency is unmet on a module that is not installed, it's actually impossible to launch an odoo server and load the web client without getting a traceback.

This commit removes this constraint and allow to use odoo in that case. Obviously the install will crash if the external dependency is still unmet.

Close https://github.com/odoo/odoo/pull/17790
Coming from https://github.com/odoo/odoo/pull/14850
2017-11-29 16:21:12 +01:00
Thibault Delavallée 21ad8d2588 [MERGE] mail: clean and move tests
This commit cleans mail tests in order to have less low-level tests and
to improve code coverage. It improves the tests of features and reduces
field-level checks. Some tests depending on implementation details are
wrapped inside methods. This way if implementation changes most tests
are still valid once assert methods are updated.

Common classes, tools and models are improved. More test models exist
in order to be able to test several features and prepare land to add
performance test. Each set of tests is updated in its own commit.

Finally tests are moved to test_mail. This way tables linked to test
models are not present in production database. Existing test_performance
module is split so that there is tests for base and tests for mail.
2017-11-29 10:54:02 +01:00
Thibault Delavallée 163725e3c6 [FIX] base, web: update comments to moved files from base 2017-11-29 10:19:07 +01:00
Thibault Delavallée 22cce3be9d [ADD] test_mail: add some performances tests 2017-11-29 10:11:15 +01:00
Thibault Delavallée 1cc1ef5058 [SPLIT] test_performance: split between base and mail performance tests
Test performance will now hold the base class for performance tests as
well as tests related to the ORM, depending only on base. A new module
test_mail is introduced at this commit that contains performance tests
related to mail module. This commit contains only code move and should
not impact anything.

Future commits will move mail tests into test_mail so that all mail
related tests are located in the same optional module. This allows
notably to avoid creating a lot of unnecessary tables when installing
mail module on production databases.
2017-11-29 10:05:01 +01:00
Thibault Delavallée ea6415bd90 [IMP] odoo: tests: allow to compare HtmlElement trees
addTypeEqualityFunc does not work for subclasses. Therefore if we want
to be able to compare html trees we have to add the equality check for
html elements which are children of _Element.
2017-11-29 10:05:01 +01:00
Alexandre Kühn 9cd1cae65f [FIX] odoo service: fix location of res_country_data.xml file
It has been moved inside base/data, instead of base/res.
We have to adapt code that is calling it.
2017-11-29 09:04:12 +01:00
Thibault Delavallée 6bd5033e7f [FIX] tools: fix location of res.lang.csv file
It has been moved inside base/data insteaf of base/res. Let us adapt code
calling it.
2017-11-28 18:16:24 +01:00
Christophe Simonis 29590a61cd [MERGE] forward port branch 11.0 up to 8fb25e185b 2017-11-28 16:57:58 +01:00
Christophe Simonis 5851a69aa3 [MERGE] forward port branch saas-16 up to 3f66814a0d 2017-11-28 15:12:31 +01:00
Thibault Delavallée bd033ce29c [SPLIT] base: split base_security to separate groups from rules 2017-11-27 11:15:16 +01:00
Thibault Delavallée 22f02af6bf [SPLIT] base: split base_data 2017-11-27 11:15:13 +01:00
Thibault Delavallée 52dc556a15 [SPLIT] base: split base_demo into files by model 2017-11-27 11:15:11 +01:00
Thibault Delavallée c81d83773c [MOV] base: move module_* wizard into wizard/ 2017-11-27 11:15:08 +01:00
Thibault Delavallée 8b02f7fd67 [MOV] base: move module_* models into models/ 2017-11-27 11:15:06 +01:00
Thibault Delavallée 1fbc29a641 [MOV] base: move ir_* models into models/ 2017-11-27 11:15:03 +01:00
Thibault Delavallée c129b91b6d [MOV] base: move res_* models into models/ 2017-11-27 11:15:00 +01:00
Thibault Delavallée ee5d46ceb1 [MOV] base: move module_* views into views/ 2017-11-27 11:14:57 +01:00
Thibault Delavallée b162eb2e1e [MOV] base: move ir_* views to views/ 2017-11-27 11:14:55 +01:00
Thibault Delavallée 969a55576e [MOV] base: move res_* views to views/ 2017-11-27 11:14:52 +01:00
Thibault Delavallée 7603da1990 [MOV] base: regroup all security rules in the same file in security/
* get some ir_rules from view files
 * move all rules into same file
2017-11-27 11:14:49 +01:00
Thibault Delavallée 935d760f6d [MOV] base: move module_* report into report/ 2017-11-27 11:14:45 +01:00
Thibault Delavallée 2e41295762 [MOV] base: move module_* data and demo into data/ 2017-11-27 11:14:43 +01:00
Thibault Delavallée 49c548dabb [MOV] base: move ir_* report into report/ 2017-11-27 11:14:38 +01:00
Thibault Delavallée be0f477c37 [MOV] base: move ir_* data and demo into data/ 2017-11-27 11:14:27 +01:00
Thibault Delavallée d6804a8218 [MOV] base: move res_* data and demo into data/ along with images in static/img
Purpose is to clean the directory before working on it for new demo data
and some model cleaning.
2017-11-27 11:13:58 +01:00
Thibault Delavallée ca1a207aa3 [MOV] base: move base.sql to data/base_data.sql 2017-11-27 11:13:39 +01:00
Thibault Delavallée d350c438fe [MOV] base: move base_{demo/data}.xml into base/data 2017-11-27 11:13:18 +01:00
Adrian Torres ac5ba4a2b0 [FIX] server: do not restart if phoenix is True (#21209)
Before this commit, saving a file being watched by watchdog
(--dev=reload) with vim (and possibly other text editors) would
crash the server via a KeyboardInterrupt error.

This happens because vim, emacs cause multiple filesystem events to
happen when saving a single file, the FSWatcher registers these events
as multiple SIGHUPs which in turn calls restart() multiple times in a
very small amount of time which makes the KeyboardInterrupts completely
shut down the server

This is fixed by only calling restart() if odoo.phoenix is False, since
catching a SIGHUP sets it to true.

Fixes #21178

Special thanks to @odony for the help :)
2017-11-27 11:12:27 +01:00
Xavier Morel b46830858f [FIX] web: excel export of binary fields
* In Python 3 xlwt apparently does not support writing bytes values ->
  try to decode assuming the value may be base64-encoded, this is more
  or less the behaviour for CSV exports.

  This will most likely not allow the export anyway as Excel cells are
  limited to 32k data characters, which accounting for base64
  expansion means ~24k worth of data, but that is a pre-existing
  issue.
* Also removed support for way outdated browsers from
  content_disposition: the Safari case is for Safari 5 (circa 2012)
  but versioning apparently changed since then and modern Safari
  report their "external" version number rather than the webkit
  version number => the current Safari reports version 11, and gets
  routed to the "does not support unicode file names", which is
  further bugged in Python 3 as it %s's bytes, leading to a resulting
  filename of e.g. `b'res.partner.csv'.csv` (with the prefix and
  quotes).
* The IE case is for IE8, which has long been unsupported by the web
  client.
2017-11-27 11:11:48 +01:00
Adrien Dieudonne bb1602b3ac [IMP] models: avoid empty string as module name
When you import a record in Odoo, you can specify an id without
prefixing it by the name of the module. e.g. 'project_project_x'
The result of this is an empty string as module name.
(This value is valid for a required field...)

Plus, when you check metadata, you see 'false.project_project_x'.

Now, the default module name is '__import__' instead of an empty string.
We already have similar behavior with '__export__' triggered by
'export_data' method.
2017-11-27 08:18:49 +01:00
Odoo Translation Bot 31e574b153 [I18N] Update translation terms from Transifex 2017-11-26 04:25:05 +01:00
Moises Lopez 85a3e1e385 [REF] *: deal with duplicated xml_ids in views and security rules
Was part of PR #19820. Courtesy of Vauxoo
2017-11-24 15:37:28 +01:00
Moises Lopez 593bb5e30d [REF] *: improved translatability of error messages
Was part of the PR #19820. Courtesy of Vauxoo
2017-11-24 15:35:27 +01:00
Alexandre Kühn fb6c9c2443 [IMP] web: FieldChar trim its value by default
With this commit, we change the behaviour of the web client with respect
to spaces in char fields.  Most of the time, starting and ending spaces
have no value, and worse, make the data not so reliable.

After this commit, field char will trim by default (so, if the user input a
char as ' abc ', the string 'abc' will be sent to the server instead).
Note that this only applies when the value of the field is changed.  If
someone open a form view, then switches to edit mode and save, nothing
will change.

This is the desired behavior most of the time.  However, in some rare
cases, this is actually harmful.  For example, if we trim the
'decimal_point' field, it will not be possible to enter a whitespace as
decimal separator.  In those cases, we introduce a new attribute 'trim',
which allow the developer to desactivate that feature.
2017-11-24 13:09:10 +01:00
Aaron Bohy 0670a635ac [REF] base,web: use correct Widget in settings JS tests
... instead of hacking test_utils.
2017-11-23 11:00:21 +01:00
Moises Lopez - https://www.vauxoo.com/ eb90eb42ce [IMP] translate: export empty translations for empty ones
Instead of use the original string by default.

Currently odoo export a PO translation file using the logic:
"If there is not a translation then use the source."

This generate a false 100% of file translated for tools based on PO
files.

This commit change this logic to:
"If there is not a translation then use empty string."

Odoo import a PO translation file supporting empty string because
if a item is empty string odoo use the original source.

Closes #17925
2017-11-21 17:56:28 +01:00
Géry Debongnie 98f72efcbe [FIX] web_tour: add some logging messages
With this commit, we add a few extra logs to help debugging issues with
phantomjs.

I suspect that the recent problems with phantomjs are due to the
localstorage not being cleared properly, but the logs are not sufficient
to determine the exact cause.
2017-11-21 16:11:59 +01:00
Adrian Torres 31ba0fb41b [FIX] ir_module_module: unlink uninstalled modules (#21111)
Before this revision, unlinking a module which has been uninstalled at
least once would raise an Exception because base_module_uninstall
contains a field model_id which is required. The unlink method of
ir_module_module would try to set this field to NULL which is of course
a constraint violation.

This is fixed by manually unlinking the respective base_module_uninstall
records before the unlinking of the ir_module_module record itself

Fixes #20720

DO NOT FORWARD-PORT
2017-11-21 11:13:24 +01:00
Adrian Torres 07510cdbf0 [FIX] base_module_uninstall: ondelete cascade
Before this commit, whenever an ir_module_module that had been
installed/uninstalled at least once would be unlinked, an Exception
would be raised since the field module_id references an ir_module_module
and it is a required field.

This commit fixes this by adding an ondelete='cascade' to the field.

Fixes #20720
2017-11-21 10:55:16 +01:00
Yenthe V.G 0831610d6a [FIX] base: P3-compatible base64 decoding
Closes #21050
Closes #21021
2017-11-21 10:01:52 +01:00
Thibault Delavallée 52f899aae7 [FIX] odoo: tests: correctly call super
Otherwise inheritance is not always possible because child classes
inheriting from the base class are not called.
2017-11-20 11:08:28 +01:00
Odoo Translation Bot 08bdd06542 [I18N] Update translation terms from Transifex 2017-11-19 04:26:17 +01:00
Alexandre Kühn 21c4480821 [REF] *: renaming AppSwitcher to HomeMenu
Summary:
   AppSwitcher      => HomeMenu
   AppSwitcherMenu  => HomeStudioMenu

Details:
   application_switcher => home_menu
   application-switcher => home-menu
   AppSwitcher          => HomeMenu
   appswitcher          => home_menu
   AppSwitcherMenu      => HomeStudioMenu
   appswitcher_menu     => home_studio_menu
   app_switcher         => home_menu
   app-switcher         => home-menu
   app_switcher_menu    => home_studio_menu
2017-11-17 16:37:26 +01:00
Christophe Monniez 0fdf291305 [REF] db: simplify list_dbs
When trying to list db's, the db_user is searched and verified before
searching for the databases.
As it's enclosed in a db.cursor context manager, we can assume that
there is a db user at this very moment.
This commit uses a single query to find databases that belongs to this
cursor user.

Also, this commit adds a message in the logs when an exception occurs
to facilitate debugging instead of silently returning an empty list.
2017-11-17 15:23:14 +01:00
Christophe Simonis c703a2a0c3 [MERGE] forward port branch 11.0 up to d279a3e6d5 2017-11-16 17:55:37 +01:00
Yannick Tivisse 77eb1f82d9 [REM] tools: Remove the yml import engine 2017-11-16 14:49:06 +01:00
Yannick Tivisse 7a22cbe5f7 [IMP] test_translation_import: Remove tests.yml
The test is already implemented in python in 'odoo/tests/addons/test_translation_import/tests/test_term_count.py'
2017-11-16 14:49:05 +01:00