Commit Graph
135175 Commits
Author SHA1 Message Date
Thibault Delavallée 6cf824933f [IMP] survey: cascade archive of a survey to its badge
Purpose of this commit is to synchronize active status of certifications to
their badges. When archiving or activating a certification, its badge is also
archived or activated.

Task ID 2170708
Community PR odoo/odoo#46563
2020-04-03 12:59:29 +00:00
Thibault Delavallée bea9bc3d6c [IMP] mail, mass_mailing, phone, survey: call toggle_active / action_(un)archive when possible
Purpose of this commit is to call toggle_active or archive / unarchive methods
instead of manually writing on active field. Indeed this allows to trigger
business code related to archive / unarchive which is normally located
in toggle_archive (called by action_archive and action_unarchive).

Task ID 2170708
Community PR odoo/odoo#46563
2020-04-03 12:59:28 +00:00
Thibault Delavallée 9b76c6b7f1 [IMP] crm: better use toggle_active and add business behavior in it
Purpose of this commit is to make use of toggle_active to implement business
behavior linked to active field being changed. In CRM notably

  * when archiving: it is considered as lost, and therefore probability is
    set to 0;
  * when reactivating: void the lost reason and update probabilities for PLS;

In this commit we also update tracking subtype to more clearly track
lost / restored subtypes

  * lost: writing a lost reason (resetting it is not lost), archiving
    it if no other subtype;
  * restored: activating it again;

Task ID 2170708
Community PR odoo/odoo#46563
2020-04-03 12:59:28 +00:00
Thibault Delavallée 318f02b8e8 [REF] base: replace toggle method by already-existing toggle_active for ir.ui.view
Toggle method defined on ir.ui.view does the same job of toggle_active that
is the generic one available on all models.

Task ID 2170708
Community PR odoo/odoo#46563
2020-04-03 12:59:28 +00:00
jvm-odoo 15227170cb [FIX] website_forum: fix answer name disappear after edit
Issue

	- Install Forums
	- Create a post (name = test)
	- Add an answer
	- Check your profile > answers

	You have an answer named "Re: test"

	- Edit the answer
	- Check again

	"Re: test" disappeared, it's a blank line now

Cause

	When editing the answer, we do not pass a name
	So if we do name = kwargs.get('name') => None

Solution

	Pass the name to the vals if it exists

OPW-2227418

closes odoo/odoo#48970

X-original-commit: c53f1c6a58b4c8c9e9b3c87f27281c9bfd65a0e1
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-03 11:58:56 +00:00
Raphael Collet 0563093d1e [IMP] ir.ui.view: optimize _compute_arch
Simply avoid computing a field when not necessary.

This saves 0.5% of the total installation time.

closes odoo/odoo#48967

X-original-commit: f3fa93228b6ea8e9e171aaa508ca0218d70406f3
Related: odoo/enterprise#9655
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-03 11:40:30 +00:00
Raphael Collet 8a3e1a0ccd [IMP] ir.ui.view: call _update_user_groups_view() once per install
This saves 1.5% of the total installation time.

X-original-commit: afd39e1a9824252d13823e484c60ad813b9b51a6
2020-04-03 11:40:30 +00:00
Raphael Collet a233d534c2 [FIX] core: add NOT NULL constraints in post-init
The method `_init_column` for the field `alias_id` of `mail.alias.mixin`
requires the reflection of models, because `mail.alias` records have a
many2one field to `ir.model`.  The actual initialization of the column
is thus performed in post-init phase (after reflection).  Therefore, the
NOT NULL constraint cannot be added right away.

X-original-commit: 2e3400f149ce4ed4c00bc49a519f58993b49bc51
2020-04-03 11:40:29 +00:00
Raphael Collet 9afce4805f [IMP] core: reflect models, fields and selections in batch
This saves 4.5% of the total installation time.

X-original-commit: 8519064dce975af542ccd30dc14c56b9bb36d07b
2020-04-03 11:40:29 +00:00
Raphael Collet 6eb7d5c6a0 [IMP] core: add/update foreign keys in batch
This greatly reduces the number of queries to add foreign keys (notably
for many2one fields).

This saves 6.5% of the total installation time.

