Commit Graph
115693 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 20f5f625f4 [FIX] pad: prevent concat bool and string
Before installing pads, create a second company
On the first company, create a task and initialize its pad

Switch companies and try to edit the task

Before this commit:
There is a traceback because since the pad credentials of the second company are not set,
the url cannot be computed

After this commit, we prevent the Null field to concat with a string
hence there is no traceback

OPW 1837059
closes #24263
2018-04-18 11:03:22 +02:00
Nicolas Martinelli ffdfbed42c [FIX] calendar: avoid memory overflow
On a DB with thousands of events including recurring ones, fetching the
complete list of events might lead to a memory overflow due to the
prefetching of all virtual events.

We reduce the memory footprint by handling no more than 50,000 records
at a time and clearing the cache at each step. This limit is purely
arbitrary, but seems to be a good compromise between performance and
memory usage.

opw-1832482
2018-04-18 08:17:50 +02:00
Alexandre Kühn b15e805b5a [FIX] board,web: edit custom views in place
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.

This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.

With this commit, custom views are edited in place.

Fixes #23712
2018-04-17 17:28:49 +02:00
Martin Geubelle cd934f307d [FIX] web: handle x2m commands with reference as default
Before this rev. it was not possible to define a value for a reference field
in x2m commands as default value.

Courtesy of @kaerdsar.

Closes #24070
2018-04-17 15:31:33 +02:00
Martin Geubelle 9e6c616130 [FIX] web: focus select in reference widget
In the reference widget, the focus was always on the input (many2one) even
though the first select (with the model) was not set.

Thanks to @kaerdsar for the original PR.

Partially closes #24070
2018-04-17 15:31:32 +02:00
Lucas Perais (lpe) df02dc37fd [FIX] web: pivot: correctly save and restore groupbys on rows and cols
On a pivot view expand a field in column
another one in row
Then put a domain in the search view
Save the whole thing (ir.filter) as favorite

Before this commit, the ir.filter was not saved the right way when a domain was present
(Let alone its restoration)
This was because of
- the internal default groupbys of the pivot model was not updated, and what we got in the params was overwritten
by what existed before
- a slight typo in the code made the row updated with the col values

OPW 1835865
OPW 1829925

closes #24215
2018-04-17 13:43:46 +02:00
Yannick Tivisse b5d026be7f [FIX] l10n_be_hr_payroll_fleet: Don't display costs in model name
This is confusing for end users because on the fleet form/kanban view the
model is displayed. The information displayed in the name is the default
depreciated cost on the model. But in reality the depreciated cost of the
car could be different.
2018-04-17 13:29:04 +02:00
len-odoo ec02710b86 [FIX]mrp: Byproducts are produced twice
When producing a byproduct in a BoM, the quantity for the byproduct was
increased by twice its produced quantity.

This is essentially a revert of commit d7fdb636b8
which was erroneously forward-ported to 11.0,
where byproducts were already correctly counted.

opw:1834226
2018-04-17 11:40:19 +02:00
Nicolas Martinelli 8456f425bc [FIX] stock: company on Procurement Rules
Add the `company_id` field on the `procurement.rule` form view, and set
the default value to be the company of the `stock.location.route`.

opw-1824570
2018-04-17 11:05:27 +02:00
Christophe Matthieu b26ad79a8c [FIX] web_editor,mail: send email's attachments without write access
Before this fix, when a user don't have write access on a document, he
can't send an email with attachment because, the attachments is added on
the document.

The change improving security was introduced by the commit:
https://github.com/odoo/odoo/commit/6494f511718893eec3573c60c0a62e04d386359d

With this fix, for mail, the attachments is added on the
'mail.compose.message' and re-render the fields attachments displayed in
the current view. This change respect the access rules like all others
attachment of 'mail.compose.message' (can send an email when the user have
read access on the document).
The media dialog of the html widget display all documents attachments and
the added attachments Allowing users to use these in the body of their
message.
2018-04-17 09:26:06 +02:00
Wolfgang Taferner 3310d842f6 [FIX] sale: wrong key was communicating wrong references 2018-04-17 09:24:24 +02:00
Géry Debongnie 48515d3c2e [FIX] web: fix issue with initial action in web client
Here is a scenario that could happen before this commit:
1. web client is started
2. it binds a callback on hashchange
3. it performs some async work (read initial action for user)
4. the user (or more likely, a tour) changes the url
5. the hashchange handler is called, and it starts a new action
6. the async work for the web client is over, it then executes the
default action and/or clicks on the first menu
7. we are now in the default action state, instead of the desired action
state (the one from the new url)

