Commit Graph
100 Commits
Author SHA1 Message Date
Christophe Monniez e9e864802f [REV] base: revert rename ir.logging type to logging_type
This reverts commit c42a130a98
and commit fb7ac56d65.

The runbot is using cross db logging and those commit were breaking the
mechanism. As a result, the master builds logs were empty.
If we update the runbot to use logging_type instead, the other versions
builds will be impacted hence this revert.

closes odoo/odoo#28512
2018-11-08 14:31:57 +00:00
Christophe Monniez 07b855fccf [FIX] tests: remove chrome sandboxing
It appears that chrome headless with sandboxing is failing when running
containerized because it tries to use Linux namespaces.

With this commit, the no-sanbox optional arg is used to avoid this
issue.

Closes #26456
Closes #28053
2018-10-26 11:26:18 +02:00
Christophe Monniez f9ee8cff14 [FIX] tests: avoid remaining requests
From times to times, warning are seen on the runbot during HttpCase
tests with the chrome headless browser.

Those warning are about Odoo trying to join remaining requests threads.
In the dumpstack, the thread seems blocked in the werkzeug
handle_one_request method, when trying to read the HTTP request line.

One explanation could be that Chrome opens a pre-connect socket for
a future use. When the HttpTest cleans the browser, the page stops
loading but (probably) keeps the socket open for a while.

That could explain the problem.

With this commit, a timeout is set on the request handler,
in the hope that it closes the pre-connect socket too.
2018-10-25 17:16:34 +02:00
Christophe Monniez 2f63e1e973 [FIX] tests: detect coverage and adjust timeout
When computing coverage, the tests are slowed down and the timeout is
often exceeded.

With this commit, HttpCase headless Chrome tests timeout is increased if
coverage is detected.
2018-10-18 11:59:44 +02:00
Christophe Monniez 383ed26657 [FIX] tests: close Chrome and shutdown on SIGXCPU
When Odoo receive a SIGXCPU (CPU time limit reached), it shuts down
immediately. If a headless Chrome is running, it stays alive after the
Odoo shutdown.

With this commit, the signal is intercepeted and the Chrome browser is
properly closed before shutting down the Odoo server.
2018-10-18 11:59:43 +02:00
Christophe Monniez 5a523b06cd [FIX] tests: properly stop chrome when no tab found
In some situations, Chrome remote debugging is sending an empty list of
opened tabs. In that case, an orphan Chrome process stays alive.

With this commit, Chrome is stopped properly in those situations.
2018-10-18 11:59:43 +02:00
Christophe Monniez 0daf4536a6 [FIX] tests: disable screencast when no logfile
When an HttpCase browser_js test is started, the screencast is started
and is discarded at the end of the test if no logfile was provided by
the config.

This behavior can impact the performances.

With this commit, the screencast does not start at all if not needed.
2018-10-18 11:59:43 +02:00
Christophe Monniez 8a5e40b875 [FIX] tests: redirect chrome headless stdout and stderr to dev null
When executing a very long HttpCase browser_js test, it happens that one
of the chrome process PIPE is full (ie. clickEverywhere test).
In that case, the communication with Chrome is blocked.

With this commit the stdout and stderr of the Chrome process are
redirected to /dev/null.
2018-10-18 11:59:43 +02:00
Christophe Monniez ecaa04ec82 [FIX] tests: increase browser_js ready code timeout
Before starting a JS test/tour the _wait_ready method evaluates if the
test is ready with a timeout of 10 sec. From times to times, it happens
that the page is not ready after this timeout but the problem is hidden.

In order to help fixing that kind of issue, the timeout is increased to
60 sec and a warning is logged to emphasis the fact that an
issue exists.

Also some unused imports are removed with this commit
2018-10-18 11:59:42 +02:00
Christophe Monniez 9973994660 [FIX] tests: clean the browser even on failure
When a Chrome headless test fails the browser is not cleaned and could
lead to a mix with other tests when the same method is called.

Also, the multiline assertions gives an unreadable message when the
assertion fails.
Finally, it happens that a thread does not have an 'url' attribute and lead to a crash when the logger tries to show the thread url.

With this commit, the browser is cleaned, even on failure and the
assertions are now one line.

