Commit Graph
116425 Commits
Author SHA1 Message Date
Kinjal Mehta 026be48ccb [FIX] purchase: "product_type" related field on po line
Issue:
Currently, since "product_type" is not set readonly, it is triggering write() of product.product
model when saving a PO having PO line with product_id. And it is failing by throwing access error
for users belonging to purchase "User" group users due to the fact that write() is permissible to
purchase "Manager" group users only.

Solution:
Made the "product_type" related field readonly since it is used in purchase order views domain
with lone purpose to set "received_qty" field non-editable when order line product is of type
stockable/consumable.

task id 1818787
2018-04-16 16:00:46 +02:00
Odoo Translation Bot cc583a4ab2 [I18N] Update translation terms from Transifex 2018-04-15 07:03:16 +02:00
Géry Debongnie 1d8466ab54 [FIX] mail: prevent race conditions in discuss
The discuss application starting process is strongly asynchronous.
However, it relies implicitely on the fact that the widget is not
destroyed in its starting process.  For example, if the widget is
detroyed before the updateChannel method is called, then any call to the
chat manager service will return undefined and the widget will crash.

When discuss is destroyed exactly between the start and the end of the
creation of its search view (which is asynchronous), then it is possible
to have a crash, because the search view will be destroyed when the
do_search method is called.

Note that we had to fix discuss mobile as well:
The _setChannel method is supposed to return a deferred, but the mobile
override did not return it.  As a result, a test in the mobile suite
failed because this.alive takes a deferred in argument.
2018-04-13 17:14:49 +02:00
Alexandre Kühn 8bdc650f79 [FIX] web: always update breadcrumb on change title
Revision on https://github.com/odoo/odoo/commit/32b8cec5361174c92c45a4975d4e02f1fb448aa2

Before this commit, when we switch channels in the Discuss app, the breadcrumb
was visually not updated: it keeps the name of the first opened channel.

With this commit, the breadcrumb is updated on each change of channel, so that
it displays the name of the currently opened channel.

Technical details:

	This is due to a change of logic of updating the GUI of the breadcrumb:
	before the refactoring above, discuss had to pass the content of the
	breadcrumb to the control panel, in order to update the breadcrumb visually.

	After the refactoring, the action manager should warn the control panel to
	update the breadcrumb on any change of the title. This is already the case
	for `ir.actions.act_window`, but not for all types of client actions.
2018-04-13 16:21:58 +02:00
Nicolas Martinelli 3b158b65c1 [FIX] analytic, hr_timesheet: recompute order
When creating a timesheet, several fields need to be recomputed:
- `currency_id`
- `group_id`
- `department_id`
- `is_timesheet`
- `validated`

When `validated` is computed before the other fields, the recomputation
will lead to an `AccessError` because of the rule
`hr_timesheet.timesheet_line_rule_user`.

Since the test `test_timesheet_validation_user` expects an
`AccessError`, the test succeeds. However, from time to time,
`validated` is computed last => the `AccessError` is not raised.

Actually, a `ValidationError` should be raised in this case (from the
`create` override in `timesheet_grid`).

This commit is a cherry-pick of 802339c12d
and dcca2e8b9d
2018-04-13 10:47:11 +02:00
Géry Debongnie 2f16d6bfe3 [FIX] web: prevent destroyed widget from calling start
Whenever a widget is destroyed, it should be as inactive as possible.
Before this commit, it could happen that a widget was destroyed after
the willstart method, but before the start method. In that case, bad
things could happen.