With this fix, we simply do nothing when there was an hashchange before
the initial action was done.
2018-04-17 09:05:42 +02:00
Olivier Dony 58c45bdf4d [IMP] doc: setup/deploy: add security recommendations
Extra recommendations about remote SSH access and demo data on
internet-facing servers, in light of issue #24120.
2018-04-17 02:40:18 +02:00
Toufik Benjaa cb6e3b9b76 [FIX] account_payment: make partner_type required only when draft
As for commit 3f975f9769, the partner_type field is readonly and cannot be modified when not in draft.
It makes the form invalid, so form buttons cannot be used, e.g. to access the journal items, etc.
2018-04-16 18:52:31 +02:00
Christophe Simonis ad825b673b [MERGE] forward port branch saas-15 up to bfa5af45df 2018-04-16 17:10:23 +02:00
Florent de Labarre b7e47be012 [FIX] stock: remove wrong decorator
Was probably introduced during a forward-port as was correctly changed at 8df0a2a98e

Closes #24238
2018-04-16 16:59:36 +02:00
Toufik Benjaa 904c2e5112 [FIX] payment: Portal payment were not saving tokens
- Portal payement is not respecting the option to save tokens after payments.
2018-04-16 15:20:15 +02:00
Nicolas Lempereur 7680635c54 [FIX] web: setDate mixing utc+tz and local date
In the calendar view there is some mixing of moment with:

- a local date with given timezone
- a UTC date with added timezone manually applied

The setDate function of calendar model sometimes received either of the
two types, and always transforms them to UTC date with added timezone.

This cause eg. the following issues:

- in the minicalendar, if we click on a day (eg. 12) the day highlighed
  will be the one of 12th at midnight with timezone applied. So with a
  negative timezone the 11th would be highlighted in the mini calendar
  (but the 12th would still be the day shown).

- if we change scale (week/day/month) or open calendar or use next or
  previous button: we call `setDate` with a UTC+timezone moment. So each
  time this is done, we get an additional timezone

  eg. when opening the calendar view on the 12th at 5:00 with GMT-0200:
      -> the target date is 12th at 1:00
      -> if we set the day mode: target date is 11th at 23:00
      -> if we set the week mode: target date is 11th at 21:00

With this change we keep target_date and highlight_date as local date so
setDate always receives a local date and jquery-ui DatePicker gets the
date in the expected format.

opw-1831368
closes #24188
2018-04-16 00:22:18 -12:00
Christophe Simonis bfa5af45df [MERGE] forward port branch saas-14 up to aab0908818 2018-04-16 14:21:00 +02:00
Nicolas Martinelli 620a6f4557 [FIX] stock: change product on S/N
Do not allow to change the product on a serial/lot number for a product
which has existing stock moves. Doing so would screw up the traceability
report.

opw-1832452
2018-04-16 14:20:44 +02:00
Martin Trigaux a87dc3111c [IMP] doc: specify the API examples are in python2
Odoo 11 is python 3 but the xmlrpc interface works with python 2 too.
The example should probably be migrated to use python 3.
In the meantime specify exactly these examples are python 2 to avoid the
confusion.

Fixes #24232
2018-04-17 13:59:50 +02:00
Christophe Simonis aab0908818 [MERGE] forward port branch 10.0 up to c92d43c04b 2018-04-16 12:33:49 +02:00
Christophe Simonis c92d43c04b [MERGE] forward port branch 9.0 up to 752dcc761c 2018-04-16 12:05:35 +02:00
Kirti Choudhary aaadfd7d76 [FIX] sale: income account in invoice with down payments
When creating an invoice with 'Down payment' option for an SO, it should
first consider income account of the 'Deposit Product'. if it does not
have one then it should consider that product category's income account.

Fixes #23100
Task# 1819531
2018-04-16 11:35:29 +02:00
Simon Lejeune b8133aa64b [REM] stock_account: valuation stat button
Remove the valuation stat button as we say that from now on, to
understand the current value of a product, you should go through the
valuation ation and its stat button.
2018-04-16 11:26:49 +02:00
Simon Lejeune 352875a5a0 [REF] stock_account: valuation at date wizard
We add the valuation at date wizard by re-using the quantity at date
wizard and adding a context key to separate the both.

The same view/action is used when openning the current or at date
valuation, only the `to_date` context key is changed.
2018-04-16 11:26:49 +02:00
Simon Lejeune 3a8281175d [REF] stock_account: support valuation at date
For the standard and average cost method, we use `qty_available` at date
and the `product.price.history` table.