Closes:  #26432
2018-10-18 11:59:42 +02:00
Christophe Monniez e0219c7f39 [FIX] tests: avoid remaining requests
From times to times, warning are seen on the runbot during HttpCase
tests with the chrome headless browser.

Those warning are about Odoo trying to join remaining requests threads.
In the dumpstack, the thread seems blocked in the werkzeug
handle_one_request method, when trying to read the HTTP request line.

One explanation could be that Chrome opens a pre-connect socket for
a future use. When the HttpTest cleans the browser, the page stops
loading but (probably) keeps the socket open for a while.

That could explain the problem.

With this commit, a timeout is set on the request handler,
in the hope that it closes the pre-connect socket too.

Cheery-pick of f9ee8cf to avoid runbot_merge failures.

closes odoo/odoo#28193
2018-10-26 11:42:03 +00:00
Christophe Monniez 3c59add416 [FIX] survey: fix sent_survey domain
survey.user_input type was renamed to input_type in 35a5db9.
This domain was forgotten and made the click_everywhere test fail.

closes odoo/odoo#28010
2018-10-22 12:53:45 +00:00
Christophe Monniez 4f28121065 [FIX] web: increase clickEveryWhere test timeout again
Two minutes increase was obviously not enough.

closes odoo/odoo#27709
2018-10-12 08:34:37 +00:00
Christophe Monniez 8d9e276a9f [FIX] web: increase clickEveryWhere test timeout
Actually, in normal conditions, the test last a little bit less than 30
min as Admin user in enterprise edition.
This is to close of the timeout and as expected, the timeout was
reached.

With this commit, the Admin test in increased of 2 minutes.
The Demo test duration is slightly faster and does not need an increase.

closes odoo/odoo#27608
2018-10-10 08:03:08 +00:00
Christophe Monniez 5a04c82fff [FIX] packaging: bump Odoo version to 12 in MS Windows installer
Fixes #27420

closes odoo/odoo#27590
2018-10-09 15:21:02 +00:00
Christophe Monniez 8c682544ea [FIX] config: add a config dest to test-enable option
Commit 76c5389 removed the option dest for test-enable leading to a
traceback when trying to save the configuration.
This was due to the fact that the options dict was sorted while
containing a None key because of the missing dest.
2018-09-28 16:11:22 +02:00
Christophe Monniez 7b0ee529cb [FIX] account: remove standard tag on l10nall test
Oversight of the dev branch that cause the test to be launched on each
runbot build.
2018-09-19 16:46:30 +02:00
Christophe Monniez b9ad03ab78 [IMP] account: test install of all l10n modules
l10n modules are blacklisted on the runbot.
With this commit, a tagged test is added that installs all the l10n
modules. A chart of account is installed in a different company for each
one. This test is a first step to test all l10n. It's intended to be
launched by a runbot cron script.
2018-09-19 15:58:10 +02:00
Christophe Monniez 98ced5ca88 [FIX] web: fix selector for the menu items in clickEverywhere test
Also clarify a variable name referencing a node instead of a jquery
object.
2018-09-18 16:44:38 +02:00
Christophe Monniez 83e460b8da [IMP] web: add a phone input to the database manager
Task: 1879675
2018-09-18 13:54:19 +02:00
Christophe Monniez 058b1993ab [FIX] l10n_eu_service: remove duplicate service tax rate
Since d5b687a an error is logged when trying to insert duplicates in
ir_model_data. An error appears when installing this module because of
the duplicate.

As this module is not yet tested, this error flew under the radar.

Note: a new test that installs l10n* is developped
2018-09-14 11:17:01 +02:00
Christophe Monniez 88e935fa01 [FIX] web: remove display none timeout
Since 6dc37ee461 a d-none class was added to hide the menus in the
navbar during the start of the navbar. A timeout was set to mimic the
old behavior and let enought time to bind events on menus.

When the project app was installed alongside with all other apps on the
runbot, there was not enough place in the navbar. This resulted in a
race condition at the begining of the project tour.

With this commit, the d-none class is immediately removed and then the
menu are started (binded to events) before the tour has the hand to
continue its next step.
2018-09-11 20:19:17 +02:00
Christophe Monniez e3bc059c36 [FIX] web_editor: adapt tour to BS4 2018-09-11 10:00:42 +02:00
Christophe Monniez e312ec71dd [FIX] tests: detect coverage and adjust timeout
When computing coverage, the tests are slowed down and the timeout is
often exceeded.

