Commit Graph
114949 Commits
Author SHA1 Message Date
Romain Derie b730de1978 [FIX] hr_expense: correctly set address_id for restricted user
New rights were applied on hr.employee with this commit https://github.com/odoo/odoo/commit/2d777d5ade94f4a80862608e2807660f289d9923

Since, users with limited rights would see a read error when submitting an
expense to manager.
Indeed, when clicking on "SUBMIT TO MANAGER", it opens the view form for
'hr.expense.sheet' that trigger an onchange on employee_id to set the
employee's private address to the expense.
Since restricted users can't read that field, the rpc call to that onchange
was throwing an error resulting in:
1. Showing an read error when entering form view that user could close to
   save anyway.
2. The hr.expense.sheet address would not be set as it should have

Now, we give sudo rights to read that field during the onchange

OPW-815786
2018-02-20 15:46:24 +01:00
Nicolas Martinelli 8876b8b3db [FIX] stock: validate picking in waiting state
When a picking is in 'Waiting Another Operation' state, there is no
possibility to force the validation. In v10, it was possible to force
the reservation, which is not possible anymore.

Therefore, we make the 'Validate' button accessible in the mentioned
state.

opw-817234
2018-02-20 15:44:18 +01:00
Martin Trigaux 05e18074cf [FIX] base_gengo: redirect to correct model
The configuration was moved to res.config

Fixes #23170
2018-02-20 15:44:01 +01:00
tbe-odoo 14081b848f [FIX] payment: Payment form not implemented on /website_payment/pay
The generic payment form introduced in 11.0 has changed the way we collect payment and so does the code.
The route /website_payment/pay hasn't been changed to support the new payment form.
This commit fixes this.

It also fixes a bug for when a customer tries to create two transactions with the same reference.
2018-02-20 15:36:56 +01:00
Simon Lejeune 7ed86b53cd [FIX] stock: immediate transfer and unreserved move
Before the patch, validating a picking where one of its move do not
have any quantity done nor quantity reserved resulted in the complete
validation of the said move. This doesn't make sense and does not do
what the help in the wizard indicate (process only *reserved* quantities).

We also use this patch to clarify what the tests on this workflow is
doing (test_immediate_validate_*). We completely replace the 3 as it was
testing the `force_assign` mechanism, which methods are still present in
v11 but unused. Instead this test is now testing the failing flow this
commit is fixing.

We thus adapt the `process` method of the immediate transfer to only
process the move lines (move line = reservation). We also fix a case
where nothing is reserved and nothing is done. In this case, the
backorder wizard should not opens but instead an UserError telling the
user to either cancel or process something. The testcase for this flow
is test_immediate_validate_7.

With these changes, the test `test_04_create_picking_update_saleorderline`
was failing because one of the items in the so lines was a stockable
product without stock. So before this patch, everything was processed,
now there's a backorder wizard. We complete the patch and duplicate it
with enough products in stock, so that the backorder wizard is not
needed.

opw-815056
opw-808126
2018-02-20 14:42:44 +01:00
Goffin Simon 980d786b09 [FIX] mrp_repair: cannot create a repair if not access to product.product
Steps to reproduce the bug:

- Connect as demo user
- Create a repair
- Add a product
- Save

Bug: An access error was raised because the demo user has no access rights
to write on product.product

opw:816645
2018-02-20 13:59:50 +01:00
Nicolas Martinelli 7c92417cba [FIX] base: copy VAT
When creating a company from a partner, copy the VAT number as well.

opw-808019
2018-02-20 13:23:41 +01:00
Nicolas Lempereur 64be3521ce [FIX] web_editor: don't format xml with script tag
It happens from time to time that someone use "Format" on the
web.layout template. Thus:

```
<script type="text/javascript">
  var odoo = {
      csrf_token: "<t t-esc="request.csrf_token(None)"/>",
  };
</script>
```

becomes:

```
<script type="text/javascript">
  var odoo = {
      csrf_token: "
  <t t-esc="request.csrf_token(None)"/>",
  };
</script>
```

breaking a number of things on the frontend and everything on the
backend.

On a pure javascript content, we could wrap it with:

```
//<![CDATA[
/* javascript content */
//]]>
```

but in this instance we still want the xml to be processed.

This commit avoids formatting XML containing a script tag.

opw-815865
closes #23164
2018-02-20 12:25:54 +01:00
Christophe Simonis bd16df15ea [MERGE] forward port branch saas-16 up to 98d01e46e5 2018-02-20 11:53:06 +01:00
Aaron Bohy 09323cc470 [FIX] web: editable list: leave edition
Before this rev., an issue occurred on grouped editable list views
that became ungrouped after a reload (i.e. when the grouped part in
the search view was removed). In this scenario, the click handler
outside the list used to leave the edition wasn't bound (because
the list was grouped at the beginning, and thus not editable). So,
it was impossible to leave the edition, even by clicking on 'Save'.