For FIFO, the normal way would have been to get the `qty_available` at
date and value this quantity with the more recent IN moves at this date.

But there's two main obstacles preventing to use this solution:
- when editing a done move to change the quantity, the change is
  reflected at the date, the `qty_available` at date will be incremented
- in the same usecase, the remaining_qty and remaining_value is
  incremented in place, which mean that even if the layer was already
  consumed, it's now appearing again at the bottom of the fifo layer

Fixing this issue by adding a stock move at the date of today instead of
editing in place in v11 and adding a proper "cost layer" model in master
was deemed too complex as well as unnecessary by our bosses

So we now say we continue to update in place, and when looking at the
quantity at date
- if periodic, we sum the value of the move since the beginning of times
- if perpetual, we sum the balance of the account move lines since the
  beginning of times. Also, in this case, the quantity at date is
  computed across account move lines too, via the "quantity" field on
  aml.

This commit adds three non stored computed field:
- qty_at_date: will be computed across stock moves if fifo periodic and
  across account move line if fifo perpetual to reflect the design
  choice: if periodic, we *really* edit in the past ; if perpetual, no,
  the change is done at today's date
- stock_fifo_real_time_aml_ids: the used aml to compute qty_at_date
- stock_fifo_manual_move_ids: the used move to compute qty_at_date
2018-04-16 11:26:49 +02:00
Simon Lejeune 0eec54cae0 [FIX] stock_account: stock_value and depends
stock value should be recomputed when the standard price change

it is not optimal since it is updated in fifo after a delivery but
needed when working with standard cost method

remaining_value should also be part of the depends since the current
value depends on it
2018-04-16 11:26:49 +02:00
Simon Lejeune 348c371ee8 [REF] stock_account, stock_landed_costs: quantity field on account.move.line
Properly set the quantity field on the account move lines when
exceptions happen (unlock and edit: only the difference is set as
quantity, negative stock and vacuum: no quantity should be set).

When applying a landed cost, no quantty should be set neither.

This is a preliminary work to bring the valuation at date wizard to v11.
2018-04-16 11:26:49 +02:00
Simon Lejeune 704f5c9e00 [REF] stock_account: move's value and exceptions
Update the value on the moves when exceptions happen (unlock and edit,
negative stock).

This is a preliminary work to bring the valuation at date wizard to v11.

We also update the value on moves in the standard cost method to stay
consistent.

- `_run_fifo` now returns the used value in the negative stock case
- we simplify the `_fifo_vacuum` method so that the `remaining_value`
  always represent the not yet compensated value
- we adapt the tests to reflect theses changes ; the value is not the
  initial valued amount but is updated upon exceptions
2018-04-16 11:26:49 +02:00
Christophe Simonis 752dcc761c [IMP] core: load geoip2 database by default 2018-04-16 11:20:39 +02:00
Christophe Simonis 264398de3e [IMP] website: handle geoip2 databases
Since April 1, 2018, free versions of GeoLite Legac y databases are no
longer updated and free downloads not available [1].

[1] https://support.maxmind.com/geolite-legacy-discontinuation-notice/
2018-04-16 11:20:39 +02:00
Christophe Simonis 412501a5dc [MERGE] forward port branch 10.0 up to 7147622665 2018-04-16 11:18:08 +02:00
Nicolas Martinelli 3efa5b01b4 [FIX] account: default taxes
Make sure the variable is casted to an integer when getting taxes.

opw-1830862
2018-04-16 10:29:54 +02:00
Kiril Vangelovski ff07f078fa [FIX] base: reason json payload using get_data
Replace `httprequest.stream.read()` by `httprequest.get_data()` so the
payload content remains available: get_data stores the request body (by
default) so it remains available for alternative processing or checks
(MAC checks for webhook validations for instance). With `stream.read()`,
once the data is read if it's not stored separately it is lost.
2018-04-16 10:29:13 +02:00
Christophe Simonis 7147622665 [MERGE] forward port branch 9.0 up to 8c0b23c239 2018-04-16 10:28:42 +02:00
Lucas Perais (lpe) 7a2cba3c89 [FIX] project: subtasks should be taken into account even if archived
Have a task (A) with two subtasks (B and C)
Archive C

Before this commit, when using timesheets, the task A hours was misconputed and did not take C's timesheet into account

After this commit, hours are accounted for even if their task is archived

OPW 1829658
closes #23920
2018-04-16 10:03:08 +02:00
len-odoo 1ae1cac9ae [FIX] stock: set procurement time to noon to avoid timezones changing the date
If a user set a procurement to the day N, the procurement datetime field would
be set to day N at midnight. So any negative timezone make it appear that the
procurement is set to day N-1.