X-original-commit: 13a2666b4da09fc0ec7608a974dadde45f76fd7a
2020-04-03 11:40:29 +00:00
Raphael Collet e0c2dde324 [IMP] core: create/drop indexes all at once
Reduce the number of queries to create and drop indexes.

This saves 1.5% of the total installation time.

X-original-commit: 0e1e480da9d971575feba64038c4fa518ebe102b
2020-04-03 11:40:29 +00:00
Raphael Collet 3ecb6fdcb0 [IMP] core: optimize model._auto_init() on a new model
Create the table with all the columns from scratch, with the NOT NULL
constraint when required.  Also do not call `_check_removed_columns()`
on a new table.

This saves 0.5% of the total installation time.

X-original-commit: 0727cacf5194a143b15ab4cb9893f3035a67be1f
2020-04-03 11:40:28 +00:00
Raphael Collet 892e3df701 [IMP] core: compute field_computed lazily
This is a simple refactoring.

X-original-commit: 634775bff6d9eba9d4548cc801071a942895a719
2020-04-03 11:40:28 +00:00
Raphael Collet 0551e7ad54 [IMP] core: compute field triggers lazily on registry
This saves 2% of the total installation time.

X-original-commit: 6a0028f91944b1d9e4eac026e86ca249ef5bc7ee
2020-04-03 11:40:28 +00:00
Raphael Collet 8b94e53084 [IMP] core: optimize field._setup_related_full
Simply avoid browsing records for models, and use classes instead.

This saves 1% of the total installation time.

X-original-commit: 35ebaea098edeb3d34f77305b09cb36e56ea5a92
2020-04-03 11:40:27 +00:00
Raphael Collet f3932ea716 [IMP] core: remove Field._slots
This optimization is no longer necessary.  Thanks to Python 3.6's new
implementation of dicts, the memory footprint difference between slots
and dicts is now around 5%, which is no longer worth the complexity and
performance cost.

This saves 2% of the total installation time.

X-original-commit: c7f17770803744cbbb741fc11265ee914641aed7
2020-04-03 11:40:27 +00:00
Raphael Collet f694caac41 [IMP] core: optimize model._setup_base()
Simplify the code to retrieve fields on a class.
Simplify the class attribute that lists the class' proper fields.
Optimize `model._add_inherited_fields()`.
Optimize `resolve_mro` by using classes instead of recordsets.

This saves 3.5% of the total installation time.

X-original-commit: 89ab71905cb6c5d3beda5eac357f8592e31aaef8
2020-04-03 11:40:27 +00:00
Raphael ColletandXavier Morel b491ca0bb3 [IMP] core: avoid duplicates in depends and depends_context
Repeated calls to `registry.setup_models()` will eventually introduce
many duplicates in the those attributes, which may slow down the
determination of computation triggers.

X-original-commit: 735e65f7ca45616881336121d10a874412446dcf
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-04-03 11:40:26 +00:00
Raphael Collet db276e4d99 [IMP] core: perform xmlid_lookup in pure SQL
This saves 3% of the total installation time.

X-original-commit: ed2971023edf0ce475e6972598e9d0dfaa88c2b8
2020-04-03 11:40:26 +00:00
Raphael Collet 7030fc179d [IMP] modules: don't mark all packages as 'update' unless necessary
When installing a database from scratch, marking all packages (in the
module graph) as 'update' forces the migration manager to retrieve all
migrations scripts... for nothing.

X-original-commit: fd8f3c73c8c30162034c7712fa0993e2408fba89
2020-04-03 11:40:26 +00:00
Damien Bouvy 9702142204 [IMP] odoo: avoid useless error in logs
Avoid logging an error in the logs for an operation that is not an

closes odoo/odoo#48957

Error: if the extension already exists, this is a success.
X-original-commit: 2f884942c94a640ae5107ff2acb27ba4ecc60bc0
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-04-03 10:27:12 +00:00
Aaron Bohy 147d7e8910 [FIX] web: form: hide labels of oe_(read|edit)_only fields
In a form view, nodes with classname "oe_read_only" (resp.
"oe_edit_only") are only visible in readonly (resp. edit) mode.
Moreover, fields inside a group automatically have an associated
label.

Before this commit, when one of these classnames was set on a
field node inside a group, the effect wasn't applied on its label,
so the label was always visible, even if the field was hidden.

