Commit Graph
135575 Commits
Author SHA1 Message Date
Jeremy KerstenandRomain Derie 27de8b1478 [FIX] website_blog: update viewed count without update the write_date
To backport in v13
+ check for optimistic lock

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie dba74ed353 [IMP] website_blog: rename key for viewed post and avoid write
Avoid extra call to session_store.save if we don't touch to the session
Use an explicit name to storage post_viewed in the session

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 1f886b72f3 [IMP] website_blog: add index on website_id and is_published field
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 02abc57713 [FIX] website: fix mismatch lang code in compute of canonical url
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie f3df95bad9 [IMP] base: ir_http - don't check the exists in ModelConvert
Http routing and websits module will already do it later and handle the case.

The only ModelConverter used that will be impacted is:
   /web_editor/attachment/<model("ir.attachment"):attachment>
that is a json controller called with eisting data

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 841ebee16d [IMP] website_blog: blog post, replace viewref by is_view_enable
is_view_enable is cached

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 6ae4d132a0 [IMP] website_blog: remove unused code
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 26efb4ea06 [IMP] website_blog: perf - related author name avoid query res.partner
We use `author_id` (res.partner record) to instanciate our frontend widget
address so it can be changed through left panel in a searchable list.
This require a read on res.partner to get his name, even for visitors.

Using a related will have the same result for visitors while it won't need to
query res.partner table.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 9247c5e8fd [IMP] tools: avoid useless query on res.users
Without this commit, if `lang_code` or `env.context.get('lang')` was set, we
would still access `env.user.company_id.partner_id.lang` to fill the loop array
even if we break and don't need that value.

Switching from loop to if conditions prevents that.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 8e150d871e [IMP] website_blog: perf - store related website_id
Without this commit, a simple search like:
`env['blog.tag'].search([('website_id', 'in', (1, False))])`
would generate 4 SQL queries instead of 1.

3 requests would be done on `blog.blog`, see `right_ids` at ORM level.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 8e081ec61f [IMP] website_blog: avoid exists() in loop
`tags_list()` is called in loops to get nicely formatted URL in blog tag button
but doing an exists here will do everytime an SQL query regardless of the
cache.

We can safely remove the call to `exists()` as the `tag_ids` parameter is
coming from the controller `active_tag_ids` key which is already ensuring the
exists condition.

It make also the number of requests determinists for test with a random number
of tags. From between 200 ~ 300 queries (depending number of tags)-> 116

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 54048cb228 [IMP] website, website_blog: perf - cache customize show views
Most of the website rendering process depends of customize_show views which are
part of a configuration setup.
Once it has been setup, it will most likely never change afterward.

It makes sense to orm cache those infos to avoid having to query ir.ui.view
table everytime we render something.

Note that just store basic and small infos used for customize_show case.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie ad8e65685c [IMP] website_blog: add performance tests
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Thibault Delavallée ba8e3c3d96 [FIX] mail: do not prevent user from re-entering the same alias value
Followup of 73dc42d6d5: catchall or bounce alias reset to the same value
should not raise an UserError. This happens for example when reinitializing
mail module.

Also enable batch write again.

closes odoo/odoo#50248

X-original-commit: 00709025a9436b35744908481c5e5faa1e3ef655
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 15:32:38 +00:00
Martin Trigaux 104ae05e7f [FIX] web: do not translate technical content
Avoid messing up with style by translating it

closes odoo/odoo#50251

X-original-commit: 6151757a8357693e189ff1ab31ece5efdbac65d6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-27 15:58:11 +00:00
Martin Trigaux 7baa642186 [FIX] mass_mailing_sms: avoid autogenerated name
The name was autogenerated to "XMas Promo 2020-04-27 09:15:11" (which
is rather technical)
Make a static one to avoid changing it everytime the translations are rexeported

X-original-commit: 52a630eb28ead7b21f39dccbbff628ea594c7099
2020-04-27 15:58:10 +00:00
Victor Feyens a287d397b8 [FIX] base: automatic multi-company group assignation
Followup fix of #48912

The multi-company group should be given to users if they have access to
multiple companies and do not already have this group.

closes odoo/odoo#50233

X-original-commit: 0c721d90c5cd428ef8d51f195da8e02ee91d4364
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-27 13:52:31 +00:00
Jorge Pinna Puissant b88a9116f5 [FIX] calendar: note on meeting planned activity lack new line
- In a res.partner;
- Schedule activity;
- Choose 'meeting' as activity;
- Set a summary : 'test summary';
- Open Calendar;
- Chose a date and an hour;
- Edit the meeting;
- Add a description with a line break;
- Save the meeting;
- open the res.partner view;

Before this commit, the note on the planned activity lack the line
break.

Now, the note in the planned activity has the same output as the
description of the calendar meeting.

opw-2236838

closes odoo/odoo#50226

X-original-commit: 2e9cc92fb45f9328c45520275ab11c7a486a2590
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-04-27 13:52:55 +00:00
Xavier Morel 0ce9165ca5 [FIX] website: search_pages w/ werkzeug 0.15 or higher
The (private) Rule.build method takes a values *dict* parameter. From
the start it was called with an invalid argument, but before 0.15
`append_unknown` would lead to just not using the argument at all
unless the rule is dynamic (aka has converters)[0].

In 0.15 the code was refactored and the `values` mapping is now used
in every case[1], leading to a pretty systematic error when calling
`search_pages`, which occurs any time an auto-completed URL field gets
used on the website e.g. when converting text to a link using the page
editor or when trying to update menu items.

