Commit Graph
135546 Commits
Author SHA1 Message Date
wan f0b752bb71 [FIX] l10n_fr_fec: give write access to account.fr.fec
account.fr.fec model needs to have write access as it
explicitely calls write() on its records.

closes odoo/odoo#50149

X-original-commit: ffef4a4361c6e817872defae504f002629a1a0e4
Related: odoo/enterprise#10196
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-24 12:41:46 +00:00
Nasreddin (bon) e95063f2ee [IMP] crm: clarify kanban view
This commit will put more emphasis on both the revenue and the contact
attached to the opportunity.

Task ID 2240258

closes odoo/odoo#49773

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 08:35:38 +00:00
Nasreddin (bon) a06a35b238 [IMP] event: clarify event kanban view and add some mobile tweak
This commit adds 2 improvements to help clarify kanban view:

1. In kanban view on Mobile, add some space between the two clickable links
   (expevted & confirmed)
2. The "Confirmed" button land on kanban view instead of pivot view

Task ID 2228562

closes odoo/odoo#49595

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 08:54:51 +00:00
Nicolas Martinelli cf078da86e [FIX] stock: unreserve picking with latest scheduled date
- Create a product P with 10 units on hand
- Create a SO with 5 units, validate
- Create another SO with 5 units, validate
- Update the quantity on hand to 8

The picking linked to the first SO as 2 units unreserved, while one
would expect the unreservation on the second picking.

When unreserving, sort the move lines according to the picking scheduled
date. The latest schedule date comes first.

opw-2233331

closes odoo/odoo#49830

X-original-commit: 41c05cbfb015407dbbf7100233999ecd154267dc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-21 08:23:30 +00:00
Nasreddin (bon) 9d312ac85b [IMP] utm: Add Quick Create in Campaign Kanban
This commit ease the creation of campaigns as
they only require a name and a responsible.

When the user clicks on create, it will display the
"Quick Create" card instead of redirecting him to a
full form view.

Task ID 2237999

closes odoo/odoo#49774

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-24 07:59:57 +00:00
Patrick Hoste 03e62ac8ad [IMP] website_slides: publish content when publishing slide
Purpose of this commit is to avoid de-synchronization where content could
be unpublished whereas slide was published.

Task ID 2239840

closes odoo/odoo#49908

X-original-commit: d0f4a3e85eab63e335766a823185fd6ada6e07b4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-22 06:46:46 +00:00
jvm-odoo 297641da69 [FIX] website_sale_delivery: fix delivery state computation
Issue

	- Install eCommerce, Delivery Costs
	- Create 2 delivery methods:
		- Country: US States: Empty
		- Country: US States: Oklahoma
	- Publish both
	- In private browser, go to "Shop"
	- Order anything, select US as country

	The states list only contains Oklahoma.