With this commit, HttpCase headless Chrome tests timeout is increased if
coverage is detected.
2018-09-05 15:30:49 +02:00
Christophe Monniez 69a24eb84b [FIX] tests: close Chrome and shutdown on SIGXCPU
When Odoo receive a SIGXCPU (CPU time limit reached), it shuts down
immediately. If a headless Chrome is running, it stays alive after the
Odoo shutdown.

With this commit, the signal is intercepeted and the Chrome browser is
properly closed before shutting down the Odoo server.
2018-09-05 15:30:49 +02:00
Christophe Monniez 2c09110927 [FIX] server: ensure that the error message is flushed
When Odoo intercept the SIGXCPU signal, an error message is written to
the stderr. Unfortunately, if stderr is redirected to a buffered file, the
message will not appear.
2018-09-05 15:30:49 +02:00
Christophe Monniez f468023bd9 [FIX] tests: properly stop chrome when no tab found
In some situations, Chrome remote debugging is sending an empty list of
opened tabs. In that case, an orphan Chrome process stays alive.

With this commit, Chrome is stopped properly in those situations.
2018-09-05 15:30:49 +02:00
Christophe Monniez c6ed80e1b6 [FIX] tests: disable screencast when no logfile
When an HttpCase browser_js test is started, the screencast is started
and is discarded at the end of the test if no logfile was provided by
the config.

This behavior can impact the performances.

With this commit, the screencast does not start at all if not needed.
2018-09-04 19:17:01 +02:00
Christophe Monniez 229c119999 [FIX] hr_recruitment: limit new hired filter to group
In Employees views, selecting New Hired filters leads to an access error
with a simple user.

With this commit, this filter is limited to the corresponding users
group.

Backport of 804b9b7c5e
2018-09-04 16:40:21 +02:00
Christophe Monniez 804b9b7c5e [FIX] hr_recruitment: limit new hired filter to group
In Employees views, selecting New Hired filters leads to an access error
with a simple user.

With this commit, this filter is limited to the corresponding users
group.

Closes #26747
2018-09-04 13:44:17 +02:00
Christophe Monniez 580a0b2ef7 [FIX] tests: redirect chrome headless stdout and stderr to dev null
When executing a very long HttpCase browser_js test, it happens that one
of the chrome process PIPE is full (ie. clickEverywhere test).
In that case, the communication with Chrome is blocked.

With this commit the stdout and stderr of the Chrome process are
redirected to /dev/null.
2018-08-31 15:03:11 +02:00
Christophe Monniez 4e7fcf3e07 [FIX] web: wait web client to be ready before clickEverywhere test
When starting the clickEverywhere test with enterprise modules
installed, it happens that Odoo web client is not yet fully loaded.
In this situation, the test does not find any app to test.

With this commit, an attribute is added to odoo to check if the web
client is fully loaded.
2018-08-31 14:45:25 +02:00
Christophe Monniez 984554f4ca [REF] web: move debug_managers in tools 2018-08-29 16:57:27 +02:00
Christophe Monniez 3f0ebca192 [IMP] web: New test to test Odoo menus
This commit adds a new js test in web that enters each app and click on
each view switcher, each menu and each search filter.

This test is tagged '-standard' and 'click_all' as it could last a long
time, that way it's not executed by default.

It could also be started from the browser console with
'clickEverywhere();'.
2018-08-29 16:57:27 +02:00
Christophe Monniez 6dc790d2da [FIX] packaging: find admin uid when testing packages
Since 2f7c03d the admin user could have any uid and the uid 1 is
reserved for the system user. As the uid was hardcoded as 1 when testing
packages, the tests were failing.

With this commit, the uid of the admin user is searched before testing
the packages.

Closes #26603
2018-08-27 13:25:43 +02:00
Christophe Monniez f00f4f3852 [REL] saas-11.5 2018-08-24 08:10:38 +02:00
Christophe Monniez d4f36c0e8b [FIX] hr_holidays: remove unread meassages filter
Before the models split in a0f4f65 the Leaves Summary report inherited
the message_needaction from mail.thread.  Now the hr.leave.report model
does not have this field and leads to a traceback.

