Commit Graph
117156 Commits
Author SHA1 Message Date
Nicolas Martinelli 2254b5cf1c [FIX] base: default value in set_multi
Make sure to test `None` instead of any falsy value. Indeed, when we
want to explicitly pass a `False` default value, `set_multi` might
select an incorrect default value.

This is for example the case of `_inverse_product_pricelist`, where
`default_for_country` might be `False` on purpose.

opw-1858271
2018-06-26 09:46:53 +02:00
Josse Colpaert 70ddff760f [FIX] stock: when creating a procurement from a stock move, pass the date_expected as date
Before, when we created a picking manually with MTO+buy products,
put a scheduled date in the future and did "mark as todo", the
date on the po was related to now instead of that schedule date.

The scheduled date of the picking was passed to the date_expected
of the move, but not to the date of the move, which was passed to
the date_planned of the created procurement.  By passing the
date_expected instead of the date of the stock_move to the
date_planned of the procurement, the po will have dates in function
of the scheduled date of the picking.

Courtesy of chienandalu.  Closes #25223
2018-06-25 15:38:23 +02:00
Josse Colpaert d4582cf020 [FIX] purchase: no mrp fields in purchase please
Fields of mrp should not be put in purchase like this,
as it can throw a traceback e.g. if you generate a purchase
based on a picking in MTO.
2018-06-25 15:38:23 +02:00
Nicolas Martinelli 752347cdef [FIX] website_sale_options: prevent double-click
- On the eCommerce, open a product
- Click twice on 'Add to Cart'

The modal is opened twice, with potentially multiple SO created.

opw-1858080
2018-06-25 14:50:33 +02:00
Lucas Perais (lpe) 786c044a39 [FIX] pos_restaurant: don't crash when printer have no url set
Have a printer in a pos.config that doesn't have a url set

Open the pos

Before this commit, there was a JS traceback, since we tried to call
string operation on undefined.

After this commit, we avoid the traceback with a behavior that *looks like* the v9.0's
i.e. we don't care if the url actually means something, we put a message in the console though

OPW 1858063

closes #25442
2018-06-25 09:15:12 +02:00
Christophe Matthieu 8e9936ba04 [FIX] sale: test depend of another module
It may crash when we install only the sale module

backport 513dca4726 from v11
closes #25437
2018-06-25 09:10:06 +02:00
Odoo Translation Bot 268357bf15 [I18N] Update translation terms from Transifex 2018-06-24 00:25:09 +02:00
Lucas Perais (lpe) 5de096dbf2 [FIX] account: aged balance shouldn't display fully reconciled on a period
Backport of 5f105d144d from v11.0

Commit 45c5a07d89 deals with displaying on the aged balance reports
the lines that zero out each other: an invoice and a payment of the same amount for the same partner
However, that commit overlooked that when there is a chain of reconciliation
that puts the report line to zero, it was displayed as well.

This present commit corrects this by making sure there are amls that detail the report lines

OPW 1857860

closes #25421
2018-06-22 13:23:59 +02:00
Goffin Simon 16fb8f0a75 [FIX] web_calendar: Calendar date format incorrect
Steps to reproduce the bug:
- Set a language on your user
- Change the date format in this language and set '%d/%m/%y' (two digit year)
- Open the calendar and select day or week view

Bug:
- The date displayed on the column headings has 'y' where it should have the year.

To check the right date format: http://fullcalendar.io/docs1/utilities/formatDate/

opw:185924
2018-06-21 16:50:51 +02:00
Denis Ledoux 5c70cc24b3 [FIX] point_of_sale: performance improvement to read one session
The fact the pos config name get was doing
`config.session_ids[0].state`
led to the prefetch of fields of all the session_ids of this config
on reading `config_id` for the session form

Therefore, if a pos config had 1000 sessions,
it was prefetching fields of 1000 sessions when you actually
wanted only one session to display in the form.
Among others, the `picking_count` field which is
not stored and quite heavy to compute