Cause

	When selecting a country, `get_website_sale_states`
	is triggered. (website_sale_delivery's one)

	It will loop on deliveries methods and add the
	delivery method states to an empty list.

	But when the delivery method conditions are
	country US & States empty. States = no states

	So only the states of the delivery method
	country US, states: Oklahoma are taken
	in account

Solution

	Make all states availables when one of the
	delivery methods doesn't have states

OPW-2222282

closes odoo/odoo#50167

X-original-commit: 4ef8186307c92637ea16f15c99fd538599acd575
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-24 15:11:10 +00:00
Denis Zhadan e94ce5a0df [ADD] base: add country states for 6 EU countries.
Added country states for 6 EU countries: Estonia, Latvia, Lithuania,
Finland, Sweden, Norway.  used ISO 3166-2:EE, ISO 3166-2:LV, ISO
3166-2:LT, ISO 3166-2:FI, ISO 3166-2:SE, ISO 3166-2:NO

The county structure in Norway changed on 1 January 2020, but not yet
published in ISO 3166-2

NB! Import for field country_id:id with value "no" for Norway do not
work, must be "base.no", otherwise considered as False

closes odoo/odoo#50168

X-original-commit: 882fa61fd3c3e0e332fb62ecb92a6c4416864321
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-24 15:12:07 +00:00
Patrick Hoste ec2b38dd1f [IMP] website_slides: allow user to download slides pdf by default
PURPOSE

To align on the v13.0 enable the 'Allow Download' option by default.

SPECIFICATION

Change the default value of slide_resource_downloadable from False
to True.

LINKS

Task ID : 2225802
PR : #49951

closes odoo/odoo#50164

X-original-commit: 44bfb8c73f9abc563ce764411610f45e5bdf18b1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-24 14:51:49 +00:00
Thibault Delavallée 7946b42ef5 [IMP] link_tracker, (test_)mass_mailing: improve test tools and clean existing tests
URPOSE

Prepare code cleaning and optimization in mail, mass_mailing and SMS by
cleaning models for readability and code complexity and footprint reduction.

SPECIFICATIONS

Add tool methods and asserts for link tracker tests.

Add tool methods and assets for mass mailing tests, notably about mailing
traces and their link with emails.

Merge existing and duplicated tests and rewrite them a bit.

Rename and improve test_mass_mailing models.

LINKS

Prepares task ID 2238597 (notification and trace models cleaning)
Task ID 1906925 (mass mailing tests cleaning)
PR #50169

Related: odoo/enterprise#10180
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-24 15:35:43 +00:00
Thibault Delavallée 9721488817 [FIX] mass_mailing: do not force trace state that is computed
State field on trace model is computed based on other (datetime) fields.
It seems therefore unnecessary to force its value.

LINKS

Prepares task ID 2238597 (notification and trace models cleaning)
Task ID 1906925 (mass mailing tests cleaning)
PR #50169
2020-04-24 15:35:43 +00:00
Thibault Delavallée f7e9a24962 [IMP] mail: add some docstrings and helpers
PURPOSE

Prepare code cleaning and optimization in mail, mass_mailing and SMS by
cleaning models for readability and code complexity and footprint reduction.

LINKS

Prepares task ID 2238597 (notification and trace models cleaning)
Task ID 1906925 (mass mailing tests cleaning)
PR #50169
2020-04-24 15:35:43 +00:00
alt-odoo d3ffc3248c [FIX] http_routing: small fixup due to commit 423402f1e5
Method _get_exception_code_values can return None value for code. We should avoid
getting a KeyError in HTTP_STATUS_CODES in this case.

closes odoo/odoo#50160

X-original-commit: ea138667d55b535d8ec51f86fd649e28d704ac76
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-04-24 14:30:17 +00:00
Martin Trigaux 78007d0b56 [FIX] base: insert empty translation
When creating new translations, do not prepopulate the translation
with src.
Take the following scenario:
- set a value in a translatable field in English
- open the translation popup -> creates all ir.translation
- notice an error in English, close the popup
- correct the error in English
- reopen the popup -> existing translations not modified

Add test about reseting

closes odoo/odoo#50147

X-original-commit: 619eccc7a533eedfb3aec0c3740ead1006e0f2f7
Related: odoo/enterprise#10194
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-24 12:00:24 +00:00
Denis Ledoux e050d9150c [ADD] auth_ldap: give possibility to users to change their ldap password
- A user using ldap to sign in can now changes his password,
   providing hid old password.
 - When the ldap password is changed, empty the possible
   value for the password set in database so
   it can no longer be used.
 - Usually, in all res.users methods auth_ldap replaces,
   we first try to call `super` before fallbacking to
   ldap if the call to super fails.
   e.g. when authenticating,
   we first check the regular (super) credentials,
   before fallbacking to ldap if it fails.
   In this case, we do the opposite on purpose,
   to give the priority to ldap in case a user changes of password.
   e.g. a user has the same password in ldap and in database,
   when he changes, we rather like changing the ldap password
   and then empty the internal password.

closes odoo/odoo#50144

X-original-commit: 8bff93feee0c40dd9ee73ed8217cfdd6abb7de3b
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-04-24 11:32:59 +00:00
lejeune quentin 672323037a [FIX] hw_drivers: Clean drivers folder before change branch
When we change the version of branch we keep drivers.
But drivers are not compatible with all branch and Odoo
on the IoT Box can't start.

So we remove all drivers before checkout on another branch

closes odoo/odoo#50140

X-original-commit: 4e97aec6717697c742e5e0b09f00ab7dec09712f
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-04-24 11:10:12 +00:00
mreficent b1a5bf95f8 [IMP] mail: add a hook in _notify_record_by_email to add model-specific values
PURPOSE

Be able to customize notification email values in a given model by overriding
a simple method instead of having to hijack the email creation process.

SPECIFICATIONS

Add a hook in mail.thread that can be overridden in specific addons, either
by model or globally by inheriting mail.thread.

Include _notify_email_headers in it so that it is correctly embedded in
model-specific values computation.

This removes the need to replace _notify_record_by_email long method in a
custom module.

Closes odoo/odoo#48213
Closes odoo/odoo#50097

closes odoo/odoo#50129

X-original-commit: 1ba8712d7a797cf2e821ae881cb1f1c4ea2fc11d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-24 09:30:55 +00:00
Aaron Bohy 797403c0a9 [FIX] web: list: don't call mounted twice on fields
Before this commit, when a list contained owl field components,
the mounted hook was called twice on those components. This may
cause tricky issues like handlers being bound twice, and memory
leaks.

closes odoo/odoo#50127

X-original-commit: 206dd91e78f7896fc6b01020507657e61771787f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-24 09:17:57 +00:00
Nicolas Martinelli e6a1e240f1 [FIX] purchase_stock: return subcontracted product
- Create a product P with a subcontracted BOM
- Create a PO for P, 10 units
- Receive 10 units
- Return 3 units and specify 'To Refund'

13 units are considered received.

The reason is that we don't return to a vendor location, but an internal
location.

We subtract the quantity when the following conditions are met:
- we ask for a refund
- we return to an internal location
- the return location is not in the warehouse of the move

The solution is similar to odoo/enterprise#9647

opw-2235157

closes odoo/odoo#50119

X-original-commit: 5fd6c5b65e00dcac77b232b9f47b2292d86c6b0f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-24 08:48:27 +00:00
Nicolas Martinelli 62fbf6e467 [FIX] web: font support for Cyrillic in sign report
Forward-port of https://github.com/odoo/enterprise/pull/9996

closes odoo/odoo#50110

X-original-commit: d4bef0aaa5f208c6092df71f2312c0ff4b6c8396
Related: odoo/enterprise#10181
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-24 08:21:22 +00:00
Nicolas Lempereur b781fb588e [FIX] mail.py: escape plaintext email
A plaintext email is displayed in a `<pre/>` tag to conserve spacing.

But since there is no escaping, if in this text there was XML tags or
HTML entities, they would appear as HTML in browser which is not wanted.

Do note that this was not a security issue since the content will still
be subjected to the checks and foundling of HTML emails.

Without the change, the added test would fail because character &,<,>
were not escaped.

opw-2242323
closes #50003

closes odoo/odoo#50123

X-original-commit: 932532b5b59e0b71c8e16dadfb2ff36c38764208
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-24 09:08:08 +00:00
Aaron Bohy a3a415b130 [FIX] web: tests: detect failed modules in small suites
Before this commit, we waited for 10 seconds before defining the
boot test (checking that all JS modules have been correctly
loaded). However, small test suites (like the mobile one) ended
before this test was defined. So we could end up with a green
branch with tests not being executed (e.g. if a testing module
had missing dependencies, and was part of a small suite).

This commit removes the boot tests and instead does the check
at the end of the suite, before logging that the suite passed.

closes odoo/odoo#50109

X-original-commit: 048557eef32df94715ab464614c9d9d34c4a2689
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-24 08:11:17 +00:00
Christophe Monniez eec563c2f1 [FIX] packaging: include _vendor in packaging
Since a0f9ef56, a _vendor module was added without `__init__.py` file,
following the PEP 420 specifications.

Unfortunately, as the `setuptools.find_packages()` only recognize
packages if they have such an init file, the _vendor module is not
packaged. This leads to an import error when running Odoo from the
src,deb and rpm packages.

The `setuptools.find_namespace_packages()`, which is compliant with PEP
420, could have been used instead. But this function does not exists in
setuptools 39.0.1 which is the one packaged in Ubuntu Bionic.

Finally, this commit simply adds the missing dunder init file.

closes odoo/odoo#50051

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-24 07:43:14 +00:00
Adrian Torres ca91e13dee [IMP] testing: forbid module operations during testing
With this commit, module operations such as install, upgrades and
uninstalls are henceforth forbidden inside unit tests and instead such
tests must be performed with standalone Odoo scripts.

This is done because module operations during tests are not
transactional, this can leave the registry in an unclean state and
further tests may be affected by this, it also creates a new registry
which complicates registry cleanup if anything crashes,
because the registry to be cleaned up is not the same one that crashed.

Instead, what should be done is a script that imports odoo as a library,
and loads the database necessary then performs whichever operations
necessary. This script should contain a single function with a single
parameter (env) and should be decorated with
@odoo.tests.common.standalone in order to be executed properly, this
decorator accepts any amount of positional parameters as tags that can
be specified when calling the script in order to execute only a select
subset of scripts.

Special tags are: 'all' and <module_name>, these are generated
automatically, the first will execute ALL scripts available whereas
<module_name> will execute all scripts introduced by said module.

When calling the test_module_operations script, only scripts found in
*installed* modules will be executed, script discovery is only possible
if the code is loaded therefore it is only possible if the module is
installed.

closes odoo/odoo#49669

Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-04-22 07:45:53 +00:00
Nicolas Martinelli baf1c1406b [FIX] base: do not skip ACL and record rules
- Create 2 companies C1 and C2
- Install any module with access rules, e.g. `account`
- Create an invoice in C1, attach a document
- Switch to C2
- Go to Settings > Technical > Attachments

An `AccessError` is raised.

This happens because the `_search` skips the ACL and record rules for a
system user, while they should only be skipped for the superuser.

opw-2236561

closes odoo/odoo#50067

X-original-commit: 9a71d60c25804bc4bae8c2c680c537f8a7a0900f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-23 11:50:59 +00:00
willmakenoise fd71bef29a [ADD] base: add Norwegian address format
closes odoo/odoo#50089

X-original-commit: b1a10ec5e35e74dd10a6c19e4dc1f810bac19056
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-23 18:43:08 +00:00
Martin Trigaux 1f410436d6 [FIX] mail: remove unused route
The route is no longer used but was still present in the code.
Processing email should be the job of the fetchmail server and they
should not be injected directly from outside (even if emails are
unauthenticated by design, mail servers may still have some say in the
process).

Courtesy of Alexandre Díaz

closes odoo/odoo#50084

X-original-commit: ab70afb3963b0952e938ab39ef3dcb47ecc01f61
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-23 14:54:24 +00:00
oco-odoo 70d1f90314 [FIX] account: reconciliation models: apply percentage properly for suggestion buttons
The buttons created in the reconciliation widget by the reconciliation models did not apply the percentage of their lines correctly.

Example of the behavior before the fix :

1) Create a 'writeoff_button' reconcile model, with two lines of 50% on distinct accounts
2) Create a statement line of 100€
3) Open the reconciliation widget and apply the model created in 1) to the line made in 2)