Bug reported in PR odoo/odoo#48699

closes odoo/odoo#48968

X-original-commit: 705f434f0f18a0e4d2fdb0f86d3e350d190b2a30
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-03 11:41:05 +00:00
Thibault Delavallée 540df68b32 [FIX] crm: do not erase activity_type_id field value when converting
activity_type_id is a related field on the first activity to do and should
probably not be reset / forced to a value. It is probably some code coming
from previous implementations of activities that were linked to crm only.

Coming notably from 87e457158e and 42226de46e .

Community PR odoo/odoo#48946

closes odoo/odoo#48960

X-original-commit: de2e682824a636062fbb2c47b1bf5d7c7cef18db
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-03 11:08:18 +00:00
Odoo's Mergebot c6c1080be1 [FW][MERGE] event_*: provide various fixes related to last 13.3 changes
PURPOSE

Provide fixes for event application in order to fix 13.3 changes.

SPECIFICATIONS

See sub commits for more details. Globally fixes are related to start and
end dates, as well as sold out computation.

  * include timezoned event date_end in registration open computation;
  * ensure event_registrations_open can always be computed;
  * better sold out computation and display;
  * improve backend views and help strings;
  * add some test for is_ongoing with timezones;
  * remove unnecessary copy=True added while converting fields;

LINKS

Task ID 2228189

closes odoo/odoo#48959

Forward-port-of: odoo/odoo#48652
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-03 13:30:45 +02:00
Thibault Delavallée cee2b11da2 [FIX] event_*: remove now unnecessary copy=True
Commit 397872a07f remove most onchange in event related modules to replace
them by computed r+w stored fields. At that time copy was by default set to
False for computed fields as resulting of standard behavior.

Since 4b274d3b4101fbae154a572cdf40d23838899773 this is not True anymore as we consider those fields are
duplicable. We can therefore remove unnecessary copy=True on fields to clean
their definitions.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: c6b378987bd3351deba7770b51c2a5755f7ff341
2020-04-03 11:07:56 +00:00
Thibault Delavallée bc1b5e134b [FIX] website_event: better sold out computation
Purpose of this commit is to remove some complex check embedded in templates
and replace them by a computed unstored field. It eases definition and
understanding.

Its computation has been cleaned, so that sold out appears only when tickets
are really sold out, not if their end sales date is reached. Sold out label
is displayed in both event list and event specific page views in frontend.

Small spacing issues in frontend registration form are also fixed.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: c36cf90e7b83d2424b2f52ad8a2fec0bf367e8d8
2020-04-03 11:07:56 +00:00
Thibault Delavallée b29b4bcbfc [FIX] event: ensure event_registrations_open can always be computed
Using a compute_sudo ensure this field is correctly computed (aka without
crash) if someone is allowed to read the event but not all its sub models.
For example event_registrations_open reads the active flag of a product
linked to a ticker which may not be readable by public users. This field
is used in frontend templates and therefore usable by external people.

Also remove unnecessary registrable rendering parameter in website_event
as it has been replaced by computed fields.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: b2b334a65f3a1379f25717ec39f0a52f3305b19c
2020-04-03 11:07:56 +00:00
Thibault Delavallée d2840a0519 [FIX] event: include timezoned event date_end in registration open computation
Purpose of this commit is to try to lessen random conditions being concatenated
in templates by correctly computing event_registrations_open field that is
now correctly based on

  * event.date_end -> if event is done, registrations are not open anymore;
  * event.start_sale_date -> lowest start date of tickets (if any; start_sale_date
    is False if no ticket are defined, see _compute_start_sale_date);
  * any ticket is available for sale (seats available) if any;
  * seats are unlimited or seats are available;

Some better timezone computation is included even if it could be done better.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: a11af9074499465b6dd8ad1400e60c7af96e21c7
2020-04-03 11:07:55 +00:00
Thibault Delavallée 55c8367ce7 [IMP] event: add some test for is_ongoing with timezones
Rumors were heard of is_ongoing not working well. First try with playing
with timezones.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: d54faa336da29ff3167edb2331edd3e2508bc64f
2020-04-03 11:07:55 +00:00
Thibault Delavallée 844909b0f1 [IMP] event: improve backend views and help strings
Embedded tickets view: improve labels, start and end dates are now labeled
Sales Start and Sales End when having sale installed.