In term of time, it went from 1 minute to 1 second
to open the form view of one pos session.
2018-06-21 15:07:24 +02:00
Nicolas Martinelli 22084bc52e [FIX] website_quote: token assignation
Speed up assignation of initial access tokens for large databases.

opw-1856946
2018-06-21 10:45:14 +02:00
Nicolas Martinelli c70db5d5df [FIX] stock_account: product on AML
When changing the standard price of of a product set in perpetual
valuation, the AML does not contain the corresponding product_id.

opw-1859777
2018-06-21 10:37:32 +02:00
Nicolas Martinelli 25b6dd6e88 [FIX] sale_mrp, sale_stock: sort moves
`sorted` returns a new sorted recordset, but doesn't modify the actual
one. Therefore, the current code doesn't work as expected.

opw-1824734
2018-06-21 10:34:49 +02:00
Nicolas Martinelli f8fc006e1e [FIX] sale_mrp, sale_stock: sort moves
`sorted` returns a new sorted recordset, but doesn't modify the actual
one. Therefore, the current code doesn't work as expected.

opw-1824734
2018-06-21 10:32:39 +02:00
Agathe Mollé 76df986fd3 [FIX] l10n_multilang: translate country states name
Backport of bc84eb2035 to 10.0

Countries with several official languages often have multiple names for their
states. Allow to translate the state name for such countries.

Some monolingual countries but, yet, with a need of translation of the addresses
such as China or Germany can add the same flag in their respective l10n_* module

Closes #25340
2018-06-21 09:56:18 +02:00
Christophe Simonis 152d42041e [MERGE] forward port branch saas-14 up to e4663523b9 2018-06-20 18:48:06 +02:00
Christophe Simonis e4663523b9 [MERGE] forward port branch 10.0 up to 081259ef25 2018-06-20 17:44:58 +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 Simonis 7dbc995bef [MERGE] forward port branch 9.0 up to 9cb37398f2 2018-06-20 16:48:15 +02:00
Arnold Moyaux 91714d4c46 [FIX] stock: inventory security with translation
Usecase to reproduce:
- Enable multiple languages and companies
- Set one language on the admin and another on the demo user.
- Create a product and a translation for its name (both languages)
- Create an inventory adjustement in a company A for this product
- Switch on demo user (inventory manager rights but in company B only)
- Create another inventory adjustement for company B
- Add the invenory line with the product and save

The Inventory Line multi-company rule raise an access error
because the system set product_name on the inventory_line that is
a related field. Since it changes the product name with its translation
it will update it on other inventory line that have this product. The
other inventory line is in company A and the user don't have access to
it thus the access error is raise.

This adds readonly on the product_name since it should not be update
with an inventory line.

opw-1855137
2018-06-20 14:06:25 +02:00
qsm-odoo f01a0bc04c [FIX] web_editor: allow to empty a style file with the editor
Before this commit, if the user opened the LESS editor and emptied a
file, he may get a compilation error (as intended if the file contained
necessary variables and stuff) but this error also prevented to open
the editor again because some code tried to decode an empty content.

Now, when a file is emptied it is set to an unique line feed.
2018-06-20 13:18:16 +02:00
Olivier Colson b81b9f9ca1 [FIX] account: use today's date as due date for invoices if there is no payment term and no due date was given manually
The code was actually alreadt made in this spirit, there was just as wrong call to the date_invoice field of the model instead of the local variable with the same name, which contained the right value.
2018-06-20 12:32:33 +02:00
Pierre Masereel 9a810565b0 [FIX] purchase: Canceling the receipt of a receipt
Canceling the delivery order created for a "Make to order" product
cancels the related procurement.

But canceling the receipt order created for a "Buy" product" with reordering rule
didn't cancel the related procurement. In some cases, it can block the application
of the reordering rules.

Now the related procurement is canceled when the receipt order is canceled.

opw:1845345
2018-06-19 15:37:26 +02:00
Nicolas Martinelli 8b9b56bd73 [FIX] l10n_ch: default tax
As of 01-01-2018, the default taxes should be 3.7 and 7.7 %.