=> Two lines are created, 50€ and 25€. They should both be 50€.

closes odoo/odoo#49963

X-original-commit: d3bd67fa12d85515fa6683f7b5d9ae114056bb62
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-04-23 14:37:35 +00:00
Samuel Degueldre 91c3b1c0d7 [FIX] website_mass_mailing: fix traceback when saving with popup open
When the newsletter popup was introduced, the modal was for some reason
marked with the o_editable class, which is normally used to let the
editor know which elements in the page can be edited and saved in the
database. Because of this, upon saving with the modal in the page (ie,
if the modal is open when saving) it would try to destroy the editor
associated with the modal, which doesn't exist, resulting in a
traceback.

This commit fixes that by removing the o_editable class from the modal,
this doesn't actually prevent edition, because the modal is already
inside of an editable segment of the page.

task-2092593

closes odoo/odoo#50080

X-original-commit: 856d21cef530a9393bcebbf314a9316934ffb7c7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-23 13:11:06 +00:00
Nicolas Lempereur 7be90d25e6 [FIX] mail: lower RAM usage of mail.message().search(limit=None)
On an instance with 4 million messages, opening Settings > Technical >
Messages could increase residual memory usage in a given situation usage
by:

- 1.5 GB for odoo
- 3 GB for postgresql (a part might just be cache depending on config)