With this commit, the filter is removed from the search view of the
report.
2018-08-23 14:57:14 +02:00
Christophe Monniez 334804347a [FIX] tests: increase browser_js ready code timeout
Before starting a JS test/tour the _wait_ready method evaluates if the
test is ready with a timeout of 10 sec. From times to times, it happens
that the page is not ready after this timeout but the problem is hidden.

In order to help fixing that kind of issue, the timeout is increased to
60 sec and a warning is logged to emphasis the fact that an
issue exists.

Also some unused imports are removed with this commit
2018-08-22 16:17:38 +02:00
Christophe Monniez 3ff0948b0a [FIX] gamification: compute badge stats wihtout error
Since 960360a, when computing badge stats, a datetime was compared to a
string leading to a traceback.  e.g. when clicking in employess >
badges.

Also, due to a typo, the compute method was assigning the stats result
to the wrong attributes.  e.g. 'stats_my_this_month' instead of
'stat_my_this_month'.

With this commit, the above mentioned issues are fixed and a test is
covering these issues to avoid regression.
2018-08-22 09:28:16 +02:00
Christophe Monniez c8762eaa03 [FIX] hr: properly set label in kanban-box
In recruitment, clicking on configuration > job positions > kanban view
leads to an odoo client error.

The qweb template cannot evaluate the condition on the client side.
With this commit, the ternary condition is properly evaluated.

Also, an unnecessary t-attf is removed.

Closes #26486
2018-08-21 12:08:31 +02:00
Christophe Monniez 0da58f4133 [FIX] hr_holidays: fix _compute_leave_status
Click on the employee app causes a traceback when hr_holidays is
installed.

With this commit, leave_date_from and leave_date_to receive a date as
expected instead of a datetime when computing the leave status.
2018-08-20 11:16:19 +02:00
Christophe Monniez c6fa1796af [FIX] tests: clean the browser even on failure
When a Chrome headless test fails the browser is not cleaned and could
lead to a mix with other tests when the same method is called.

Also, the multiline assertions gives an unreadable message when the
assertion fails.
Finally, it happens that a thread does not have an 'url' attribute and lead to a crash when the logger tries to show the thread url.

With this commit, the browser is cleaned, even on failure and the
assertions are now one line.

Closes:  #26432
2018-08-17 14:49:53 +02:00
Christophe Monniez 4293a27b03 [FIX] packaging: fix docker file for src tests
Since bf3193a libsass is needed but is named libsass0 in Debian.
With this commit, the docker source image used for tests will build again.
2018-07-27 08:51:33 +02:00
Christophe Monniez ae87467d8c [FIX] packaging: make debian package depends on python3-chardet
Since b60de0db41 Odoo requires chardet to
be installed.

With this commit, the Debian package will depends on python3-chardet.
2018-07-18 09:30:14 +02:00
Christophe Monniez 081259ef25 [FIX] payment_stripe: fix broken test
The direct rendering test assertions were not reached at all because the
conditions were never True.
2018-06-20 16:57:55 +02:00
Christophe Monniez 27e7d24256 [FIX] packaging: stop removing Odoo lib dir
When removing Odoo Debian package, the directory /var/lib/odoo is also
removed. This directory could contain important data like filestore or
custom modules.

With this commit, this directory is preserved on removal and deleted
when the purge command is issued with a Debian package manager.

Fixes #22138
2018-06-15 11:58:06 +02:00
Christophe Monniez 9c25bcd5d0 [REL] saas-11.4 2018-06-11 20:52:39 +02:00
Christophe Monniez 0e117c873c [REM] packaging: add sassc to the rpm package
Since 565277acbb sassc is used as a
fallback when the python libsass is not available.

With this commit, the saasc package dependency is added to the rpm to
avoid installing libsass with pip.
2018-06-08 15:47:07 +02:00
Christophe Monniez 2da4eb5898 [FIX] packaging: add BeautifulSoup to py2exe setup
When trying to import an OFX bank statetement under MS Windows, a
Traceback states that BeautifulSoup is missing.

During the build process, py2exe didn't autodiscover that BeautifulSoup
is needed by the ofxparse package.
With this commit, BeautifulSoup is explicitely added to py2exe packages.
The Nightly VM was updated accordingly.

opw-1848202
2018-06-08 14:31:06 +02:00
Christophe Monniez c28a998d3d [IMP] server: intercept SIGXCPU and shutdown gracefully
When the runbot spawns an Odoo instance, a CPU TIME limit is set.
When this limit is reached, the kernel kills the Odoo instance and no
message appears in the logs leaving the dev in a deep smoke cloud.

