Commit Graph
134566 Commits
Author SHA1 Message Date
Julien Mougenot da8790f0bb [IMP] web: Dialog: add option to stop click propagation
There are situations where we don't want clicks to be detected behind an opened
dialog: for example, when a dialog is opened by a dropdown, we may want to keep the
dropdown open while we interact with the dialog.

There is now an option (default: true) to stop clicks propagation when
they arrive at the dialog container.
2020-03-13 09:37:29 +00:00
Julien Mougenot 384e516218 [REF] web: Update generic files
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible

The logic of the affected code remains the same.
2020-03-13 09:37:29 +00:00
Julien Mougenot 11ba58a311 [REF] web: Indent and reorganize generic files
The purpose of this commit is to correctly indent and order some generic files.
There is strictly no change in the code logic.
2020-03-13 09:37:29 +00:00
Hemali Bhimani ed3fecb633 [IMP] sale: display expiry date on quotation portal view
Currently on the portal, when a quotation has a limited validity
period, it is expried as "This offers exprires in" Xdays but X is computed
always with a additional day and its show "expries in 0 days" so
after this commit it shows the expiry date
(like This offers expires on 20 december 2020) on portal view
instead of X duration.

closes odoo/odoo#46649

Task: 2186428
Closes: #46649
Related: odoo/upgrade#874
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-13 11:41:09 +00:00
Xavier-Do 7313e4c7ec [IMP] core: change master release version.
Before this, the master version is the next major version without taking
intermediate saas versions into account.

Depending on the point of view, one or other choice can make more sense. Anyway,
master is always closer to next saas than next release.

Using next major release can be problematic from a technical reason, mainly for
upgrade scripts
A simple exemple is to write upgrade scripts for master. The script version
will be something like 13.3.1.2 since next saas is saas 13.3 and module version
1.2. The problem here is that installing a database in master will have module
versions setted to  14.0.1.2 since release.py indicates that version is 14.0,
making it impossible to test an incremental version script 13.3.1.3 in master
(will never be executed, 13.3.1.3 < 14.0.1.2)