With this change breaking the request in several ones, increase is:

- 0.5 GB for odoo (for the millions of ids in dictionaries and list)
- 0.1 GB for postgresql

opw-2232065
closes #49689

closes odoo/odoo#50079

X-original-commit: 04e5b9f397e7fc752e9910c58eea589420b83a63
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-23 13:02:33 +00:00
Samuel Degueldre e2abbdcc59 [FIX] web_editor: fix original not being properly set when cropping
Previously, if you opened the cropper on an already cropped image, it
would load the crop data for that image. If you then changed the image
and cropped that new image, it would keep most of the metadata of the
previous image when saving, causing any subsequent crop to show the
previous original image instead of the current one.

This commit fixes that by removing all crop-related jQuery data from the
image, so it's considered a fresh crop and a new attachment is created.

closes odoo/odoo#50066

X-original-commit: 46c08050998d0c94d8955cd23ac783f38ecb5af1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-23 11:49:49 +00:00
Julien Mougenot 85eef1ec4d [FIX] web: properly define control panel layout
Before this commit, some elements in the control panel were not properly encapsulated
in layout-related parent elements and this caused some inconsistencies if some of
the control panel components were not displayed. For example: if the breadrumbs
were missing, the search bar went to the left side instead of the right.

Now, all components are in a grid-like structure (in desktop mode) and should not
overstep their given boundaries. The layout in mobile remains unchanged since the
top part behaves quite differently.