Help are added on event_registrations_open and start_sale_date to clearly
define what they mean.

Some linting is also performed to ease readability, notably some computed
fields reorganization to have them ordered by group like fields.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: e2deabc451aa2d62365b1e1b43ea3947907d2648
2020-04-03 11:07:55 +00:00
Nicolas Martinelli bc129637bb [FIX] mrp: False barcode
- Create a MO for a product tracked by S/N
- Perform the MO
- Print the 'Finished Product Label (PDF)'

The barcode printed is `False`.

If the S/N is not set on the `move_line`, we should fall back on
`lot_id.name`.

opw-2228337

closes odoo/odoo#48949

X-original-commit: fb69b5a99becd92ee0ee7698709da05a0b33850f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-03 09:41:23 +00:00
Xavier Morel 6c4e4981bc [IMP] core: remove odoo.tools.safe_eval._get_opcodes
It's not necessary anymore as all supported Python versions implement
get_instructions, and inlining the usage of that is as readable as
calling _get_opcodes.

Also use the subset/superset predicate for validity testing instead of
difference as it's a fair bit faster:

    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5))' 's2 - s1'
    5000000 loops, best of 5: 88.3 nsec per loop
    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5, 15))' 's2 - s1'
    2000000 loops, best of 5: 159 nsec per loop
    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5))' 's1 >= s2'
    5000000 loops, best of 5: 71.1 nsec per loop
    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5, 15))' 's1 >= s2'
    5000000 loops, best of 5: 53.6 nsec per loop

we're paying double in the failure case but that doesn't super duper matter
because we're raising an exception and bailing out, the 24% gain on the
happy path seems more relevant.

closes odoo/odoo#48948

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-03 09:35:08 +00:00
Andrea Grazioso (agr-odoo) 366a7d6115 [FIX] sale_project: be able to create fsm projects from sale order
Install project,sale_management,industry_fsm
Create a new product with:
- Product type: service
- Service Invoicing Policy: Timesheets on tasks
- Service Tracking: Create a task in sales order's project
- Project Template: Field Service
Save, then edit also Field Service chaning Bill from Tasks to the new
product
Create a sale order with such product, save and confirm

Error Message "An FSM project must be billed at task rate"
will popup blocking the action. This is due to changes introduced in
071711bf1db82ae7fc65dcc1292da6ef82278168 (enterprise commit), new fsm
projects should not have a sale order line, instead rates are derived
from the tasks.

This commit refactor the code of '_timesheet_create_project' to make
possible to override project creation values. In the counterpart commit,
in enterprise, the sale order line id will be removed to match the behavior
of 071711bf1db82ae7fc65dcc1292da6ef82278168

opw-2220184

closes odoo/odoo#48936

X-original-commit: 4094cb12a617df99fdc7d6d8796568217c34c175
Related: odoo/enterprise#9645
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-03 08:35:21 +00:00
Nicolas Lempereur 28f99db1e8 [FIX] web: no false positive "drag and drop on month mode with all_day mapping"
The "Views > CalendarView > drag and drop on month mode with all_day
mapping" test would fail regulary with "Found 2 elements to click on,
instead of 1" because the drag and drop would be ongoing and the event
would sometimes appear two times in the DOM when we try to click on the
drag and dropped event.
closes #48928

closes odoo/odoo#48937

X-original-commit: 9bc0b11b2e255852c1376fe6fa87722186681a73
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-03 08:35:55 +00:00
jvm-odoo 8c888caeab [FIX] sale: fix quantity input in SO template
This commit is a fine tuning of 348a5d0a6.
It fixes the same issue but for larger screens
with some themes (e.g. Orchid).

When there are big button to chose the quantity,
this padding is hiding the input's text.

Another solution would be to remove `width: 50%`
but I found that removing the padding is prettier.

OPW-2220893

closes odoo/odoo#48934