opw 1831272
2018-04-16 08:58:00 +02:00
Aaron Bohy 71087021f7 [FIX] web: DatePicker: open when clicking on caret
Before this rev., the datepicker could only be opened by clicking
on the input, not on its caret.

OPW 1836520
2018-04-16 08:35:47 +02:00
Odoo Translation Bot 4bc2581521 [I18N] Update translation terms from Transifex 2018-04-15 04:12:33 +02:00
Odoo Translation Bot 2901c0f0e5 [I18N] Update translation terms from Transifex 2018-04-15 00:29:26 +02:00
Martin Trigaux e09609bb31 [FIX] base: set correct Sudanese currency
Since July 1, 2007, the Sudanese pound is the only legal tender.

Closes #13802
2018-04-14 16:29:07 +02:00
Xavier Morel 1e6da402d7 [FIX] export performance regression from d28f8f7
d28f8f704f carefully clears only the
relevant bit of the cache (only the top-level object which we're
exporting), however the commit did not considert that _export_rows
calls itself recursively for relational fields, and thus when
exporting relational fields the relation would become the new
top-level and get cache-cleared on every iteration, significantly
slowing down cases where such records are shared and would need to be
re-fetched every iteration, even more so if they're somewhat/somehow
expensive.

OPW-1833545
OPW-1836361
2018-04-13 17:42:52 +02:00
Xavier Morel 115fa8f2d7 [FIX] export time regression by b5c660d8
While c059e7b93c64b9dd9bc96eeb6ee5cadf significantly lowers the cost
of generating xids, a safety invalidate cache can regress cases
significantly e.g. 18s -> 430s (7mn) for some recursive exports of
xids as the cache would be completely cleared *after each record*
requiring complete fetching & recomputation of the following records.

Fix by only clearing the cache if we've actually had to create
xids *and* only for ir.model.data records.

It's possible that clearing the cache isn't even necessary at all (?),
check with @rco-odoo

OPW-1835226
2018-04-13 17:42:52 +02:00
qdp-odoo 0800942078 [FIX] l10n_do: adapt to Norma 07-2018
Was PR #24123 and #24124. Courtesy of Gustavo Valverde (Iterativo)
2018-04-13 16:03:55 +02:00
Nicolas Lempereur b8b0f947bf [FIX] web: remove ­ when saving phone number
When Odoo display a phone number number, on phone or if VOIP is
installed a invisible `­` character was added from 9.0 up to
saas-11.2 so an applications such as skype would not be concerned with
the number.

But if someone copy-pasted from this to somewhere else in Odoo, we would
get incorrect number with this invisible caracter. So this change make a
special case for the "FieldPhone" so the character is removed from data
saved.

opw-1834858
closes #24223
2018-04-13 15:35:33 +02:00
Aaron Bohy 52cd52e624 [FIX] web: BasicModel: default_get on o2m with date field
Before this rev., a crash occured when a default_get returned a
command 0 (CREATE) for a one2many, with a value for a date(time)
field (e.g. [0, false, {some_date_field: '2018-12-08'}]). This
was because the related values (inside the commands) weren't
parsed. This only impacted date and datetime fields, for which the
parsing converts the string into a moment instance.

Fixes #23672
2018-04-13 14:59:48 +02:00
William Henrotin baeb743251 [IMP] doc: add profiler example
The built-in Odoo profiler can be used directly into the logs. This
information was not given in the documentation. This commit add it. An
example on how to use is shown as well as the produced result.
2018-04-13 13:59:12 +02:00
Lucas Perais (lpe) 8e5156938a [FIX] web: o2m list with field datetime from server
Have the create_date field displays on a one2many list
Try to add a record onto the list

Before this commit, when the virtual record is added onto the list
it crashes because the datetime field is undefined and cannot be parsed

After this commit, It doesn't crash though the value would have to wait the save on the main record
to be updated (because it is the create_date)

OPW 1834250
closes #24097
2018-04-13 13:41:39 +02:00
Nicolas Martinelli 83a03e6349 [FIX] hr_timesheet: description on timesheet report
- Go to Timesheets > Add a Line (grid view)
- The view opened is `view_timesheet_form`
- Add a description with several lines
- Go to Project, and display the timesheet entries.
- Print the report "Timesheet Entries"

The lines in the description are merged into one single line.

Since it is possible to write a description on several lines, the report
should keep the formatting.

opw-1830703
2018-04-13 12:33:46 +02:00