closes odoo/odoo#50057

X-original-commit: 533db5991a5bb871198485cd71a63f75a8c6becf
Related: odoo/enterprise#10148
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-04-23 10:32:25 +00:00
jerome hanke (jhk) b4ba1ccb13 [FIX] website_crm: state_id=false not shown in lead description
Steps to reproduce:
- install website, crm
- go to crm > settings > activate leads
- add a contact form to your website and submit
- go to the created lead

Previous behavior:
state_id is shown as false when geoip data is empty

Current behavior:
state_id is not shown if geoip is if the state found in geoip
does not not exist on the Odoo instance

opw-2218498

closes odoo/odoo#50055

X-original-commit: eba0eafac78adb498f8062f3490cea0847ed7927
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-04-23 10:20:29 +00:00
Nicolas Martinelli 6ff823b2f6 [FIX] account: dashboard domain
- Go to Accounting
- On Customer Invoices kanban card, click on the 3 dots > Credit Notes

Invoices, credit notes and receipts are shown.

This happens because the action domain is overridden, while it shouldn't
be in this case.

We only set the action domain if the action name was not explicitly
requested.

opw-2242195

closes odoo/odoo#50052

X-original-commit: 5dab4d56055cc197fb0f3a6cd20e60cd0f638fa9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-23 09:55:10 +00:00
qsm-odoo 13cacdfde9 [FIX] website: restore 5 colors system edition
Broken by [1] which is renaming a variable without changing its uses
for no apparent reason. "secondary" was always considered different from
"beta", thus showing them both in the color editor.