For example, the discuss client action tries to look up some information
into the session, with the getSession method. This causes a crash
whenever the widget is destroyed.
2018-04-12 11:27:20 +02:00
Géry Debongnie 473edda86e [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
2018-04-12 11:27:15 +02:00
Géry Debongnie d5f6d1eb4a [FIX] web: prevent race condition with client actions
Here is the issue that initiated this work: the bank reconciliation tour
sometimes failed in community.  The reason was that the discuss client
action seemed to be loaded after the tour started, and interfered with
the second step of the tour.

What happened exactly was the following:
- web client is loaded
- initial action is starting (but not complete) (this is discuss)
- tour manager is loaded and starts the reconciliation tour
- the reconciliation tour changes the url to trigger an hash change
- the web client calls loadState on the action manager
- the action manager perform a doAction with the tour url
- the discuss client action is now ready, and replace the reconciliation
  action
- the tour is broken.

The underlying cause is really a generic problem: the action manager
does not add the client action starting process in its 'dropprevious'
concurrency primitive.  This is probably not really an issue for the
act_window actions, since they have custom loading code that make sure
the loading process is put in the drop previous, but it is definitely a
problem for all client actions.

The solution is quite simple, and should also protect the act window
renderers: put the action controller in the drop previous
2018-04-12 11:25:31 +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
Romain Derie 474f6cfdd8 [FIX] web_editor: changes lost on forward port of 744af2db
Fix of 744af2db that got lost during forward port, this is just rewriting the
diff for the new widget syntax.
2018-04-11 15:02:11 +02:00
Thibault Delavallée 2d19c4c6b8 [FIX] mail: raise a missing email error instead of crash when logging without email
Currently when posting a message if the author has no email address an user
error is raised. Indeed as posting a message goes through the process of
creating notifications and sending emails an email address is required on
the user.

In saas 11.2 a _message_log shortcut has been added to log notes. This
method should have the same behavior when author has no email. Currently
there is a crash when trying to encode its email. After this commit an
exceptions is raised like classic post.

This commit is related to task ID 1823990 .
2018-04-10 14:45:33 +02:00
Nikunj Ladava b7f43f265d [FIX] mass_mailing: allow multiple recipients in mailing
Commit 0cd656b5af improved onboarding of mass mailing application. Notably
mailing domain computation has been improved. However rewriting has not been
done correctly as there were strange formatting and encoding. This commit
fixes the issue and correctly uses a list to format a domain like expected.

This commit is related to task Id 1831211. Closes #23883 .
2018-04-10 14:09:17 +02:00
Thibault Delavallée 81a0852077 [IMP] test_mail: set a margin on some mail-related performance tests
Query count for some mail tests is not always the same for a given test.
This leads notably to runbot being randomly red although there is no real
error. This commit lessen the issue of having red runbot or wrongly
incremented tests by using the recently-introduced margin parameter on
performance tests.

Some work is still ongoing to find why some tests are not completely
reproducible. In the meantime let us have some warnings instead of errors.
2018-04-09 16:52:12 +02:00
Thibault Delavallée 3fe0ee5ae6 [IMP] tests: allow to add a margin on performance tests
Purpose of this commit is to avoid errors for some performance tests that
have a slightly variable number of queries. Indeed some tests in test_mail
module vary of 1 or 2 queries due to a behavior still not found that does
not seem deterministic.

This should not be considered as a real error, but should not be considered
as completely valid. This is why a margin is accepted in some tests that
will raise a warning instead of an error. This warning tells people to
check if they have increased the query counter or if it is due to a random
effect in query count.
2018-04-09 16:52:12 +02:00
Thibault Delavallée 3bb498d696 [REVERT] "[IMP] core: tolerate a 10% deviation for number of queries"
This reverts commit d565596868. Indeed whole purpose of having tests
based on query counters is to fail every time query count is greater than
expected. Query count could be greater than expected because
 * either it is required by a bug fix or a feature and tests should be
   updated accordingly in the same commit;
 * either implementation can be improved to avoid or lessen query count
   impact and code should be updated accordingly;
 * either we have some random queries due to nondeterministic behavior;

It seems purpose of the commit was to solve the third case. However we think
hiding first two cases can be dangerous compared to solving third case.
Moreover having a threshold of 10% does not make sense. It means some complex
test case could take 30 queries more without being noticed. Some tests could
fail after several commits adding queries and finding them afterwards could
be complicated.

Another solution based on flagging some tests that have a small random
behavior will come soon.
2018-04-09 16:52:12 +02:00
Martin Geubelle 7c936c68f9 [FIX] web: forward-port
The rev. odoo/odoo@6397ce7 has not been correctly foward-ported.
The view option `sidebar` has been renamed `hasSidebar` in odoo/odoo@32b8cec
2018-04-09 15:11:29 +02:00
Odoo Translation Bot 5864fa7896 [I18N] Update translation terms from Transifex 2018-04-08 07:06:57 +02:00
Christophe Simonis d565596868 [IMP] core: tolerate a 10% deviation for number of queries 2018-04-06 18:39:51 +02:00
Christophe Simonis 55c5ac63a3 [MERGE] forward port branch 11.0 up to 00ef138ce0 2018-04-06 18:28:45 +02:00
Christophe Simonis 00ef138ce0 [REVERT] point_of_sale: change back to a write() to change company currency
This test being run during install, thih does not provoque any problems
as no CoA are already installed.

This partially revert commit b11621476b
2018-04-06 17:52:21 +02:00
jem-odoo 25912970ce [FIX] sale: name_get of SO line
This commit format the display_name of sale.order.line,
without context key.
The webclient trigger the name_search with context
key, but display the field without it.
So on task form view, when searching an SO line, user
will see 'SO0001 - my product' in its dropdown, but the
complete SO line description when saving.
This commit proposes, in aggreement with AL and FP, to
a global (and non conditionnal) format, since it seems
task form view is the only one place requiring the SO
line name_get.
2018-04-06 16:40:41 +02:00
Christophe Simonis 43509423e3 [FIX] account_cash_basis_base_account: adapt view to renamed field 2018-04-06 16:08:10 +02:00
Christophe Simonis 91a075fb3d [FIX] account_cash_basis_base_account: python3 compatible imports 2018-04-06 15:38:16 +02:00
Christophe Simonis 860dfb5586 [MERGE] forward port branch 11.0 up to d277adf4d5 2018-04-06 15:36:10 +02:00
Nicolas Martinelli d277adf4d5 [FIX] l10n_fr_pos_cert: import api
Following forward-port.
2018-04-06 15:05:18 +02:00
Christophe Simonis c94d30541c [MERGE] forward port branch saas-15 up to 97a70c2d8e 2018-04-06 14:33:40 +02:00
Christophe Simonis 97a70c2d8e [MERGE] forward port branch saas-14 up to 5eb6e14e85 2018-04-06 13:43:57 +02:00
Christophe Simonis 5eb6e14e85 [MERGE] forward port branch 10.0 up to e5fd52d28c 2018-04-06 13:40:40 +02:00
Denis Roussel e5fd52d28c [FIX] purchase: button_approve in a multi recordset fails
Closes #24079
2018-04-06 11:36:04 +02:00
tfo 990b7356b6 [CLA] Wink signs CCLA
Done at #24083
2018-04-06 11:23:13 +02:00
Christophe Simonis 76131b7970 [MERGE] forward port branch 10.0 up to ea42f6c176 2018-04-06 10:35:25 +02:00
Nicolas Martinelli ea42f6c176 [FIX] account: missing decorator 2018-04-06 09:44:47 +02:00
Alexis de Lattre c41f7297d3 [FIX] report: create a new environment
self is a rml_parse instance, not a BaseModel
create new environment to call ORM methods
prevent crash when calling formatLang on a RML report

Closes #24068
2018-04-06 09:27:35 +02:00
Olivier Dony 3f975f9769 [FIX] account_payment: make partner_id required only when draft
When not draft, the partner_id field is readonly and cannot be modified
anyway, but it makes the form invalid, so form buttons cannot be used,
e.g. to access the journal items, etc.
2018-04-06 08:51:54 +02:00
Olivier Dony f5b00c11dd [FIX] account_payment: properly compute destination account without partner
When the `partner_id` is not set (it is not required at the model
level), we can still compute the default destination account based on
the company chart of account configuration.

This is necessary to allow creating "customer" or "supplier" payments without
selecting a specific partner.
2018-04-06 08:44:34 +02:00
Christophe Simonis 91ea17af5f [MERGE] forward port branch 10.0 up to a93a5c6824 2018-04-05 19:40:54 +02:00
Christophe Simonis a93a5c6824 [MERGE] forward port branch 9.0 up to 27162b0e73 2018-04-05 19:35:27 +02:00
Christophe Simonis 82f45063c0 [FIX] account_cash_basis_base_account: use correct inherited view
Oversight of previous oversight of previous forward-port.
2018-04-05 17:45:12 +02:00
Romain Derie 27162b0e73 [FIX] website_blog: optimize crawler prevention
Commit d39856db prevents crawler to crawl and index blog tag URL which could
lead to possibly millions of URLs combinaison.

Still, it would crawl (but not index) second level of tags combinaison.

This commit ensure that crawling is prevented when already one tag on the URL.
2018-04-05 17:40:30 +02:00
Christophe Simonis ef3ad219de [FIX] account_cash_basis_base_account: correct dependency
Module `account_tax_cash_basis` has been merged into `account` in
saas~14.

Oversight of previous forward-port.
2018-04-05 17:21:06 +02:00
Alexandre Kühn 9a9da5763b [FIX] web: no record abandon on discard from default_get/onchange
Before this commit, when some records were created from an `onchange`,
we have the following weird behaviour:

    Suppose that this record has some required fields that are empty.
    When we click on this record, then somewhere else, the record
    disappears from the list.

This is because the records contains invalid fields, and it is wrongfully
assuming that the record to be discarded comes from "Add an item".

A previous commit [1] fixed a bit this issue with `default_get`, but since
it relied on a fragile heuristic, we decide to apply the correct fix with
this commit.

[1] https://github.com/odoo/odoo/commit/b09f0c99be2b13d33986414485556d87da186d65
2018-04-05 17:14:57 +02:00
Romain Derie d39856dbe8 [FIX] website_blog: prevent crawler on multiple blog tags page
Before this commit:
If a blog had multiple tags on the page, the crawler would click on every one
of them one after another until every tags combination got crawled.
With a lot of tags, this could result in million of URLs.

Now, we prevent URLs with more than one tag to be crawled.

Eg: With tags 'A', 'B', C':
/A
/A/B
/A/C
/A/B/C
/A/C/B

/B
/B/A
/B/C
/B/A/C
/B/C/A

/C
/C/A
/C/B
/C/A/B
/C/B/A
2018-04-05 16:55:58 +02:00
Christophe Simonis ff46163bca [MERGE] forward port branch 10.0 up to f4326b4dab 2018-04-05 16:21:23 +02:00
Martin Trigaux 282605a8fc [FIX] website_blog: cut teaser after 150 chars
Space as word separator does not work in some non-latin languages like Japanese.
Cut arbitrarily after 150 chars

Closes #23219
2018-04-05 16:17:29 +02:00
Florent de Labarre f8ade1c96d [FIX] stock: To avoid singleton error
Execute on a single record is used when calling the function
_update_line_quantity and avoid singleton error

Closes #23860
2018-04-05 14:48:53 +02:00
Andreas Perhab 115b9616c1 [FIX] doc: remove not existent attribute
color is not accepted by rng on gantt views
copy-paste the code would not work

Closes #24055
2018-04-05 14:42:54 +02:00
Christophe Simonis f4326b4dab [MERGE] forward port branch 9.0 up to eaf54656fc 2018-04-05 14:39:37 +02:00
Lucas Perais (lpe) e05b2d01d1 [FIX] hr_recruitment: email from in template should be safe
Create a hr.attendant in a stage where a mail template is present.
Fill the email field as: Name Surname <name@surname.com>

Before this commit:
- the created partner's email has been rendered as name@surname.com&gt;
- the email failed to be sended because of this

This was because Jinja rendered that snippet escaping the special characters
Putting a 'pipe' safe in the snippet does the trick

After this commit:
both the partner and the email are created successfuly

OPW 1830739
closes #24059
2018-04-05 13:35:30 +02:00
Xavier Morel 4e784adbf7 [FIX] doc: non-module JS autodocumenters
Also when there is both a docstring and directive-level content put
the docstring first. That seems to match what Sphinx's autodoc does
and looks less odd.

Possible future improvement: a parameter to suppress the docstring?
Possibly a way to reorder the non-docstring content (e.g. members
documentation)?
2018-04-05 12:31:27 +02:00
Nicolas Martinelli 9b6ca49b58 [FIX] http: Bokmål language code
- Install Website
- Load the 'Norwegian Bokmål' translation, and choose to translate the
  website
- Logout

When accessing the website, the language displayed is not consistent to
the browser language.
1. `no` shows homepage in `nb_NO` (Firefox only) => expected since
    Bokmål is the main language in Norway
2. `nb` shows homepage in `en_US` => unexpected
3. `nn` shows homepage in `en_US` => expected since 'Norwegian Nynorsk'
   is not a language available (this will be the topic of another PR)

The issues comes from Babel's side, since `nb` is not in the
`LOCALE_ALIASES` while `no` is. We monkey-patch the value to avoid this
while Babel is corrected.

opw-1827258
2018-04-05 11:01:11 +02:00