X-original-commit: 105a34accc6123cfb6be9738858499737df95613
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-03 07:41:15 +00:00
Samuel Degueldre 0c9eb9e5c7 [FIX] web_editor: fix dialogs (link, media, alt, crop) not opening
In 3f4092d837d50d25d6c9630d84f67545cf586c7a, the SummernoteManager that
was previously owned by RTE was removed, this was because the wysiwyg
already has one. One problem with this however is that when an editor is
created in an iframe, the wysiwyg is instanciated outside, while the
editor is instanciated inside. This means that they don't have the same
core.bus to listen for and trigger events, such as those used to open
the various editor dialogs. This commit fixes that by always using the
top-level core.bus when opening dialogs. This also has the advantage
that the dialogs are no longer confined to the iframe and can take up
the whole screen, making them more comfortable to use.

closes odoo/odoo#48932

X-original-commit: 68ac735aa7e17e66910f51706829035697dfcc1e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-03 07:21:20 +00:00
Benjamin Vray 98161fc61a [FIX] web_editor: fix updateui method
replace the "return" with "continue". What should have been done when
the loop that was originally a "foreach" became a "for" loop.

closes odoo/odoo#48919

X-original-commit: 8af8e6ddb2be9a0c57356d075e092b8da42662f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-02 23:54:12 +00:00
Adrian Torres 0cb6f111b8 [FIX] payment_*: reset payment acquirers to default on uninstall
The `payment` module introduces a certain amount of payment acquirers,
each one corresponding to a `payment_` module.

When a `payment_` module is installed, this data is updated so that
payments done with the corresponding acquirer change in behaviour using
the provider installed by the `payment_` module.

When a `payment_` module is uninstalled, this data should be reset to
default, more especifically the `view_template_id` and the `provider`
fields of `payment.acquirer`.

This was not possible before this commit, and more importantly it would
make the uninstallation of such `payment_` module impossible as the
`view_template_id` is a required m2o ondelete='set null', which will
make the registry crash. Even if the former wasn't a problem, the
provider field would remain set to a non-existing selection option,
which would make the registry crash (eventually, when checking a record
with such a selection option).

With this commit, we reset these fields to their default value upon
module uninstall.

In 13, the issue with `view_template_id` should be fixed, as required
m2o that are ondelete='set null' are no longer possible. As for the
provider Selection field, a fix should arrive in master soon.

opw-2225333

closes odoo/odoo#48916

X-original-commit: 4f0c1c1bfd71dd1ff6793d0a91b49984c54d1351
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-04-02 21:47:21 +00:00
Samuel Degueldre bf9d864fb0 [FIX] website: fix logo not supporting new image url format
In a recent commit, we decided to change the image url format generated
by the media-dialog to leverage browser caching using unique.
Unfortunately, when saving an img tag to a binary field, the url parsing
did not support this new url format, causing a traceback when changing
the website logo and attempting to save.

closes odoo/odoo#48914

X-original-commit: 9c618c7f903f1a0b32e067cfd713cd39762250f9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-02 18:49:03 +00:00
Andrea Grazioso (agr-odoo) 9ae9e7e0a6 [FIX] mrp: fix bom products quantity calculation in list view
Go to inventory>product variants (list view), search for
'FURN_78236'.
Set quantity on hand (qty_available) 50
Now, back in list view, adjust your search to FURN_7

QTY on hand for FURN_78236 is 0.

This occur because during the computation of qty_available, the bom
kits (FURN_78236) are calculated first, but the qty_available depends
on the bom lines products, which are calculated only at the end.
Since qty_available became protected by the global environment, it
cannot be recomputed recursively and it is not in cache, thus is 0.

Making the simple products compute first in the _compute_quantity fix
the issue

opw-2226417

closes odoo/odoo#48924

X-original-commit: f41c650f162021bb6c76736c7dcbe4eee059cec1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-03 06:25:37 +00:00
Benjamin Frantzen (bfr) d1bbf11af2 [IMP] account: usability of account.move form view
- moved company_id in other info tab
- currency_id is shown near journal_id
- invoice:
-- ref renamed to 'customer reference' and move to other info tab
-- payment_reference hidden if state is draft
-- Fixed bug in l10n_in where xpath did not find removed element
- vendor bill: auto-complete only shown in edit mode

was task:2209497

closes odoo/odoo#48913

X-original-commit: 170635c901914cfe8f33fdbe8d498cbd5f54054e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-02 18:48:39 +00:00
Nicolas Martinelli 56a8ea9422 [FIX] sale_stock: UoM of forecast stock
- Activate Multi UoM
- Create a product P with 120 Units in stock
- Create a SO for 1 Dozen