[1]: https://github.com/odoo/odoo/commit/adea75765df125606023fb0befef1cb767853c3c

Part of https://github.com/odoo/odoo/pull/49993

closes odoo/odoo#49993

closes odoo/odoo#50023

X-original-commit: a8c0bbfba1a39f003b0154e05f537ccdc216e49d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-22 16:50:44 +00:00
qsm-odoo 8c6d3d5ad7 [FIX] website: restore color order for themes with more than 5 colors
Broken by [1] (example: in treehouse, which has currently 6 colors,
primary was after secondary).

[1]: https://github.com/odoo/odoo/commit/6fb4ed44a04008a81f860fa24a63d444d70f56b6

Part of https://github.com/odoo/odoo/pull/49993

X-original-commit: 6aab08cbdbc3459d2cd2c1fb1f1f3b9f1bbaa4db
2020-04-22 16:50:44 +00:00
Benjamin Vray 22a1fa269b [FIX] web_editor: wrong position of top option icons
Restore the position of the icons in the top options so that they are
aligned horizontally and no longer vertically.

task-2162952

closes odoo/odoo#50021

X-original-commit: e4fcba353804d2be079b16aaad7dbe94b884e156
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-22 16:36:39 +00:00
Benjamin Vray 3920bb6fcf [FIX] web_editor: restore m2o widget in edit mode
Hide the button used to display the input and show the input
directly. Add a search icon into the input. Deactivate the browser
autocomplete. Improve and fix the layout. Keep the field selected
after choosing a result from the list.

This commit was only about making it work in the 13.0 left panel. It
will be improved further in master with our new left panel.

task-2187712

closes odoo/odoo#50024

X-original-commit: 6660ee960a3c643ae92448d7bdc37f6c780605b6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-22 16:53:06 +00:00
Nicolas Martinelli c22f99dd09 [FIX] account: do not set default account
Do not set a default `account_id` for section and note lines. Indeed,
when set the constraint `check_non_accountable_fields_null` will raise.

opw-2241575

closes odoo/odoo#50040

X-original-commit: 997a98d2d3d12caf554040922876164040de9efa
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-23 08:26:11 +00:00
jvm-odoo 9bcfb5c8d8 [FIX] project: prevent changing company_id of an analytic account
Issue

	- Have 2 company
	- Install Timesheet, Accounting, Project
	- Enable analytic accounting
	- Accounting > Settings > Analytic accounts
	- Remove the company_id of one of them
	  which is linked to a project
	- Timesheet > add a line for this project

	Error

Cause

	Timesheets lines are linked to a company and a project
	Removing the company_id of the project's analytic
	account create an inconsistency

Solution

	Prevent changing the company_id of an analytic account
	which is linked to a project.

OPW-2233266

closes odoo/odoo#50039

X-original-commit: 4895fb5029f492faf31b28b648e56ded8b3a83fb
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-23 08:23:49 +00:00
Martin Trigaux 2d00263127 [I18N] *: export saas-13.3 translations
closes odoo/odoo#50031

X-original-commit: 15a7a9f9d71a0b9c46d7caf2f4fbf09a5a4c63fe
Related: odoo/enterprise#10140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-23 07:13:48 +00:00
Nicolas Martinelli d5ecad2a36 [FIX] sale_stock: package with decimal values
Follow-up of f1e79c74a5c07d6be3154629f6f381ebaf907fb1

The issue still arises with:
8 % 1.6 = 1.5999999999999996

The modulo operator on float doesn't seem reliable for our use case,
therefore we use a combination of `float_round` and `float_compare` to
verify the quantity sold is a multiple of the quantity per package.