Another exemple is when testing migrations on a not-rebased branch.
Hypotetically if all upgrade scripts are linked to a specific
version of a module (module version is incremented each time a
upgrade script is added), someone using an old version of the master
won't have the script 13.3.1.3 executed if current module version is 1.2.
(which is not true now since module version will be considered to be
14.0.1.2 (> 13.3.1.2).

closes odoo/odoo#47281

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-03-11 10:35:20 +00:00
yhu-odoo b08e3d114a [REF] stock,stock_account: archived products and quantities
PURPOSE

Keep consistent behavior of the stat buttons and the different stock
reports when archiving a product

SPECIFICATION

Currently, you can archive a product but the behavior of the different
stock reports, stat buttons isn't coherent afterwards. Here are the
different behaviors that should be improved:
1.Keep quantity on hand and forecasted quantity visible (in the stat
button + when opening it)
2.Automatically (un)archive RR and BOM if the product is (un)archived
3.Valuation report: show the archived products without the "archived"
filter (behaves already this way in the inventory and forecast reports)
4.When a product has been archived and still has quantity in stock,
include it in inventory adjustments for which counted quantity = default
to stock on hand (dont do so for archived exhausted products).

Also, revert #47478 since we don't have active field.

LINKS

Task 2178269
PR #45586
Fixes #41634

Related: odoo/upgrade#811
Related: odoo/enterprise#8513
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-13 08:37:26 +00:00
Jorge Pinna PuissantandNicolas Lempereur 7718199ae0 [FIX] base, website: process views without xml_id
The function get_inheriting_views_arch, retrieves the architecture of
views that inherit from the given view. In the case of the module init
is  currently in process only views from modules whose code is already
loaded are taken into account.

Before this commit, the function didn't process views that has been
copied (copy on write, web editor, customize show, manual copy, ...),
this raise an error when trying to install a module. For example,
install module website_sale, copy on write the view 'Main layout',
install module website_sale_wishlist.

Now, views that has been copied are also processed.

opw-2181968

closes odoo/odoo#47590

X-original-commit: d5a2890b30f869c9b4cf7aafed0e05aff9440360
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
2020-03-13 12:52:08 +00:00
Paul Morelle 828531d66f [FIX] mail: fix wrong calls to expression.AND
MailThread._mail_search_on_* was obviously never called with an
extra_domain yet, or it would have raised an exception: expression.AND
expects only one argument, with the list of expressions to AND, and here
we were passing them as *args.

closes odoo/odoo#47585

X-original-commit: b20c5350c4d0e0e140f8824e6f5d2a0009af9810
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-03-13 12:20:57 +00:00
Joseph Caburnay 78beadb748 [REV] web: allow patching getters
This reverts commit d6b854306c.

The reverted commit introduced issues in patching class methods.
Introducing getters in the patch function is not actually compatible
with the original method patching.

Test for patch method is also introduced to guard patch from future
invalid modification that happened.

A more robust  way of patching classes is now being developed.

closes odoo/odoo#47557

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-13 08:41:15 +00:00
jvm-odoo c7f095396e [FIX] product, purchase_stock: fix infinite loop on template name_search
Issue

	- Install purchase_product_matrix, Inventory
	- Create a (storable) Product P with default_code e.g. VOB2A
	  with a vendor V who uses a product_code e.g. VOB2a
	- Create a PO/RFQ for vendor V
	- Add a product, search "vob2" (copy/paste)

	Infinite loop

Cause

	purchase_product_matrix replace purchase.order_line.product.product
	by product.template so the name_search is different and the
	product.template's name_search loop doesn't support the case where
	you have default_code == product_code

Solution

	Check if the product's name_search returned a product containing
	product_template_ids that we did not wanted (as mentionned in the
	domain). If yes, it means that we will have an infinite loop so
	we should break.

Additional note: the issue could be in versions < 13 but
purchase_product_matrix is only in 13.0 and this is not a
very common case.

OPW-2193005

closes odoo/odoo#47576

X-original-commit: 9d5d80f77bc04be83d5b2ca0569a6ea50e26a07e
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-13 11:26:09 +00:00
Lucas Lefèvre 594ca5ea8b [FIX] fleet: Assign internal user as driver
With a user with only Fleet Administrator rights.
Assign an internal user as the driver of a vehicle (other than the
current user) => access error, you cannot write on model `res.user`.

Writing on a partner linked to an internal user requires write access to
this user.

closes odoo/odoo#47572

X-original-commit: a693b368d3faddef6774004d40567e26b7d59cec
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-13 10:30:10 +00:00
Anh Thao Pham (pta) 73a9dc77b6 [IMP] hr: move "Job Position" to "HR Settings" tab after "Related User"
closes odoo/odoo#46656

Related: odoo/enterprise#8950
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-13 09:59:06 +00:00
Lucas Lefèvre 119eddf7cc [FIX] hr_contract: Allow HR user to read first contract date
An HR user (without any rights on contracts) could not open
an employee form view since it needs the `first_contract_date`
field which needs contracts access rights.

closes odoo/odoo#47561

X-original-commit: 14855eee0f9c5737ee5aaa792defe88e138e0d7d
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-13 09:27:17 +00:00
Raphael Collet 5771772b61 [FIX] core: do not force recomputation of fields on new records
The method `recompute()` should not recompute fields on new records.
This is both a speedup (those recomputations are not necessary), and
fixes an error following an `onchange()` (a field recomputed in an
environment with the wrong context.)

OPW 2184998

closes odoo/odoo#47545

X-original-commit: fa852ba1c5707b71469c410063f338eef261ab2b
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-12 17:46:06 +00:00
Martin Trigaux b53614fcc5 [FIX] base_vat: apply child changes before propagation
The synchronisation of commercial_partner_id was introduced at
0d68acff8e as a way to ensure the value is always correct.
The order or the operation was not important though.

This synchronisation has a side effect in the following scenario:

0. install base_vat
1. disable vat_check_vies in the settings
2. set an invalid VAT number on a company with at least one contact
3. enable vat_check_vies in the settings
4. correct the VAT number on the company with a valid one
--> an error was raised for an invalid VAT number on the contact

This is because the commercial_partner_id synchronisation is done
before the update of the VAT number. Even if the value has not
changed, this triggers the check_vat method.

Invert both instructions

Courtesy of Wolfgang Taferner

Closes odoo/odoo#43065
Closes odoo/odoo#42973

closes odoo/odoo#47543

X-original-commit: d9b2605eadc129924d085fffc4056d777cfbbbeb
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-03-13 08:20:32 +00:00
Katherine Zaoral 23e7d0f46c [ADD] l10n_ar: make Sales "IVA No Corresponde" tax inactive
This tax is only used on purchases to monotributistas or exentos but
it's not used on sales.

We deactivate to avoid confusions and will be removed in next version.

closes odoo/odoo#47554

X-original-commit: aaa066d43e6c697cb91714fdc65ee7a18e5a53e5
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-03-13 07:56:43 +00:00
Aaron Bohy f692a39677 [FIX] web: FieldMany2ManyTags: failing quick create record
The FieldMany2One allows to quick create record (name_create).
However, sometimes, required fields on the co-model make the
name_create crash. In this case, the FieldMany2one opens a form
view in a dialog to let the user specify those fields, and create
a new record with the 'create' method. This was working fine.

The FieldMany2ManyTags embeds a FieldMany2One to let the user
search for and select or (quick) create tags. In this case, failing
quick creation didn't fallback on the dialog form view, but
displayed a server error instead. This commit fixes this issue.

Bug introduced by 50bf8309f8

Task 2192754

closes odoo/odoo#47183

X-original-commit: 63ab065f3298c13bb19ae1245d7fd2652581b254
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-09 10:31:01 +00:00
Simon Lejeune d07066bd11 [FIX] stock: routes report: handle mtso
At the moment, when a rule has a supply method "Take from stock, if
unavailable, trigger another rule", it is displayed as a "take from
stock" rule

In order to differentiate the rule supply method, we should rather show,
thanks to a vertical bar, when a rule is in take from stock, and use
both a vertical bar and the three dots when it is in "take from stock,
if unavailable, trigger another rule"

task-2205748

closes odoo/odoo#47541

X-original-commit: e1c1093c3d5fb7be69e8d1d26bcac184b5dc07b2
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-12 17:15:06 +00:00
Laurent Smet 2ab4119c5f [FIX] account: Fix missing field 'always_set_currency_id' in account.move form
This field is used by the account.move.line to know the currency of the invoice.
However, the currency_id is not always set when dealing with a single currency.
In this case, currency_id is False on account.move.line and we need the additional
always_set_currency_id field to know the currency to be used to round the price_subtotal/price_total.

closes odoo/odoo#47528

X-original-commit: 0af1a38a094f92eeccb295a4ceddda26ec399064
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-03-12 16:12:03 +00:00
Benjamin Vray 1a323596cf [FIX] website: restore hidden indicators in gallery snippet
Indicators were hidden in editor when switching to slideshow mode
from any other mode. Because the class of the selected mode was defined
after rendering and we need this class before the rendering. This also
fixes other small issues when switching between different modes.

Part of https://github.com/odoo/odoo/pull/44180
task-2162952

closes odoo/odoo#47519

X-original-commit: a99150b11a463901121bbe9751370231e3564ca2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-12 15:00:38 +00:00
Benjamin Vray 490723b406 [FIX] website: keep same spaces between carousel indicators links
Before that the space between the first two links was more spaced than
the others.

Part of https://github.com/odoo/odoo/pull/44180
task-2162952

X-original-commit: baeb08da7a32b5c185c358ec6820f8a66c6edb4f
2020-03-12 15:00:38 +00:00
Benjamin Vray b339310d31 [FIX] website: update links ids in duplicated carousel snippets
(+ gallery snippet in carousel mode)

Part of https://github.com/odoo/odoo/pull/44180
task-2162952

X-original-commit: 6237c59d607389cb0ed57694bb23b253f49805c8
2020-03-12 15:00:38 +00:00
Simon Lejeune d944e67b46 [FIX] stock_account: _action_done performance
Validating a receipt of 90 stock moves having ~300k products in the
database goes from 7 minutes to 11 seconds thanks to the addition of
"active_test=False in the context before doing the searches on valuation
layers.

Most searches on "stock.valuation.layer" are done when validating a
move, but since this model contains an active field, the orm will
pathologically complete the searches expression by adding "id in active"
products. If the list is long, it slows down everything.

Since this field was only added to have a filter on the valuation
reports, it doesn't matter at all to ignore it in "_action_done".

It would probably have been cleaner to just remove the field but it
doesn't fit the stable policy. Nevertheless, we're going to remove the
field in master with task-2178269, as well as this patch.

opw-2209797

closes odoo/odoo#47523

X-original-commit: 466a8319547e11e2193dd8594b0e50e3c27d4b3e
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-12 15:36:03 +00:00
William Henrotin 31db39a052 [FIX] purchase_requisition: correct search domain
bug introduced by ef16266ad6

Task : 2210230

closes odoo/odoo#47400

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-11 13:40:53 +00:00
Thanh Dodeur 14c0550b29 [FIX] web_editor: fixes the rgb/rgba color selection
Before this commit, `selectStyle` could incorrectly split the
widgetValue (as described below) which resulted in invalid CSS.

widgetValue: `"rgba(55, 12, 99, 0.7) 55px"`
result: `["rgba(55,", "12,", "99,", "0.7)", "55px"]`
expected: `["rgba(55, 12, 99, 0.7)", "55px"]`
fixed: `["rgba(55,12,99,0.7)", "55px"]`

This commit fixes the issue.

closes odoo/odoo#47515

X-original-commit: 37e6b87341e58769ec2c1d080986e84286d84978
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-12 14:24:38 +00:00
jerome hanke (jhk) ec4f846047 [FIX] account_analytic_default: computed fields cannot be readonly=False
Steps to reproduce:
- install acounting, make sure you have account_analytic_default installed
- go to settings and activate Analytic Accounting
- go to accounting > configuration > analytic accounts > create an account
- go to accounting > customers > invoices > create > make an invoice line with
an analytical account > save > edit > add a new line to the invoice and select
any product

Previous behavior:
analytic accounts previously saved are deleted by an onchange

Current behavior:
analytic accounts remains set after any update of the invoice lines

opw-2209169

closes odoo/odoo#47514

X-original-commit: be7d1d7510bc94f949a4fc55a6038a83fb026147
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-12 14:06:58 +00:00
Laurent Smetandbve-odoo 69ad4c8636 [FIX] account: Avoid removing tax from line on recomputation
Steps to reproduce the bug:

- Let's consider a company C with Belgian chart of accounts
- Let's consider a product P with 21% of Tax at 100€
- Go to POS and create an order O for P
- Pay O and close the POS
- Open the journal entry JE of O
- Reset to draft JE and change the Analytic Tags of the 100€ credit line

Bug:

The Tax grids of the 21€ credit line was removed.

PS: This fix avoids the recomputation of taxes when adding analytics tags

closes: #46827

opw-2189255

closes odoo/odoo#47471

X-original-commit: 8c93d6092928f8190f6897b772fe44c0728879c7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: bve-odoo <bve@odoo.com>
2020-03-12 10:31:47 +00:00
qsb-odoo 4818bb48b1 [FIX] l10n_it_edi: add labels to <i> in invoice kanban view
closes odoo/odoo#47507

X-original-commit: 47dc8ad1ee8c210b2e458a379d00a5020ad761a7
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-03-12 13:47:36 +00:00
yhu-odoo 8558408153 [IMP]l10n_cn: add fapiao number to account.move
Add fapiao number to account.move, only show it when the company is
located in China.

Task 2180269
PR #45743

Related: odoo/upgrade#813
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-03-10 07:55:23 +00:00
yhu-odoo 7edb5c111d [IMP] account: Add country_code to account.move
Add country_code related to company_id.country_id.code to avoid doing
that in every localizaiton module.

Task 2180269
PR #45743
2020-03-10 07:53:43 +00:00
Patrick Hoste 8509ba7d2a [IMP] (website_)event: add new tour to demonstrate new features
PURPOSE

Create a tour for Events to introduce new users to this freshly
revamped application.

SPECIFICATIONS

In 'website_event' module the tour steps extends the 'event' tour steps

LINKS

Task ID : 2180175
PR : #45612

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-12 12:45:16 +00:00
Odoo's Mergebot ee8c1b09cd [MERGE] tools, mail: ease bounce email content update based on alias security
PURPOSE

When incoming emails bounce due to alias security bounce email is quite
generic. Purpose of this task is to ease its customization and update.

SPECIFICATIONS

In order to improve the flexibility of alias, add a customizable html field
on the alias model. This html content will be send as bounce email core content
in case of bounced/unauthorized mail received for this alias,

Obviously it has no effect on 'everyone' security setting as no email will
bounce due to that issue.

If it is not set a default generic mail will be send depending on security
setting. It allows to keep void html fields when no specific bounce content
is required

In HR, an old template allowing some light customization for employee based
security option is removed as it is completely replaced by the new feature.

Also add references message-id of the mail received to the answer so that
threads are correctly set.

LINKS

Task ID 2126509
Community PR odoo/odoo#41827
Upgrade PR odoo/upgrade#936

Related: odoo/upgrade#936
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-12 15:27:06 +01:00
Rémy Voet (ryv) c5e6511e8d [IMP] mail: ease bounce email content update based on alias security
PURPOSE

When incoming emails bounce due to alias security bounce email is quite
generic. Purpose of this task is to ease its customization and update.

SPECIFICATIONS

In order to improve the flexibility of alias, add a customizable html field
on the alias model. This html content will be send as bounce email core content
in case of bounced/unauthorized mail received for this alias,

Obviously it has no effect on 'everyone' security setting as no email will
bounce due to that issue.

If it is not set a default generic mail will be send depending on security
setting. It allows to keep void html fields when no specific bounce content
is required

In HR, an old template allowing some light customization for employee based
security option is removed as it is completely replaced by the new feature.

Also add references message-id of the mail received to the answer so that
threads are correctly set.

LINKS

Task ID 2126509
2020-03-12 13:54:32 +00:00
Rémy Voet 974f512f5f [IMP] tools: add a tool method to find if an html content is empty
In odoo empty html is not always completely empty. This tool method allow
to consider html holding void tags as empty html. This happens notably when
using the editor that may store <p><br><p> even if displayed content is void.

Task ID 2126509
PR #41827
2020-03-12 13:54:32 +00:00
Thibault Delavallée b1037eb2d1 [IMP] digest, various: add name on tips to ease their understanding
PURPOSE

Ease edition of digest tips by adding a name.

SPECIFICATIONS

Add a name on digest tips. Even if technical and not send to customers it
allows to see them at a glance in list view without having to guess their
content.

LINKS

Task ID 2214325
Com PR odoo/odoo#47416

Related: odoo/upgrade#933
Related: odoo/enterprise#9167
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-11 16:24:32 +00:00
Thibault Delavallée 70c1c3a88f [IMP] digest: add views for digest.tip
PURPOSE

Allow to edit and improve digest tips by adding views.

SPECIFICATIONS

Add views for digest tips. Locate those views in technical menu, in email
section, below Digest Emails.

LINKS

Task ID 2214325
Com PR odoo/odoo#47416
2020-03-11 16:24:32 +00:00
Adrian Torres 9493f23977 [FIX] core: do not nag about dependencies for modules to remove
Before this commit:
    - Install a module
    - Uninstall the previously installed module
    - The registry will complain that some dependencies may be missing
        for the module being uninstalled

This happens because we check after the installation / upgrade of
modules that none have been left in a transient state to verify that new
dependencies have been properly installed and loaded, this applies to
'to install' and 'to upgrade' states however it's not the same for 'to
remove' states, as the process of uninstall happens much later in the
code.

After this commit, simply uninstalling modules will not trigger this
error log.

Do note that in case of a problem with an uninstall, the function
"reset_module_states" will tackle the case of leftover transient states.

closes odoo/odoo#47495

X-original-commit: c095a28314f78d1d9854e5e9bcb26014922a4f12
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-03-12 12:26:58 +00:00
Pierre Masereel ab6acae6a0 [FIX] point_of_sale: print ticket when offline
When your point of sale is offline and you try to print your ticket from
the button 'Print Receipt', the notification "trying to reconnect" is
displayed on the ticket. We are removing it when it is printed.

closes odoo/odoo#47481

X-original-commit: 9aa9705c2dce1c6164b5909500e7c2038b93812c
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-03-12 11:23:08 +00:00
Andrea Grazioso (agr-odoo) bc48e0033e [FIX] point_of_sale: replace (re)invoice button with info message
In POS Settings activate IoTBox, and its suboption 'Receipt Printer'
Activate now 'Reprint Receipt'

Open the POS, make an order, validate and go to a next new order.
Click on 'Reprint Receipt', then 'Print Invoice', fill the customer and
try again

Server Error message will popup, reprinting the invoice is thus,
impossible.
In v13 the action warn the user to print the invoice via backend, so
this commit replace entirely the button with the message

opw-2195440

closes odoo/odoo#47049

Original-signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
X-original-commit: d2a7300e8ebddf5dd812ffec75b3eda1a083aeeb
2020-03-12 11:23:07 +00:00
jvm-odoo 31551f8e51 [FIX] web: prioritize record context instead of bin_size
This commit allows to pass a bin_size context to False.
Before this commit it wasn't possible because it was
always overriden.

OPW-2208232

closes odoo/odoo#47491

X-original-commit: 17d53cea1043054dfa9c39b16b430539c4082a9d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-12 12:10:11 +00:00
jvm-odoo 8544155b13 [FIX] base_setup: fix image parsing error on save
Issue

	- Have 2 languages installed
	- Install Invoicing & Website
	- Go in Settings
	- Search "logo" (image)
	- Upload a logo for your website
	- Save
	- Search "Default terms & conditions" (translatable field)
	- Click on the translate button (e.g. EN if you are in
	  english)

	A popup will appears saying that you should save your
	changes.

	- Click on Save & do not edit translation (not needed)
	- Search "logo"

	Image disappeared

Cause

	When saving, a read is called. By default, read has
	bin_size to true to avoid performances issues.
	It will return the image size instead of the content

	This is why the image disappeared.

Solution

	As configuration is dirty, you are forced to save &
	it will always read with bin_size set to true.

	My solution would be to set it to false for settings.

OPW-2208232

X-original-commit: 93a7695f65baf00d1f82481d6a2a97e6c11940a8
2020-03-12 12:10:11 +00:00
Andrea Grazioso (agr-odoo) e47ba38456 [FIX] mail: do not escape feedback before sending to backend
Open every model with the chatter
Schedule an activity
Click on "Done" button and insert a feedback with an accent/quote.

Escaped sequence will appear as result.
In v13 the html feedback field which was used to store feedback
was replaced by the mail subsystem, so the value should be sent to the
message_post_with_view unescaped

opw-2209081

closes odoo/odoo#46985

X-original-commit: d66c676e6a49cbf4cfcdae014c3b5e80dd7920d2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-05 13:50:46 +00:00
Xavier-DoandRaphael Collet 03708af20e [IMP] core: make exists determinist
When testing odoo, errors can occur an undeterministic way, wich can
lead to strange and unreproductible behaviour.  This also means that the
performance can change from one execution to another, making it quite
difficult to track performance variation on a global scope.

This commit makes the result of `exists()` deterministic in terms of
order.  The side effect is to keep record ids in the same order as the
original recordset, which may be useful.

closes odoo/odoo#47282

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2020-03-12 09:37:04 +00:00
Josse Colpaert dad3556e97 [FIX] l10n_de: added taxes tags need country_id
A constraint was added.  That is why we had the error,
but we need the fix anyways, otherwise the tags won't be
visible in the configuration of the taxes.

Task id: 2214184

closes odoo/odoo#47440

X-original-commit: 9bac70b6a0e5eab76910c5728371310e32d9cf8a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-11 16:52:58 +00:00
Odoo's Mergebot 616c3fdb8c [MERGE][IMP] website_[sale_]slides: allow users to take the slide quiz before joining the course
PURPOSE

When previewing a slide of type 'quiz', users are tempted to answer the
questions even if they are not member of the course yet.

This commit will allow users to answer the quiz without being a member of the
course, and offer a smart redirection to join / buy based on the enroll type
of the channel.

SPECIFICATIONS

We introduce a "CourseJoinWidget" that will handle the display and the behavior
of the "join" button based on the user (public or not) and the enroll type
(public course or based on a payment).

When the user answers questions and he's not a member yet, we store the answers
temporarily in the session object.
When he comes back on the quiz page after having completed his membership, we
fill in the quiz based on his previously entered answers and clean the session.

LINKS

Task 2045571

closes odoo/odoo#41972

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-12 10:24:33 +01:00
Aurélien Warnon 3aaefe74a1 [IMP] website_sale_slides: improve demo data
As portal user has access to the "Taking care of trees" demo course, we add
this course to the sale order that already contains the "DIY Furniture".
Since the course is "pay to access", it makes more sense.

LINKS

PR #41972
Task 2045571
2020-03-12 08:31:19 +00:00
Florent LejolyandAurélien Warnon 660e105431 [IMP] website_[sale_]slides: allow users to take the slide quiz before joining the course
PURPOSE

When previewing a slide of type 'quiz', users are tempted to answer the
questions even if they are not member of the course yet.

This commit will allow users to answer the quiz without being a member of the
course, and offer a smart redirection to join / buy based on the enroll type
of the channel.

SPECIFICATIONS

We introduce a "CourseJoinWidget" that will handle the display and the behavior
of the "join" button based on the user (public or not) and the enroll type
(public course or based on a payment).

When the user answers questions and he's not a member yet, we store the answers
temporarily in the session object.
When he comes back on the quiz page after having completed his membership, we
fill in the quiz based on his previously entered answers and clean the session.

LINKS

Task 2045571
PR #41972

Co-authored-by: Florent Lejolyn <fle@odoo.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2020-03-12 08:30:16 +00:00
Aurélien Warnon 1a92829c7d [REF] website_slides: rename 'channel_management.xml' to 'slide_course_join.xml'
This commit simply renames a template file to better reflect its purpose and
also align with its JS widget file naming. It is a preparation commit for
pending changes.

Task 2045571
PR #41972
2020-03-12 08:29:55 +00:00
Adrian Torres cd4b50de6f [FIX] base: don't uninstall already uninstalled modules
Before this commit:
    - Install some random module that can be uninstalled (so not base)
    - Open the uninstall wizard for said module in two different tabs /
        windows / whatever
    - In one tab, confirm the module uninstall and wait for it to be
        done
    - As soon as the other tab is done with the uninstall, go to the
        second one with the uninstall wizard still open, and proceed
        with the second uninstall
    - Boom, the registry crashes and completely fucks up the DB because
        there's no check at all that prevents the uninstall of already
        uninstalled modules.

After this commit:
    - `ir.module.module.button_uninstall` will check if all the
        modules being uninstalled are in the installed state
        and if not a UserError will be raised, preventing a second
        uninstall of the module which could potentially break the DB

Do note that this fix is LOCAL, the problem is however more or less
global, wherever there's user-actionable buttons that should only be
pressed once there's a potential for bugs / breakage if a similar fix is
not implemented locally. Perhaps a more global fix should be implemented
eventually, but it's generally less annoying for business cases since
those probably won't break the registry, see task 1859014.

opw-2213679
opw-2212594
opw-2206446

closes odoo/odoo#47450

X-original-commit: 8c1bb22ec0222dca652e0649454b986c06cb1368
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-03-11 18:52:52 +00:00
Andrea Grazioso (agr-odoo) 29e0227081 [FIX] account: avoid double unlinking
With l10n_mx installed:
- Check in the settings that cash basis option is activated, and enabled
on a Purchase Tax (example : IVA(16%) COMPRAS)
- Create a vendor bill with this tax, validate it and
register payment.
- Create a credit note to this invoice, validate and register payment.
- Cancel the credit note

Error will occur, a record is already deleted.
This occur because the canceling action recursively find every related
move to delete, but in the process an account.full.reconcile is going to
be unlinked twice: a check on reverse the exchange rate entry will
trigger the error because the record is already deleted

opw-2199093

closes odoo/odoo#47432

X-original-commit: a230690d947be2095ad1ec7ccca170f9faa222dc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-11 16:15:22 +00:00