120 Dozens are expected in the forecast widget instead of 10 Dozens.

This happens because the various product quantities are always expressed
in the product UoM:

https://github.com/odoo/odoo/blob/c95fad77ea5b4663130e256f76031560171f09e6/addons/stock/models/product.py#L190

We add a conversion when necessary.

opw-2224335

closes odoo/odoo#48885

X-original-commit: 39eab482c765ce0404c2c689aa522a023cac284e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-02 13:30:30 +00:00
Lucas Lefèvreandaab-odoo 1248292630 [FIX] web,*: Remove undefined domain in action menu context
*google_drive

Go to a user form view and click on "Change Password" in the action
menus.
=> traceback `Cannot read property 'constructor' of undefined`

This error is raised because `active_domain: undefined` is in the context
and py_eval can't handle an undefined value.

closes odoo/odoo#48915

X-original-commit: 69694c627be42e3d068e48be14026493628a3a8d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2020-04-02 21:06:25 +00:00
Paul Morelle a768937a39 [FIX] website_form: adapt to Bootstrap new API
Since Bootstrap 4, a popover object does not have an `option` attribute,
as it has been renamed to `config` instead.
This occurrence must have been missed out when we migrated.

closes odoo/odoo#48911

X-original-commit: 662dd304d5a46a028ce74864076361865d759080
Signed-off-by: fja-odoo <fja-odoo@users.noreply.github.com>
2020-04-02 16:06:12 +00:00
Laurent Smet 4ba265a328 [FIX] account: Recompute the account set on payment terms when changing the partner.
- Create an invoice without partner.
- Set a custom receivable account.
- Set a partner => the account used as payment terms is not recomputed that is wrong.

closes odoo/odoo#48898

X-original-commit: 33de1c8f5e459eb26194736c17c053dce3a1c206
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-04-02 14:33:34 +00:00
Raphael Collet 962412c309 [FIX] test_website: upgrading inside a test is really not a good idea
Because: (1) the upgrade starts by committing the current cursor; then
(2) the upgrade instanciates a new registry to use for the database; and
(3) the test cleanup involves setting up the old registry, which creates
a new environment referring to the new registry!

The points (2) and (3) makes the field setup crash when it relies on
data stored on the registry itself: the field in the old registry tries
to set up with data stored on the old registry.

closes odoo/odoo#48920

X-original-commit: f5e5aba9e203b42b661cc3b503fd37051ec20f93
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-02 23:54:32 +00:00
Raphael Collet 46b7fb5984 [FIX] core: do not register classes when _module is falsy
The goal is to avoid a class from being added in the dictionary
`MetaModel.module_to_models`.

We use this feature in tests to prevent classes extending models from
triggering bugs when reloading the registry (for whatever reason).

X-original-commit: 12db61b787b2035bf0c1f2a68a24449d484744c8
2020-04-02 23:54:32 +00:00
Christophe Monniez 0f7d670434 [FIX] web: skip calendar timezone qunit test until fixed
closes odoo/odoo#48909

X-original-commit: 889dd9245eea4a06faf5aae81a47971f9db4b93f
Related: odoo/enterprise#9634
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-02 15:50:51 +00:00
Florent de LabarreandNicolas Lempereur a72bf31d0b FIX] web: allow section and subsection in report
In 10.0 having a `section`, `subsection` or `subsubsection` on a footer
element would replace the content with the page top three level of
headings.

This was removed in 11.0 with b446930dc after which only `page` (current
page number) and `pages` (total number of page) classes would work.

This commit reintroduces the above-mentionned classes.

opw-2226700

closes odoo/odoo#48888

X-original-commit: 14c6b947ecf222524a577ec6a40d4a6e283aa2ad
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
2020-04-02 13:43:07 +00:00
Martin Trigaux ad54273e9c [FIX] mail: sanitize activity notes
The note content was not sanitized against HTML content.
This is not considered as a security issue as an activity can only be
created by trusted employees, however there is no reason not to
sanitize it.

Courtesy of Lauri Vakkala, silverskin

closes odoo/odoo#48889

X-original-commit: 970b460295c3d33dbb089ef6b7224b472e6b568d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-02 13:49:26 +00:00