The rounding threshold is 0.01, meaning that the warning might not be
raised for some specific configurations. For example, 8.005 units with
a package of 1.6 won't return a warning. Since this is a non-blocking
warning, this should be enough for most cases.

opw-2241985

closes odoo/odoo#49983

X-original-commit: 3d48e2b49023eaf1b1dd0c8cb2b7723e41924a38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-22 13:00:06 +00:00
Andrea Grazioso (agr-odoo) 51d36ca373 [FIX] l10n_it_edi: fix bank info when credit note
Import an italian E-invoice of type TD04 (Nota di Credito).
The invoice type is marked as 'in_refund', but the bank information will
still be parsed from the contact info instead of taking the currenct
company info.
This will fail the check 'validate_partner_bank_id' and
the user will see the error 'The account selected for payment does not
belong to the same company as this invoice.'

Skipping the bank info when we have a credit note

opw-2239652

closes odoo/odoo#49949

X-original-commit: 6b5400b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-22 11:12:00 +00:00
Goffin Simon eadcfaeb57 [FIX] website_sale_delivery: Wrong shipping price displayed
Steps to reproduce the bug:

- Let's consider a company C in €
- Let's consider two selectable pricelists P1 in € and P2 in $
- The € rate is 1.0 and the $ rate is 0.5
- Configure a shipping method SM with a fixed price of 100€ and free if the price is
above 1000€.
- Configure a free delivery product P with sales price = 100€
- Go to the shop with P2 as pricelist and add in the cart any product which price is less
than 1000€ (in this case 500$)
- Process your order until the check out

Bug:

The price of SM was 25$ instead of 50$ because the function rate_shipment already computed
the price in the right currency

opw:2239117

closes odoo/odoo#49987

X-original-commit: 68b08164e5de353ea0c48de92d0c0e028b49bc52
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-22 13:30:22 +00:00
Martin Trigaux 6cd228c0b7 [IMP] base: prevent changing contact type of users
When a user is linked to a contact, the type should not be
modified. Otherwise, the res.partner type may become incompatible with
the res.user record (e.g. is set as a private address and a user no
longer has access to its own user)

Fixes odoo/odoo#48177

closes odoo/odoo#48590

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-06 06:05:18 +00:00
Damien Bouvy fff9d7dcee [FIX] website_sale: display payment error status when applicable
opw-2231276

closes odoo/odoo#50025

X-original-commit: 52f24423488fe919ddf40ee64c32e1c4818f2548
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-04-22 16:54:28 +00:00
Damien Bouvy 3b444b31d5 [FIX] payment_ingenico: disable CSRF for webhook route
X-original-commit: ac5bd76b2b226a1dc7d301b622c459569969b8b1
2020-04-22 16:54:27 +00:00
Damien Bouvy b1c81a6572 [FIX] payment_authorize: display errors to customers
Set the transaction to the state 'error' when Authorize.net responds
with that status, as it will display a message to the customer to detail
the problem.

opw-2231276

X-original-commit: 005607fce4a22394a9f67cc4eaa52f8bf89780f0
2020-04-22 16:54:27 +00:00
Damien Bouvy e3021499a4 [FIX] payment: handle tx in error in /website_payment/pay
opw-2231276

X-original-commit: 7b62c95d44c0abce9b53b476bb1e65fc873da24d
2020-04-22 16:54:27 +00:00
Julien Mougenot dd96271208 [FIX] web: handle empty notebooks in form views
Before this commit, when re-activating a previously active notebook tab, the form
renderer would assume that a tab was actually active. However this does not happen
if no tab is visible or defined and it results in a crash instead.

Now, if no active tab is found, a default active tab (0 = first) is set. This only
helps to prevent the crash and does not affect the current behaviour.

closes odoo/odoo#50006

X-original-commit: 73e0c0a1395ebd0e2b4ac7f857c863a0358c5e17
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-04-22 15:11:02 +00:00