With this commit, the signal sent by the kernel when the soft
limit is reached (SIGXCPU), is intercepeted and Odoo shutdown gracefully with a
nice message for the dev.
2018-05-18 11:26:46 +02:00
Christophe Monniez 7202205688 [FIX] packaging: avoid traceback on virtual machine timeout
When the virtual machine used to build MS Win package takes too much
time (to build or to test the build), a warning is logged and the VM is killed.

Before this commit, the PID of the process was passed as an argument to
the warning method, causing a traceback.
2018-05-04 10:09:31 +02:00
Christophe Monniez 5666bc3d32 [IMP] packaging: automate package update in Windows build
When building the Windows installer, a virtual machine is used with
prepackaged python modules.

With this commit, the packaging script will try to install on the
virtual machine the python packages specified in requirements.txt.
Each package is installed individually, that way, if an install fails,
the install of the other packages continues.
At the end of the process, successfully packages are listed so that they
will appear in the build log files.

Also, the Makefile was cleaned in this commit (removal of py2exe stuffs).
2018-04-26 09:22:38 +02:00
Christophe Monniez ddf601d443 [FIX] packaging: remove libsass dependency in debian package
A dependency to libsass was added in debian package and in the docker
file. The Odoo nightly builds of the deb package was failing because
this lib is named libsass0 in Debian.

Finally, this dependency is not required because python3-libsass already depends on libsass0.
2018-04-24 13:51:13 +02:00
Christophe Monniez 6fc0032d8c [FIX] packaging: add missing libsass package
Since the move from less to sass, packages were broken due to a missing
dependency in setup.py.

I missed that in bf3193ac5e
2018-04-23 13:28:13 +02:00
Christophe Monniez 54ae09b100 [IMP] tests: improve log when phantomjs crashes
When phantomjs crashes, an error is logged only when the crash is a segfault.
From time to time, we see on the runbot some crashes without any
informations. When digging in the log files, it appears that the exit value
of phantomjs is -6 (that could correspond to the SIGABRT signal).

With this commit, the error message will clearly show the return code
and, above all, it will show that the test failed due to a phantomjs
crash.
2018-04-19 09:16:05 +02:00
Christophe Monniez 6527b69ee0 [FIX] web: increase timeout of test suite
As the test suite increases, the timeout has to follow until a better
solution is found (like a fail fast in Qunit).
2018-04-11 16:51:43 +02:00
Christophe Monniez b696fa1b72 [REL] saas-11.3 2018-04-10 17:58:06 +02:00
Christophe Monniez 4ba6d2a405 [IMP] tests: make phantomjs work on Windows
Since Python 3.2, close_fds parameter is True by default on POSIX
platforms. On Windows, it's set to False when one of the standard descriptors
is set.

This commit will give the opportunity to run phantom js tests on
Windows.
2018-04-10 09:32:30 +02:00
Christophe Monniez 9cf9938f04 [CLA][FIX] fix encoding of a CLA that was in ISO8859-1
In a near future (I hope), runbot will reject CLA that are not UTF-8
encoded.
2018-03-07 10:32:52 +01:00
Christophe Monniez 02d826e1a7 FIX] web: increase timeout of test_01_js
The web test suite is increasing, so the test duration increases too.
6 minutes is not enough on some runbot instances.
2018-02-27 08:50:39 +01:00
Christophe Monniez 82e9cc7f97 [IMP] test_pylint: test the presence of python debuggers
From time to time, it happens that a developper forget to remove debuggers.
This commit adds a test to find such imports (pdb and pudb). The test
will fail if that kind of import is found. The Odoo runbot should run
this test and prevent developper from those small mistakes.
2018-02-26 16:12:54 +01:00
Christophe Monniez cd21ea414e [FIX] packaging: include missing files needed for tests
The test_mimetypes and base_import modules need various files for their
tests. Before this commit some of those files (.ods, .odt, .xlsx, .docx,
.zip) were not included in the packages.