Fixes #23061
2018-02-20 11:34:03 +01:00
Christophe Simonis 98d01e46e5 [MERGE] forward port branch saas-15 up to 482370d014 2018-02-20 11:08:54 +01:00
Christophe Simonis 482370d014 [MERGE] forward port branch saas-14 up to 0571362d7a 2018-02-20 10:25:23 +01:00
Christophe Simonis 0571362d7a [MERGE] forward port branch 10.0 up to 1a8993e0cb 2018-02-20 10:24:15 +01:00
Aaron Bohy 297e3e4723 [FIX] web: WebClient: reload company logo after edition
This commit only concerns the community webclient. The user can
edit the company data by clicking on the company logo displayed
in the submenu (left bar). When it does, the logo's url must be
updated to force the logo to be reloaded.

The last part doesn't work since the new views, as it uses an
hook of the form view (called when it is saved) that doesn't
exist anymore.

This rev. adapts the code so that the logo is reloaded when the
edit menu dialog is closed.

It also ensures that the logo is properly reloaded by specifying
the timestamp in the img url as a query string parameter instead of
an hash param, since changing the hash doesn't seem to be enough to
fool the browser's cache anymore.
2018-02-20 10:19:08 +01:00
Odoo Translation Bot 54670bb149 [I18N] Update translation terms from Transifex 2018-02-20 09:46:32 +01:00
Goffin Simon 57223240cf [FIX] website_event: Duplicating event with a menu
Revert of 33e7c8d60c

The right problem has been fixed with 1a8993e0cb

opw:813270
2018-02-20 09:32:06 +01:00
Goffin Simon 1a8993e0cb [FIX] website_event: Duplicating event with a menu
When duplicating an event.event record with a menu_id, the duplicated
event had also a menu_id pointing to the first record.

opw:813270
2018-02-20 09:21:54 +01:00
Christophe Simonis 8b527229bf [MERGE] forward port branch saas-14 up to e3d39b0e5f 2018-02-19 19:01:54 +01:00
Romain Derie 96a10815ab [FIX] website: Editing the URL of a menu with an already existing URL
Before this commit:
If you changed the URL of a menu linked (m2o) to a website page and the new URL
was already taken by another page, it would edit the menu.url and the
menu.page.url resulting in the menu's page having the same URL than the already
existing one.

Now, if you edit the URL of a menu linked to a page and the URL is already
taken by another page, we will simply change the menu/page m2o relationship
without writing on the menu's initial page's URL.
2018-02-19 17:38:38 +01:00
Christophe Simonis e3d39b0e5f [MERGE] forward port branch 10.0 up to de62e33618 2018-02-19 17:07:29 +01:00
Goffin Simon ad12997263 [FIX] hr_expense: Creation of expenses for employees
An employee can only create expenses for himself.
Only the expense officers/managers can create expenses for other
employees.

opw:815963
2018-02-19 16:56:13 +01:00
Nicolas Lempereur 88a4c3b5bd [FIX] mail: IP domain name when linkifying
In chatter, also linkify URL with IP address as domain name like it may
be in other part of Odoo (eg. plaintext mail received).

With this change, an URL:

http://192.168.0.1:8069/web

would be linkified.

opw-816175
closes #23153
2018-02-19 16:40:21 +01:00
SEINLET Nicolas c3eb0c9621 [IMP] doc: update deploy guidelines
Set the longpolling request handling before the other ones, for a cleaner config

Closes #23158
2018-02-19 16:07:23 +01:00
Martin Trigaux 442673e40e [FIX] hr_payroll: take into account correct model description
The correct model description is set in hr_payroll.
The model does not change when installing a new module ("payroll run" was not
very meaningful anyway)
2018-02-19 16:04:06 +01:00
Martin Trigaux 5b88b1a961 [I18N] export 11.0 source terms
To reflect recent code changes
2018-02-19 15:46:33 +01:00
xmo-odoo 2c1b97e22b [IMP] base: make module fields !create
Trying to create a module through the interface will blow up as
computing the `desc` leads to a concatenation of the module's addons
path, the module's name and a hard-coded path, which does not work as
the module does not have a name yet. This creation attempt can be
performed as the admin through m2o fields.

Given said creation through the UI doesn't really make sense, disable
it on the relevant fields.

Fixes #23059
2018-02-19 15:02:38 +01:00
Yannick Tivisse 77fa9220d3 [FIX] l10n_be_hr_payroll: Remove warrants values on payslips
Purpose
=======

The warrants are not displayed on the same payslip than common salaries, and therefore it is confusing to see all the different concepts matched into the same payslip.
2018-02-19 14:56:18 +01:00
Yannick Tivisse 5d2217004a [FIX] l10n_be_hr_payroll: Update the warrant computation
Purpose
=======