Fixing this in 13.0 because while the current debian stable ("buster")
still bundles 0.14, the soon-to-be-released Ubuntu LTS (20.04) updates
werkzeug to 0.16. Debian Testing (bullseye) also bundles 0.16 but
isn't expected to get released for another year so it's less of a
concern.

Fixes #47356
Relates to odoo/docker#299

[0]
https://github.com/pallets/werkzeug/blob/c769200d1dcf1e21daaa2781f0c5109586daad42/werkzeug/routing.py#L797-L828

[1] https://github.com/pallets/werkzeug/blob/048cdfd9b969c0c3a133d7ff43b8ad1ad6a673ec/src/werkzeug/routing.py#L1020-L1032

closes odoo/odoo#50194

X-original-commit: 4f1589075d2aae65c67a01c5c0f75c19c50a61d6
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-27 07:34:05 +00:00
Swapnesh Shah 52d49d635f [FIX] website_sale: Correct partner search
8b921471e4c11575b64d6e5e84508fc625dd2b07 has introduced wrong context key which replaces `res_partner_search_mode` with the depricated `search_default_customer` which was breaking search functality added by 8766f388da

In this commit we correct context's key.

closes odoo/odoo#50222

X-original-commit: 2e309d41cd7e7f22343379bd8a6b397b7d8684fd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-04-27 12:01:58 +00:00
Nicolas Martinelli b3e54ac38b [FIX] base: prevent country creation from state form
Prevent unexpected country creation when creating a state. Indeed,
there is usually no reason to create a new country.

opw-2239697

closes odoo/odoo#50210

X-original-commit: a502a404b18a0946d9ff64de9e05c28737e82c57
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-27 10:01:07 +00:00
Odoo's Mergebot 1b1d5c8af5 [FW][MERGE] *: improve performance of users and partners creation.
Users (res.users) and Partners (res.partner) are two main models of Odoo.

This PR aims at improving the performance of their creation:
* Records creation in batch
* Code optimizations to reduce number of queries when possible

Task Id - 2229358

closes odoo/odoo#50209

Forward-port-of: odoo/odoo#48912
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-27 13:03:23 +02:00
Victor Feyens 0279cbc4a7 [IMP] base: compute users share in batch.
Instead of triggering one has_group by user (one sql query/user if not already ormcached),
and potentially filling the `has_group` cache with new users data (we don't know if and when this data
will be used anyway), compute this field from the groups information already in cache.

X-original-commit: d771d7e9c8503543d29fdbf2ab961c2a32cc3bac
2020-04-27 12:00:45 +02:00
Victor Feyens 46d267c758 [IMP] base: user defaults groups performance
Improve the performance of the default method for user groups by avoiding a `ref` call,
using the group in cache instead.

Calls to ref always trigger one SQL query to verify record still exists
This means that creating 10k user would trigger 10k queries only for the default.

X-original-commit: e67efb88338ef669059591728e7722fe1dff4bf0
2020-04-27 12:00:45 +02:00
Victor Feyens e3c329b9bc [IMP] *: create users and partners in batch
The main classes of partners and users support batch creation, but
the majority of their overrides doesn't support creation in batch.

Adapting those overrides to support records creation in batch shows
great performance gains:

* On `res_partner` : 2 to 3 times faster
* On `res_users`, with the inherited `res_partner` created in batch:
	up to 10 times faster.

Tests done with 500 to 4k records:

* `res_partner` with only a name provided
* `res_users` with a name and login

X-original-commit: 9c3c5f161580039c1fe50f68acac808c18817997
2020-04-27 12:00:45 +02:00
Thibault Delavallée b3218d37c3 [FIX] crm_reveal: fix reveal view model form view
State field is present twice and statusbar widget is not usable.
Let us fix it by ensuring field is present once and widget is
clickable.

closes odoo/odoo#50207

X-original-commit: 5644eb335e82c7184c27b540fc89ae6e77460992
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 09:50:17 +00:00
Andrea Grazioso (agr-odoo) 09d9911d30 [FW][FIX] account,pos_cash_rounding: cash rounding account choice fix
The cash rounding profit_account_id directly impact the account on the
rounding invoice line. If this is configured with a 'payable' or
'receivable' account such line will be read as term and condition line
in '_recompute_payment_terms_lines', messing up the line amounts

Adding a domain to avoid the wrong choice

opw-2214059

closes odoo/odoo#50205

X-original-commit: 303afca8e86a36ff748050cf60ef779663ac1868
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-27 09:30:12 +00:00
Nasreddin (bon) 1987b426ac [FIX] website_mass_mailing: display right value in Newsletter Select
Clearly display to the user which newsletter is currently being used by the
Newsletter Block. Currently when editing the block it displays the first
available newsletter by default. This is confusing for the user that may
think its block was badly configured.

It now clearly display the current chosen newsletter.

Task ID #2192807
Closes #47959

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 09:20:50 +00:00
Andrea Grazioso (agr-odoo) 430b980134 [FIX] account: fix multicompany journal audit report
With a second company generate the report under
Accounting>Reporting>Journals Audit
The name on the report and the currency are the one of the first
company.

This occur because the information on the template is gathered using a
parameter named 'res_company' which is set to the first company and not
the actual one (stored in company_id). Changing the parameter on the
template fix the issue.

opw-2242431

closes odoo/odoo#50173

X-original-commit: 229025e915c6a1a42bb7462486bfa2e6882abad5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-24 15:50:26 +00:00
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