Fixes #22778
2018-02-22 10:22:42 +01:00
Christophe Monniez 29896cf683 [REL] saas-11.2 2018-02-02 10:22:17 +01:00
Christophe Monniez 32db86e3a0 [REF] account_check_printing: refatoring to better inheritancy
* localized checks layout of US and CA introduced in enterprise
* account settings now install account_check_printing instead of the US checks layout
Wsa PR #18791. Was task 33298
2018-02-01 16:48:33 +01:00
Christophe Monniez aca61e3584 [IMP] base, res.lang: add canadian english 2018-02-01 16:48:33 +01:00
Christophe Monniez 48b967fde0 [FIX] web,website,tests: fix typo in test tags
This typo prevented two tests to run.
2018-01-19 09:06:09 +01:00
Christophe Monniez ad7bf6b9c9 [REM] config, loading: remove test-commit and test-report-directory
As there are few use cases for the --test-commit and --test-report-directory
options, they are removed.
2018-01-18 13:27:33 +01:00
Christophe Monniez b356b19033 [IMP] tests: Add the possibility to tag tests
Purpose: When running tests, all the tests for the installed/updated
files are done. This commit adds a 'tagged' decorator that can be used to
tag tests. Combined with a new 'test-tags' CLI option, it adds the ability
to filter which tests are executed. For example, @tagged('slow') will
add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will
only run tests tagged 'slow'.

One can use prefixes to select cases with tags.
'+' or no prefix means that the tests tagged with this tag are selected
for execution. '-' prefix will exclude the tests tagged with this tag.
Exclusion takes precedence over inclusion.

Also, by default, all Odoo tests cases are tagged 'standard' and with
the technical name of the module.
This means that when selecting tests with the 'test-tags'
parameter, if '-standard' is not specified, all tests tags are
going to be executed.
When tagging tests, one can remove such automatic tag by prefixing the
tag name with '-'. E.g. @tagged('-standard') will remove the standard
tag from the test.

Another example, if one wants to test the 'sale' module alone,
even without adding any 'tagged' decorator thos tests can be selected
like that: --test-tags="sale"

Tests are selected or deselected using a TagsSelector. When instanciated,
 a string is passed with comma separated tests selectors like
'+slow,-standard'. When the 'check' method is called  with a test as argument,
it returns True or False if the test has to be executed or not.
2018-01-18 13:20:37 +01:00
Christophe Monniez c05ec6536b [FIX] sale_timesheet: fill customer email field
When creating an SO for a service that create a new Task in a Project, the customer
email field is left empty.
With this commit, the email field is filled with the SO customer's
email.

opw-803566
2018-01-05 13:52:42 +01:00
Christophe Monniez 231c4d5fd8 [FIX] web_editor: rte_inline tour succeed on chrome
The rte_inline tour was failing on chrome because jquery selector in
chrome does not like a space in the style selector.
On the other hand, other browsers and phantomjs need the space.
This commit change the selector to find the element on chrome and
friends.
2017-12-18 22:44:44 +01:00
Christophe Monniez 357b1422f2 [FIX] portal: verify input content instead of body
When running the portal tour, the test succeed too early because it finds
the words "Your Details" on the wrong page (/my instead of /my/account).
The selector has a match on previous page, so tour succeeded when it 's
not complete.

This commit use another selector that only match on the '/my/account'
page.
2017-12-18 21:41:03 +01:00
Christophe Monniez 637dda0d2b [FIX] account: verify that account exists before automatic reconcile
When using the fast_counterpart creation method to automatically
reconcile bank statement lines, there was no verification that the
account id was not set or that the statement was already linked to journal
entries. It was causing a traceback in some conditions when the
demo data were loaded because the fast_counterpart_creation was called
without the verification, using an XML function.

This commmit introduce the necessary verifcation.
Thanks @qdp-odoo for the review and some docstrings/comments
2017-12-18 21:33:36 +01:00
Christophe Monniez f73098fcba [FIX] test_mail: increment the query counter for employee too
When searching the id mail.mail_activity_data_todo a request is done and
should be taken into account by the assertQueryCount.

This commit does just that... for the employee login.
Thanks to the murphy's law, the test branch was green.
2017-12-18 16:48:48 +01:00
Christophe Monniez 292f53885c [FIX] test_mail: increment query counter
When searching the id mail.mail_activity_data_todo a request is done and
should be taken into account by the assertQueryCount.