Currently the warrant computation was made under a wrong basis.
2018-02-19 14:56:18 +01:00
Simon Lejeune 97ed2e730e [FIX] purchase, sale_stock: propagation of UOM
Before this commit, the uom defined on the sale order line and on the
purchase order line was propagated to the moves. This is not the
behaviour of v8-10 and may confuse the stock operator (one time he's
working in dozen, another time in units for example). It also leads to
rounding issues if the configuration is not adapted correctly (product's
uom is in units, sale order line is in dozen, the rouding precision on
the uom is left to their defaults, now if a dozen is partially available
there's a good chance converting back and forth form dozen to units will
break).

An ir.config_parameter was added to restore the behaviour before this
commit.
2018-02-19 14:29:09 +01:00
qsm-odoo de62e33618 [FIX] calendar, event: do not send emails to canceled attendees
Backport of https://github.com/odoo/odoo/commit/cf753a7fdf1739dcf37d2ad74f4c8efb3d4ff3b3
(it was finally considered as a real bug to fix in stable versions
from 10.0).

opw-769955
opw-814459
Closes https://github.com/odoo/odoo/pull/22882
2018-02-19 14:27:29 +01:00
Marius Stedjan 657fe7da71 [CLA] signature for willmakenoise
Closes #22946
2018-02-19 13:46:50 +01:00
xmo-odoo d28f8f704f [FIX] base: high memory usage in export
Overly attached cache's overhead turns out problematic. Clearing the
cache after batches of records keeps the cache overhead low and does
not change performances.

Explanations:

env.cache is 3 levels of maps {field: record_id: {env: value}}, where
env can be either an Environment or a pair (cr, uid) depending on the
field's dependency on the context or not.

This can be an issue when the current request loads many fields in an
enormous number of records in a single environment. The (PaaS) case
here was the export of a res.partner field from 36358 records in a single
environment[0]:

* prefetch expanded the single field to 68, leading the base `cache`
  to have 68 entries. getsizeof(d<len=68>) == 3360 (3kB, which we will
  soon see we can ignore entirely).
* *each* of these entries would hold a map of 36358
   records. getsizeof(d<len=36358>) = 3146016 (3MB), 68 times = 213MB.
* finally each record entry is also a {(cr, uid): value}, here the
  dicts have a single entry which makes them 280B, and their key is a
  2-tuple "worth" 72B, or 352B/record/field, or 352 * 36358 * 68 ~
  870MB[1].

For a total of ~1GB, which is roughly the issue we can observe.

Future possibilities: extract the cache-clearing iterator to be more generic 
and available on BaseModel directly? Or even make the default iterator 
batched & cache-clearing?

[0] note that sys.getsizeof only provides the size of the object it's
    called on, it is not recursive

[1] slightly more in actuality as there's some variation between the
    leaves depending on the field type e.g. M2O values are a 1-tuple
    adding 60B, ...

Fixes #22475
2018-02-19 13:46:26 +01:00
Subodh Dahal 668a090df3 [CLA] signature for SubodhDahal
Closes #22970
2018-02-19 13:42:03 +01:00
Olivier Sarrat d504027bfa [CLA] signature for osarrat
Closes #23113
2018-02-19 13:39:50 +01:00
Christophe Simonis da881b0bd2 [MERGE] forward port branch 9.0 up to 5d086cea9b 2018-02-19 13:25:05 +01:00
Xavier Morel f1143b4073 [FIX] doc: tokenization of nested generics in JS docstrings
With more than 1 level of generic type, the "closure" of generic
parameters would get tokenized by python as a single right shift (>>)
rather than two gt (>, >) leading to our own tokenizing pass getting
lost and blowing up.

Fix by explicitly recognizing and splitting (>>) into (>, >). We could
consider writing the entire tokenizer ourselves instead of
post-processing Python's but given the entire post-processing function
is currently shorter than just Pythons' tokenizer's regexes...

Anyway issue found by vsc while trying to write better docstrings.
2018-02-19 13:22:58 +01:00
qsm-odoo 57c99a690c [FIX] sales_team: properly show group-by-week graph data for 2018 year
Since the new year, the graphs in sale dashboards were not displayed
properly when grouped by week. This was because the computation of the
number of weeks in 2018 gave "1" as a result as this was got from the
week number of 31/12/2018 which is in fact in the first week of the
ISO year 2019.

This commit solves the problem by using the 28/12/xxxx which is always
in the last week of ISO years.

opw-816758
2018-02-19 12:10:41 +01:00
David Arnold 5d086cea9b [FIX] rpc: correctly handle xmlrpclib.Fault
The error string was always missing, despite being provided.