opw-1854312
2018-06-19 15:27:24 +02:00
Nicolas Martinelli 3e2f85e021 [FIX] purchase: duplicate procurement
The fields `purchase_line_id` on a procurement should not be copied.
Otherwise, issue arise in reordering rules.

opw-1859349
2018-06-19 15:24:47 +02:00
len-odoo dfc37d3407 [FIX] calendar: do not write end time before start time of an event
The end time of a calendar event is constrained to never be before the start
of te event.
However when updating events, one path would first update the start of the event
before updating the end of the event.
So in case where (s_1, e_1) is updated by (s_2, e_2),
with respectively s_i < e_i,
if s2 > e1 then the update would violate the constraint and thus crash
the calendar update.

opw 1854394
2018-06-19 14:12:35 +02:00
Goffin Simon 9cb37398f2 [FIX] calendar: Calendar recurring start date is wrong
Steps to reproduce the bug:

- Create a recurring meeting, with a start date with time (not all day) (for example 09:00),
a duration (for example 5 hours) , each week for example on fridays, for 3 occurences.

-Save

Bug:
- The start_datetime ("Starting at") was increased with the duration of the meeting.

PS: The displayed start and stop in calendar view were computed in function "calendar_id2real_id"
with the virtual id.

opw:1858154
2018-06-19 08:50:30 +02:00
Christophe Simonis b020308413 [FIX] web: clean data_file after restore
The file used for the restoration was not properly removed
2018-06-18 19:35:42 +02:00
Martin Trigaux 4e4dd4dfa2 [FIX] http: avoid corruption with domain name
Domain names may have been interpreted as a regex by mistake
2018-07-18 10:32:42 +02:00
Nicolas Martinelli 7501691da9 [IMP] auth_signup: hide unusable field from users
The token field is a technical data that the other users are not able to use.
It may be confusing for users to see token on the user interface.
Still show it to administrator for debug reasons.
2018-07-16 14:35:20 +02:00
Raphael Collet e93fa78562 [FIX] base: access rights on transient models 2018-07-23 16:21:07 +02:00
Raphael Collet 2c9c7e770a [FIX] models: correct regex for onchange_v7
Ensure, we only match the expected az-A-Z characters for old-style onchanges.
The \w allowed starting with 0-9 which should be prevented.
2018-07-12 13:55:42 +02:00
Raphael Collet 0dbed816b9 [FIX] base: override correct read method
The _read_from_database is used by all the different methods that may access
the value of the fields.
2018-07-14 09:17:42 +02:00
Olivier Dony ef017ab1ab [FIX] base: always preload dateutil
The dateutil package uses lazy import to selectively expose its
features: `parser`, `relativedelta`, `rrule`, `tz`.

Depending on installed modules and order of initialization, there was no
guarantee that a given feature was already loaded during the preparation
of the action context.

This patch ensures that we always preload the feature set we need, and
only that feature set. This way we have a consistent `dateutil` lib in
the action context at all times.
2018-07-23 16:15:10 +02:00
Thibault Delavallée 2d32609440 [FIX] mail: log correct user deleting the record
When using sudo, the administrator is logged as deleting the action.
For audit reason, log the correct user.
To avoid access rights errors, only group system can delete the action.
2018-07-07 17:35:42 +02:00
Thibault Delavallée e00370e194 [IMP] website_mail: allow per-module override of token_field
Instead of forcing a token field through an override, set it at the class level
to be changed in other model inheriting from the MailThread
2018-07-08 09:04:42 +02:00
Simon Lejeune 19ac9fba0d [FIX] base: strengthen ir.attachment access rights
An ir.attachment record can be served as a request's reponse if:
  - a request triggers a 404
  - the ir.attachment record has its url field matching the url of
    the failed and is of binary type

Following rev[1], portal users have the right to create these kind of
records, and it is a security concern.

This patch restrict the ability to create and write on the ir.attachment
records that may be served through the dispatch's exception mechanism to
settings users.

As the asset bundles files are served through the use of these special
ir.attachment, we make sure to retrieve only ir.attachment records
created by the superuser in the `get_attachment` method.

As website administrators often need to play with these special
ir.attachment, we also let to this group the permission to manage them.