This commit does just that.
2017-12-18 16:36:23 +01:00
Christophe Monniez 17c9208889 [FIX] base: backport of set mimetype on js and css assets
On MS Windows, the mimetypes module relies on the Windows Registry to
guess mimetypes. As a consequence, when generating assets bundle for
javascript files, the mime type of js files may be wrong. In that
particular case, the Odoo user is facing an empty web page.
This commit enforce 'application/javascript' for js assets when they are
saved as ir_attachment in the database.

This commit is a backport of 77ca51f
2017-12-12 09:42:55 +01:00
Christophe Monniez 72799e1f02 [FIX] project_timesheet_holidays: add default project and task on status
When using this module, the default behavior is to generate timesheet.
This timsheet is linked to a project and a task and there is a
constrain that verify that the task and project are set on model.
If another module (like l10n_fr_hr_payroll for example) tries to
create holidays.status without a project and task, it causes a
traceback.

This commit adds default values for these fields in order fullfill
the constrains.

Notice that the order of the imports in the __init__ is important
because the columns have to be created on the res.company before the
status is initialized.
2017-11-24 14:16:33 +01:00
Christophe Monniez 1779fc123a [FIX] packages: include missing data for l10n_mx
When building the enterprise packages, some data files were ignored.
With this commit, the demo data and missing xslt files are packaged.

This fixes #21045 and fixes #21015
2017-11-20 14:53:56 +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 Monniez 27128f2618 [FIX] db: remove usage of get_dsn_parameters
get_dsn_parameters may return in some edges cases (like on runbot)
and empty value for the user.
So it should not be used here, instead, a SQL query is able to provide
the currently connected user.
Also, get_dsn_parameters is new in psycopg 2.7.
2017-11-10 10:56:31 +01:00
Christophe Monniez b2a126da84 [IMP] server,db: coherently handle PGUSER env variable
When Odoo is started with a db_user using 'postgres', the process
exits with a status 1. However, this can be bypassed when the
PGUSER environment variable is used.
This commit will prevent the usage of the 'postgres' for the
environment variable too.
Also, when trying to list db's, various methods where used to find a
suitable postgres user to get this list.
In fact, as the db cursor is available, a user is already at work.
So, in order to avoid code duplication (e.g. verify user from
environment variables), this commit removes those various method
and get the db user from the cursor.
2017-11-09 13:25:16 +01:00
Christophe Monniez 5048f6e642 [IMP] hr_recruitment_survey: Improve test to cover more features 2017-11-07 16:26:15 +01:00
Christophe Monniez f5bf961258 [IMP] account: Remove unused yml files 2017-11-07 16:26:15 +01:00
Christophe Monniez 16a374c0fe [IMP] l10n_fr: Remove unused yml test 2017-11-07 16:26:15 +01:00
Christophe Monniez 5411fbeae7 [IMP] base: Convert res_partner demo yml file into xml 2017-11-07 16:26:15 +01:00
Christophe Monniez 8670f62e3c [REF] documentation: reorganize setup/install
Odoo setup/install documentation needed a re-organization and an update
to reflect the latest dependencies versions.
There was too much warnings and danger signs on this page.
Finally, the structure was not the same for each install method.

* As CentOs is actually too old to handle python3 dependencies for Odoo,
  rpm install method is explicitely mentioning Fedora 26.
* The "yum" package manager has been deprecated in Fedora and replaced
  with "dnf".
* As Debian and Ubuntu don't ship a python3-num2words package, the
  documentation must provide a hint on how to install the module using pip.
* The documentation was missing the virtualenv way of installing Odoo.
* Paragraphs mentioning configuration file were removed. The
  reference/cmdline page should be updated consequently.
2017-11-07 14:22:43 +01:00
Christophe Monniez 77ca51f089 [FIX] base: set mimetype on js and css assets
On MS Windows, the mimetypes module relies on the Windows Registry to
guess mimetypes. As a consequence, when generating assets bundle for
javascript files, the mime type of js files may be wrong. In that
particular case, the Odoo user is facing an empty web page.
This commit enforce 'application/javascript' for js assets when they are
saved as ir_attachment in the database.
2017-11-07 09:28:25 +01:00
Christophe Monniez 4035d55d56 [FIX] package: fix the windows build test
As the windows package provides odoo from sources alongs with
python 3, the test of the build was failing.
The odoo-bin.exe was not found because py2exe is not used anymore.

Windows firewall is now disabled from package.py to prevent it
from blocking local xmlrpc calls.