Backport in #22276 courtesy of Yenthe V.G

Fixes #13111
Closes #21741
Closes #22276
2018-02-19 11:15:04 +01:00
David Arnold ca36c0542c [CLA] signature for XOE and blaggacao
Backport of de803378f1 from 10.0,
in order to allow PRs in 9.0

Closes #19210
2018-02-19 11:15:03 +01:00
Xavier Morel fc55d649d6 [FIX] base: don't recompute while performing the bulk of the unlink
If a record is deleted *and* has property fields, the deletion of the
property fields will trigger the various recomputes before the record
itself has actually been deleted, and thus stuff which depend(ed) on
that record will be recomputed under the assumption that the record
still exists, which probably will not work.

Under the assumption that the same issue would occur when deleting
more than one batch of records (unlinking the data, values or
attachment would also trigger a recompute before the proper end of the
function and could lead to incoherence, e.g. some of the records being
deleted being visible to recomputes), lift the entire effective body
of the unlink into a norecompute context, to ensure that only the very
final recompute (from the top-level unlink) is actually triggered.

opw-807036
2018-02-19 10:48:30 +01:00
Xavier Morel a583a56324 [FIX] base, web: don't fold M2M when not in import compatible mode
Before this commit, if the first exported field of an M2M is `id` (the
xid) the entire M2M is folded into a single cell with comma-separated
xids and any following field is ignored. If `id` is any but the first
field, the export behaves normally (with the m2m exported as a "table"
inside the parent record).

This behaviour makes sense for import-compatible exports where the id
is the only thing which can be exported anyway, but it is troublesome
outside of that mode as the behaviour of m2m under export becomes
incoherent/unpredictable (ish) as it depends on the position of the
m2m's `id` in the exports list.

Change it so we only perform folding in import-compatible mode (which
is the default for backwards compatibility with e.g. API calling
export_data directly & the like).

opw-813361

Fixes #22600
2018-02-19 10:43:15 +01:00
tbe-odoo 825180867a [FIX] hr_holidays: Remove related on employee's department
- In SaaS-16 we have added a related on the employee's department.
    This causes access rights issues when changing the employee's department.
    We do not want to rewrite all the old records, only the new ones should use the new employee's department.
2018-02-19 10:39:04 +01:00
Goffin Simon 5c1f025a42 [FIX] sale_timesheet: Field Invoicing Policy in Product Variants not saved correctly
When a product variant from Catalog > Product variant was created
with invoice policy = 'delivery', it was set as 'order'.

opw:815112
2018-02-19 10:24:36 +01:00
David Arnold 906a9af8f2 [FIX] bus: set timeout to gracefully recover
Before this in the event of a network failure that lasts longer than the respective return cycle of the deferred call,
this deferred will keep in purgatory forever (until reload of the client).
This is not problematic in the normal use case, but working with offline modules, such as POS or similar making use of the
long polling concept for synchronization purposes, this generates toxic behavior.
Simply: The client state never recovers on it's own from the network failure

(PR #21653)
2018-02-19 10:05:50 +01:00
David Arnold 59202d5e8c [FIX] bus: set timeout to gracefully recover
Before this in the event of a network failure that lasts longer than the respective return cycle of the deferred call,
this deferred will keep in purgatory forever (until reload of the client).
This is not problematic in the normal use case, but working with offline modules, such as POS or similar making use of the
long polling concept for synchronization purposes, this generates toxic behavior.
Simply: The client state never recovers on it's own from the network failure

(PR #21653)
2018-02-19 09:59:01 +01:00
Xavier Morel 965f492018 [FIX] website: don't include empty keyword & description metas
Apparently, SEO audit thingies (possibly google's own? unclear) don't
ignore *empty* keyword or description meta tags, then complain that
they're duplicated (there's a use case for SQL-like nulls).

So remove the keyword & description metas entirely if the
corresponding fields are empty.

OPW-815492
2018-02-19 09:47:28 +01:00
Jordi Ballester Alomar 5404b8b4e7 [FIX] doc: update default values
limit_memory_soft and limit_memory_hard had values default different that the
ones written in the documentation

Introduced at 3ef93918a

Closes #23131
2018-02-19 08:52:14 +01:00
Odoo Translation Bot 0be75775de [I18N] Update translation terms from Transifex 2018-02-18 04:28:35 +01:00
Odoo Translation Bot 40aedd74a3 [I18N] Update translation terms from Transifex 2018-02-18 01:04:11 +01:00
Joren Van Onder f76cc095b8 [FIX] point_of_sale: fix the behavior of default fiscal positions
Issue 1) and 3) in 73f7567627 still
occured in 11.0. It seems this was not fully forward-ported, most
likely due to conflicts caused by
ac89783d2f.

opw-782855
2018-02-16 13:48:59 -08:00