[1] 61065b6d04
2018-07-29 14:10:42 +01:00
Simon Lejeune dae2822799 [FIX] report: avoid local file resources
Make sure building reports using local resources are disabled.
This avoids get different report result based on the system if the
given resources are or not present (e.g. custom style)
2018-07-03 10:53:42 +02:00
Lucas Perais (lpe) db994ca57a [FIX] sale: do not always overwrite discount on soline
Before this commit, the discount on a so line was always brought to zero when changing the price

After this commit, we do this only when the pricelist is supposed to compute the discount

OPW 1867262
closes #25851
2018-08-07 11:04:29 +02:00
Joren Van Onder 9609f79cad [FIX] point_of_sale: invalidate cache after reloading partners
The POS uses a DomCache for various UI elements to avoid re-rendering
elements that are the same as the last render. One such cached UI
element is an entry in the client list.

When a partner is edited in the POS frontend the POS will write this
to the backend and then it will load all updated res.partner
records (new write_date > previously loaded most recent write_date).

To render the newly updated information *and* to ensure any other
partner edited (through backend or because it's a child contact) is
updated just clear the whole cache.

Fixes #13856
2018-08-06 15:44:34 -07:00
Martin Trigaux 8669361dd6 [I18N] remove outdated translations
Contained bad %s and out of sync with .pot
2018-08-06 16:18:46 +02:00
Christophe Simonis 5decf4ab3d [FIX] web: clean data_file after restore
The file used for the restoration was not properly removed
2018-06-18 19:35:42 +02:00
Martin Trigaux 6d83f70014 [FIX] http: avoid corruption with domain name
Domain names may have been interpreted as a regex by mistake
2018-07-18 10:32:42 +02:00
Nicolas Martinelli cbce126425 [IMP] auth_signup: hide unusable field from users
The token field is a technical data that the other users are not able to use.
It may be confusing for users to see token on the user interface.
Still show it to administrator for debug reasons.
2018-07-16 14:35:20 +02:00
Raphael Collet 4b1b70a77a [FIX] base: access rights on transient models 2018-07-23 16:21:07 +02:00
Raphael Collet ff45f22750 [FIX] models: correct regex for onchange_v7
Ensure, we only match the expected az-A-Z characters for old-style onchanges.
The \w allowed starting with 0-9 which should be prevented.
2018-07-12 13:55:42 +02:00
Raphael Collet 698314e5d4 [FIX] base: override correct read method
The _read_from_database is used by all the different methods that may access
the value of the fields.
2018-07-14 09:17:42 +02:00
Olivier Dony 21bb14d177 [FIX] base: always preload dateutil
The dateutil package uses lazy import to selectively expose its
features: `parser`, `relativedelta`, `rrule`, `tz`.

Depending on installed modules and order of initialization, there was no
guarantee that a given feature was already loaded during the preparation
of the action context.

This patch ensures that we always preload the feature set we need, and
only that feature set. This way we have a consistent `dateutil` lib in
the action context at all times.
2018-07-23 16:15:10 +02:00
Thibault Delavallée 1e42cbc1f4 [FIX] mail: log correct user deleting the record
When using sudo, the administrator is logged as deleting the action.
For audit reason, log the correct user.
To avoid access rights errors, only group system can delete the action.
2018-07-07 17:35:42 +02:00
Simon Lejeune bfffe39f13 [FIX] base: strengthen ir.attachment access rights
An ir.attachment record can be served as a request's reponse if:
  - a request triggers a 404
  - the ir.attachment record has its url field matching the url of
    the failed and is of binary type

Following rev[1], portal users have the right to create these kind of
records, and it is a security concern.

This patch restrict the ability to create and write on the ir.attachment
records that may be served through the dispatch's exception mechanism to
settings users.

As the asset bundles files are served through the use of these special
ir.attachment, we make sure to retrieve only ir.attachment records
created by the superuser in the `get_attachment` method.

As website administrators often need to play with these special
ir.attachment, we also let to this group the permission to manage them.

[1] 61065b6d04
2018-07-29 14:10:42 +02:00