Also, the docker containers were removed when package tests were
finished, even when no docker was involved in the process (e.g. only
a windows build).

This commit fixes the test part of the windows build process.
2017-11-03 14:33:24 +01:00
Christophe Monniez e47e78e2e9 [FIX] website_slides: pdf slide viewer slug
When trying to get the pdf content in an IFrame, the url based on
ID was not found and then redirected to a rewritten URL eventually
with  wrong protocol (https became http). This causes a bug in
modern browser that doesn't allow mixed content if the base website
is in https. By using the slug in the URL, there is no redirection
and we avoid changing the protocol.
Thanks @Gorash and @nim-odoo

opw-777950
2017-10-27 08:39:01 +02:00
Christophe Monniez d38d62f5db [FIX] packages: install vc_redist files properly
Nsis installer was installing the wrong MS Visual C++ redistributable
file. Python 3.6 needs MS Visual C++ 2015 redistruibutable files.

Also, Nsis now differentiate Windows architecture for the nssm service
and the MS C++ redist.
2017-10-18 18:44:19 +02:00
Christophe Monniez 119ae9b5dc [FIX] packages: add the stdum module for the RPM 2017-10-13 11:34:07 +02:00
Christophe Monniez 5dfa00cb6c [FIX] packages: fix docker images builds tests
The automated tests of rpm,deb and src packages are using docker
images and containers. Those tests were not working as expected due
to various small glitches:
* some debian python- packages were missing in the Debian image
* pip was called instead of pip3 for the src test
* a wrong addons path was given for the tests
* the containers id's were wrong due to a bytes implicitly converted
  to str
2017-10-12 17:24:36 +02:00
Christophe Monniez 347acbb4c2 [IMP] packaging: remove some packages dependencies
On Ubuntu Xenian, the Odoo package was difficult to install because
three Debian packages were required but could not be found in Ubuntu
repositories. As those packages are not really crucial, they are
now only suggegsted by the Debian package which is therefore
installable on Ubuntu Xenial. One can manually install them as
explained in the documentation.

Closes #20000
2017-10-12 08:51:17 +02:00
Christophe Monniez fc76b1d565 [REM] remove any openid reference
Purpose: openid is not used anymore in Odoo, therefore it can be
safely removed.
2017-10-12 08:43:21 +02:00
Christophe Monniez 7d45ca23e1 [FIX] package: add missing rpm python3 package
python3-psycopg2 package was missing in the RPM.
2017-10-11 16:24:25 +02:00
Christophe Monniez bb14c41663 [REF] core: Remove psycogreen dependency
Purpose:
    The psycogreen module is unmaintained. Last source update was in
    2015 and last pypi package was in 2012. Odoo only use a small
    part of the psycogreen module that could be written directly in
    the odoo code. This commit reproduce the small function from
    psycogreen used in ODoo and remove all depencies from it.
    Also the copyright and license are honored and the documentation
    is updated accordingly.

    pypi pckage: https://pypi.python.org/pypi/psycogreen
    bitbucket repos: https://bitbucket.org/dvarrazzo/psycogreen/
2017-10-09 18:56:57 +02:00
Christophe Monniez 35993ba07d [MERGE] packaging: fixing windows installer issues
Purpose:
    * when installing enterprise, postgresql refuse to install if there
    is a '+' char in the install path.
    * when uninstalling, the nssm and python dirs are not removed
2017-10-09 09:03:57 +02:00
Christophe Monniez 1ca2db0a61 [FIX] setup win32: remove python and nssm on uninstall
Purpose: When uninstalling using the windows uninstaller, python and
nssm were left beyond. This fix removes the python and nssm dirs also.
2017-10-09 08:59:20 +02:00
Christophe Monniez e63813864a [FIX] package: remove unwanted char from install path
Purpose: When installing postgresql under windows, the '+' character is
unallowed. This was creating a bug when using the windows installer the enterprise
version which derivate the install path from the version number.
2017-10-09 08:59:18 +02:00
Christophe Monniez 3a6e7f98c2 [MERGE] packaging: Adapt for Python 3 and V11 2017-10-03 12:25:28 +02:00
Christophe Monniez aaa30a74b5 [imp] module,http: open manifest files as utf-8 in a python2/3 compatible way 2017-10-03 12:01:53 +02:00