Commit Graph
134471 Commits
Author SHA1 Message Date
Lucas Lefèvre 900f0175db [FIX] project: Allow multi company ir rule relaxion
If you want to de-activate the multi company ir.rule, those checks will
still raise an error.

Task 2198433

closes odoo/odoo#47291

X-original-commit: 12a81a3a5265cbd18f5c00ab439cd1486696521b
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-10 13:44:20 +00:00
Pierre Paridans 65cded061f [REM] web: remove condition comments targeting old IE versions
As we don't support anymore Internet Explorer browser, we can safely
remove conditional comments targetting older versions of it (and even
not supported in IE since version 10).

Also, when executed, this could have added a second `<body>` tag (which
is not valid HTML document).

References:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
https://en.wikipedia.org/wiki/Conditional_comment

closes odoo/odoo#47170

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-03-09 10:07:51 +00:00
Pierre Paridans e0e950c450 [IMP] web: shorten odoo.reloadMenus implementation
This commit takes advantage of modern JS syntax (like Fetch API, arrow
functions) to shorten the `odoo.reloadMenus` function's implementation.

Original implementation of this function was in commit 8a28cc22fd
2020-03-09 10:07:51 +00:00
Odoo's Mergebot 397872a07f [MERGE] (website_)event(_*): move from onchange to editable stored fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: OTHER COMMITS

Perform some light code cleaning before updating fields.

Keep some explicit onchanges:
  * onchange partner on registration: required as UI flow is a bit different
    from automated code update;
  * onchange track boolean on event: allow to simplify fields dependencies;

Rename event type default_registration_max to seats_max to match
naming.

Improve event type data and demo

See sub commits for more details.

LINKS

Task ID 2089156
Community PR #42911
Upgrade PR odoo/upgrade#912

Related: odoo/upgrade#912
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-10 15:45:15 +01:00
Thibault Delavallée 45f32c5795 [REF] event: rename event type default_registration_max to seats_max
Purpose is to have matching names between event type and event to ease code
understanding.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
Upgrade PR odoo/upgrade#912
2020-03-10 11:15:10 +00:00
Thibault Delavallée c9746f11fa [IMP] event(_*): slightly improve event type and questions demo data
Notably clean a bit existing event type (data and demo) and add some questions
on conference event type.

LINKS

Task ID 2089156
Community PR #42911
2020-03-10 11:15:09 +00:00
Thibault Delavallée e7c4e94275 [FIX] website_event: copy website_menu when copying an event
Currently website_menu boolean field is not copied when copying an event. It
comes from an issue related to duplicating website menus. It seems real issue
has been fixed at 1a8993e0cb . Current copy=False on website_menu is a wrong fix
due to some mismatch in forward-port. We can therefore copy website_menu
again.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:09 +00:00
Thibault Delavallée 968ef0223f [REF] website_event(_track/_question) : move from onchange / default to stored editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: WEBSITE_TRACK(_PROPOSAL)

Keep an explicit onchange for tick / untick of website_track_proposal. Indeed
otherwise you have a loop of dependencies between website_track and
website_track_proposal

  * untick website_track: website_track_proposal = False (done in _compute_website_track_proposal)
  * tick website_track: no effect
  * untick website_track_proposal: no effect
  * tick website_track_proposa: website_track = True

It would be complicated to write in computed fields, as they depend on each
other, on cache and current values, ... It is therefore simpler to keep an
onchange: when ticking website_track_proposal set website_track as True in
interface.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:09 +00:00
Thibault Delavallée 7666f97693 [REF] event_sale: move from onchange / default to stored editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:09 +00:00
Thibault Delavallée c6003af734 [IMP] event: set an explicit onchange on partner_id of registration
RATIONALE

Manual onchange is necessary because you spot an issue (or customer complains).
Automatic update through computed feild is only there to try to add missing
pieces of information but cannot decide which is the correct field value to keep.

SPECIFICATIONS

Keep an explicit onchange on partner_id. Rationale : if user explicitly
changes the partner in interface, he wants to update the whole customer
information. If partner_id is updated in code (e.g. updating your personal
information after registeration in website_event_sale) fields with a value
should not be reset as we do not know which one is the correct one.

How it should behave as following

  * computed fields based on partner_id should only update missing
    information. Indeed automated code cannot decide which information
    is more accurate;
  * interface should allow to update all customer related information
    at once. We consider event users really want to update all fields

Tests are added to ensure behavior is not modified without notice.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:09 +00:00
Thibault DelavalléeandMichaël Mattiello 5e4efef3ca [REF] event : move from onchange / default to stored editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: REQUIRED FIELDS

As computed fields are computed after create required attribute cannot be
respected without computing them beforehand. That is why we have some custom
code to compute required fields if not given at create and update the creation
values accordingly.

SPECIFICATIONS: MAIL SCHEDULING

Mail scheduling on event type is modified in this commit. Previously checking
the use_mail_schedule radio button had no effect on event_type_mail_ids field.
It is now reset if unchecked. It is therefore coherent with use_ticket and
event_type_ticket_ids field behavior.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Michaël Mattiello <mcm@odoo.com>
2020-03-10 11:15:09 +00:00
Thibault Delavallée 2235176347 [MOV] website_event(_track): rename some odd methods and files, remove dead code
In order to keep things organized, let us move some models in their own file
and rename some test files. Some odd methods are relocated to better follow
guidelines. Dead code is removed because we do not like dead code.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:08 +00:00
Jinal Patel e7d8e26ae7 [IMP] sale: include empty orders in sales report
- Purpose is to include orders that have no lines
  in the sales report for consistency
- In report, 'Quotation' filter shows quotation which
  is in 'draft' or 'sent' stage.

task-2122948
Closes- #42662

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-02-12 13:26:27 +00:00
jvm-odoo bf1e8a89e7 [FIX] sale: fix SO no line break in note lines
Issue

	- Install Sale
	- Create SO
	- Add a note line with a very looong word
	- Print PDF

	No line break, table is expending out of
	the visible report.

Cause

	There is no line break CSS rule

Solution

	Use word-break: break-word; in order to
	break line without cutting words.

OPW-2195984

closes odoo/odoo#47272

X-original-commit: af8fb786a9569562cefb7d8ea63454cddc04cd44
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-10 10:59:05 +00:00
Cocographique 81c283ee2a [FIX] website_sale: make search bar suggestions visible
Since 13.2, the cards cannot contain an overflowing element anymore as
we needed to enforce 'overflow: hidden' for the border-radius option.

Note: this commit adds data-vxml="001" on the snippet. This will allow
users which have already added the card version of the snippet in their
website to receive a notification that the snippet is deprecated once we
will have implemented that system (in progress).

task-2208802

closes odoo/odoo#47228

X-original-commit: 220ec38e7538389279eb2dce9c897052d680ea1a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-09 17:19:08 +00:00
fja-odoo 7e9482978a [IMP] website: add countdown urlpicker placeholder
No default url on countdown's urlpicker anymore. Only a placeholder.
Also redirect to homepage if no url.

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

task-2210358

closes odoo/odoo#47235

X-original-commit: a0d983e94e3681a3f3e55cc445defc1ec862c606
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-09 18:20:29 +00:00
fja-odoo 52ac740a09 [IMP] website: improve we-urlpicker behaviour
The urlpicker was not closing properly when a value was selected.

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

task-2210358

X-original-commit: 6f722d919cd650d5c0b1b9c4a878fd519267c348
2020-03-09 18:20:28 +00:00
sbejaoui 2b5ef9f63f [CLA] add signature for sbejaoui
Done at odoo/odoo#46379

closes odoo/odoo#47262

X-original-commit: 0741c8c13fa5e47e59d03cdaa77f166b03be7b7b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-03-10 09:55:06 +00:00
Nicolas Martinelli 5f5a0c58a1 [FIX] sale_quotation_builder: multi-company
- Create 2 companies A & B
- Set the website in A
- Set the user in both companies, main company being A
- Create a SO template in company B
- Click on "Design Template"

An AccessError is raised because:
- `slug` accesses the `display_name` of the template which is in company
  B
- the `allowed_company_ids` is set to company A in [1]

A solution could be to always set:
```
context['allowed_company_ids'] = request.env.user.company_ids.ids
```

But the side-effects could cause other issues.

Therefore, we handle the `slug` manually.

[1] https://github.com/odoo/odoo/blob/af411b866aa2052c01168342f8f05ae3dabad83e/addons/website/models/ir_http.py#L203

opw-2194103

closes odoo/odoo#47249

X-original-commit: 0bcfffd291aceb74a5260a49d2fa3032f511dba1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-10 08:53:10 +00:00
Jinal Patel a4149d923b [FIX] sale: display Payment Terms on online SO
Purpose
=======

We don't have the description of the payment terms in the online SO
even if we get it on the report.

Specification
=============

Fix the bad usages of t-field on the website quote.

task-2186685
Closes- #46815

closes odoo/odoo#47116

X-original-commit: 0f622ae61dcbb454b5d7a4124dfcc5187085a64d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-06 16:09:06 +00:00
Swapnesh Shah 641bd9d8ef [FIX] hr_org_chart: Typo in field's label
closes odoo/odoo#47115

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-06 16:07:21 +00:00
Hemali Bhimani 80ede1d0c0 [IMP] product: min quantity int -> float
purpose of this commit is to change the field type
of min_quantity from int to float on product pricelist
object

task:2165208

closes odoo/odoo#45792

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-09 06:46:25 +00:00
Sébastien Theys 5b87b5879c [FIX] mail: prevent hidden chat window close from opening home menu
opw-2210274

closes odoo/odoo#47245

X-original-commit: ca695425a2b06ffba15d7063fb0b8ea994f751d6
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-03-10 08:33:02 +00:00
shreya thakrar b3ece2074a [FIX] web: properly set page data in 'ModelFieldSelector' widget
When passing a default field chain to ModelFieldSelector, the page data is
not set correctly for the relational field. To understand the issue :

- login to v11 enterprise all db branch in runbot (debug mode recommended)
- create a mass mailing, add subject, select 'Contact' in `Recipients` field
- click on domain selector and select 'Company' from ModelFieldSelector popover
- click somewhere else to close the popover
- again open domain selector and observe the popover

Current behavior : fields of  `Contact` are visible in the page even thogh
                   `Company` is selected in the ModelFieldSelector
Expected behavior : fields of `Company` should be visible

This commit fixes the issue by correctly pushing the page data
in ModelFieldSelector.

task - 2058702

closes odoo/odoo#47231

X-original-commit: 5746c2705c324b124445f38ead4f75624b3f99e3
Related: odoo/enterprise#9124
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-03-09 16:46:20 +00:00
Goffin Simon 9ab34d8771 [FIX] website_sale_comparison: Compare button is not removed from webshop
Steps to reproducethe bug:

- On an existing product P, add alternative products under the eCommerce tab
- Go to the website
- Check that the compare button is enabled on the main shop page
- Turn off comparison button in the  list under customize menu

Bug:

The compare button is still available on the alternative products of P.

opw:2201874

closes odoo/odoo#47230

X-original-commit: 9bf0d15ff4e1fcb9d7003d06f7e904cc9421b13b
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-03-09 16:31:02 +00:00
Goffin Simon a9cb1b9b43 [FIX] account: Invoice reference not present in invoice list
Before 13.0, the "Payment reference" column was linked to the 'ref' field.
In 13.0 it is linked to "invoice_payment_ref".
So the field reference was not visible in the list view

opw:2201763

closes odoo/odoo#47195

X-original-commit: 6acba443bd4e81c07eb5f4f48e1b4e554b4c5d13
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-03-09 13:49:06 +00:00
Wolfgang Taferner 04200ad77a [FIX] stock: do not prefetch fields before unlink
closes odoo/odoo#47218

X-original-commit: b0c18a3a932d82221bbf2891ef86d97c42db37cb
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-09 15:16:28 +00:00
Ravi Gohil e34735f709 [FIX] l10n_ar: fix invalid demo invoice number
closes odoo/odoo#47223

Task: 2210808
X-original-commit: 85116b9e899caff0bf0692097656740909e45b74
Related: odoo/enterprise#9122
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-03-09 15:50:39 +00:00
Ravi Gohil 126d6f5694 [FIX] l10n_fr_fec: added missing model access
Let FEC report be generated by users having access to
full accounting feature or who are Accountants.

Task: 2210808
X-original-commit: 89fd50e47dcd4c6fda9342fce872283c18dc39b1
2020-03-09 15:50:39 +00:00
Aaron Bohy 43ce727568 [FIX] web: save all values returned by onchange
Let's assume a form view with a boolean field and a one2many field,
displayed for instance with widget many2many_tags. There is an
onchange on the boolean field, which populates the one2many, e.g.
  [[5], [0, 0, {display_name: 'name', other_field: 'value'}]]

Before this commit, only the display_name was sent to the server on
save, because 'other_field' is unknown by the webclient.

Similar situations occurred with one2manys displayed as lists, and
onchanges returning values for fields that aren't in the list.

These situations probably didn't exist in Odoo yet, but a pending
task on website event adds one.

This commit ensures that all values returned by the onchange for
the x2many subrecords are sent back to the server when the user
saves.

closes odoo/odoo#46807

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-03-09 14:14:39 +00:00
Aaron Bohy f894b6a1d8 [FIX] web: x2many: use correct viewType
This commit fixes two issues that occurred in the following
situation: in a form view, have a one2many field F1 displayed as a
list, that contains another one2many field F2, displayed with
widget many2many_tags (in the list), and with a list in the form
(in the dialog). In the dialog, the list of F2 displays a
field, say 'name', which has an onchange that sets 'display_name'.
Moreover, there is an onchange in the (main) form view, that
populates F1 and F2, for instance, it returns something like: {
  F1: [[5], [0, 0, {
       F2: [[5], [0, 0, {
            display_name: 'xxx',
	    name: 'xxx',
       }]]
  }]]
}

1) If the user opens a related record in F1, and adds (in the
dialog) a related record in F2, then validates the dialog, the
newly created record in F2 isn't correctly displayed in the
many2many_tags (the display_name is `false`), i.e. the onchange
hasn't been applied.

2) If field 'name' in F2 in the list is required, the new record
can't be saved, even if the user enters a correct value.

In both cases, the reason is that we use the incorrect viewType in
datapoints: as we don't specify that we specifically want 'list',
the 'default' one is taken, and we thus use the fieldsInfo of the
many2many_tags, which only knows field 'display_name'. As a
consequence, onchanges aren't correctly applied (issue 1), and
fields aren't correctly reset (issue 2).

Issue reported on task 2189529
2020-03-09 14:14:39 +00:00
Aaron Bohy 8a52f10ceb [FIX] web: BasicModel: always set a valid limit
When x2many fields are displayed with widgets like many2many_tags,
there is no limit on the number of related records to fetch and
display. In this case, the 'limit' attribute on the datapoints is
undefined. This could lead to weird issues when the limit is used
in computation, e.g.
  var index = list.offset + list.limit; // = NaN

There are several occurrences of the above examples in the code,
which can be observed in specific scenarios, e.g. the one encoded
in the test. In this scenario, when the bug occurs, new records
added to editable list views are inserted on top (even if the list
is editable="bottom"), but the edited row is the last one.

Issue reported on task 2189529
2020-03-09 14:14:39 +00:00
Aaron Bohy a9cebd5acb [FIX] web: handle nested one2manys and onchange
Let's assume the following scenario in a form view:
 - have a one2many field, say fieldA, displayed as a list,
   containing another one2many, fieldB, (no widget, thus
   displaying 'n record(s)')
 - the one2many list is not editable, so there is a sub form view,
   displaying fieldB as a list, and in this list some random field,
   say fieldC, is displayed
 - have a random field on the main form view, with an onchange to
   populate the one2many
 - set that random field s.t. the onchange returns something like
   fieldA: [[5], [0, 0, {fieldB: [[0, 0, {fieldC: 'value'}]]}]]
 - there is now a record in fieldA's list, displaying '1 record'
   as value for fieldB
 - click on that record to open it in a form view (dialog)
 - in the dialog, in fieldB's list, we expect to have a single row
   displaying 'value' as value for fieldC

Before this rev., it crashed when opening the record in the dialog,
whether the form view was inline or not.

The crash occured because fieldB was already in the list view, so
datapoints already existed for it (a list datapoint, and record
datapoints for records in the relation, in our example one record
datapoint). However, those datapoints didn't have the fieldsInfo of
the form view. When opening the form view, we added the fieldsInfo
of the form to the datapoint of the record we opened, but we didn't
recursively apply the fieldsInfo to its children. As a consequence,
when rendering the list view for fieldB in the dialog, we haven't
the information about fieldC, and it crashed.

Note that if fieldB wasn't present in fieldA's list view, it worked
fine because datapoints didn't exist before we opened the record in
the dialog.

Task 2120235
2020-03-09 14:14:39 +00:00
Victor Feyens f129dff5a0 [IMP] sale_coupon: no need of sale_management module for sale_coupon
When installing website_sale_coupon, you are forced to install sale_management,
it shouldn't be the case.

Task Id : 2192587

closes odoo/odoo#46416

Related: odoo/upgrade#861
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-03-09 14:33:25 +00:00
Thanh Dodeur 32c0352076 [IMP] website_sale: move the product input options
This commit moves the product search input snippet options from a modal
to the option side panel.

Part of #45176
task-2189645

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-09 15:14:09 +00:00
Thanh Dodeur 56180e1309 [REF] website_sale: move the product input files
This commit changes the file structure of the product input snippet.
Related to #42067

Part of #45176
task-2189645
2020-03-09 15:13:43 +00:00
Odoo's Mergebot a4e1b7c44e [MERGE] mail, test_mail: remove aggregation from message_format
Remove aggregation from `message_format `and `_message_read_dict_postprocess`.
There should be no functional change in this PR.

Purpose
=======

The existing code working with "tree" for aggregation and doing explicit "read"
or "search" for related fields does not seem necessary since the ORM of v13.

Considering that it adds complexity to the method, if its original purpose is
not necessary anymore, it would be better to change it.

The notable changes of the ORM that would justify this task are:
 - single cache, shared between current user and sudo (which is called a lot in
   those methods and might explain why the "tree" mechanism was put in place
   originally)
 - m2o and o2m being kept consistent with each other, which allows accessing o2m
   through fields directly (instead of having to use "search" to ensure getting
   consistent data)

Explanation
===========

Doing "read" or "search" could be counter-productive if the data are already in
cache because using those methods will lead to a query no matter what.
The ideal way is to simply access the fields through the records.

As for the "tree" and aggregation in general, the prefetch is automatically
taking care of that when iterating.

task-2180311

closes odoo/odoo#43841

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-03-09 16:04:48 +01:00
Hiral Bhavsar 0712c5222c [FIX] mail: allow to switch on form view
Currently, when clicking on the systray activity action icon and click on any
record from the activity, kanban or list view, not redirecting to its form view.

This commit adds the form view for that action and now click on record will
redirect to its form view.

task-2198480
Closes https://github.com/odoo/odoo/pull/46877

closes odoo/odoo#47208

X-original-commit: 3fd30316c0af9a6ca2ea4962f2e2f832e68dee54
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-03-09 14:03:25 +00:00
Nicolas Martinelli 835974c35c [FIX] website_sale_product_configurator: prevent context loss
Prevent unexpected loss of context.

closes odoo/odoo#47194

X-original-commit: d6299de8c83d56fc5e05ba0efd8558c4e5b21572
Related: odoo/enterprise#9111
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-09 11:53:29 +00:00
Nicolas Martinelli 6b666b8840 [FIX] account: error on tax rounding
- Active 'Round Globally'
- Create the tax:
  Amount: 21 %
  Tax Included
- Create the following invoice:
  Line 1: qty 1.0, price 11.90
  Line 2: qty 1.0, price 2.80

The Taxes amount should be 2.56 since we apply a 'Round per line' logic
in case of included taxes.

opw-2181486

closes odoo/odoo#47175

X-original-commit: a55bc67f0797f412c3bd82074c3f8f5d1497bce2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-09 09:50:30 +00:00
Aurélien Warnon 825d687cca [FIX] survey: remove undefined variable in survey form validation
This commit removes an unused and undefined variable that raised an error when
the user tries to answer a mandatory char_box question.

Oversight of commit: 0675d68afb

Task 2212021

closes odoo/odoo#47174

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-09 09:41:13 +00:00
Debauche Stéphane db2ec4888c [FIX] web: fix edition of a reference field
How to reproduce
================
You must have
- a form view with a one2many list
- in this one2many list add a column of a reference field

How to reproduce
1. open the record associated to the reference field
2. edit this record in the form modal view
3. click on save
-> Traceback

Bug
===
In `basic_model` the attribute `localData` become inconsistent
because of the method `_fetchReferenceData`.

We want to store the ID of the parent and not the all dict.

closes odoo/odoo#47171

X-original-commit: af411b866aa2052c01168342f8f05ae3dabad83e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-09 09:41:27 +00:00
Sébastien Theys e3afe4d067 [IMP] models, (test_)mail, portal(_rating): remove message_tree
from `message_format` and from `_message_read_dict_postprocess`.

The reading and initial formatting is done by `_message_read_dict_postprocess`,
which has been renamed more simply to `_message_format` due to its new goal.

This makes the methods easier to follow and does not increase the query count.

It actually reduces it when the data were already in the cache, by not always
reading them again.

Part of task-2180311
PR: #43841
2020-03-06 16:15:44 +00:00
Sébastien Theys 2490676e16 [IMP] mail, test_mail: simplify subtype in message_format
This makes the method easier to follow and does not increase the query count.

It actually reduces it when the subtype data were already in the cache, by
not always reading them again.

Part of task-2180311
PR: #43841
2020-03-06 16:15:44 +00:00
Sébastien Theys 04fda71e42 [IMP] mail, test_mail: simplify notification and tracking values
in `message_format` and in `_message_read_dict_postprocess`.

This makes the method easier to follow and does not increase the query count.

It actually reduces it when the notifications and tracking data were already in
the cache, by not always reading them again.

Part of task-2180311
PR: #43841
2020-03-06 16:15:43 +00:00
Sébastien Theys dca44f53a2 [IMP] mail: simplify partner in _message_read_dict_postprocess
This makes the method easier to follow and does not increase the query count.

Part of task-2180311
PR: #43841
2020-03-06 16:15:43 +00:00
Sébastien Theys ad5454f0ef [IMP] mail, test_mail: simplify attachment
in `_message_read_dict_postprocess`.

This makes the method easier to follow and does not increase the query count.

It actually reduces it when the attachment data were already in the cache, by
not always reading them again.

The `has_access_to_model` is removed and replaced by `sudo` because:
- from portal everything is sudo so it's pointless to check access on top of it
- from backend, it's almost impossible to trigger the case, and it's not like
  returning is_main True would leak any sensitive information to an employee

Part of task-2180311
PR: #43841
2020-03-06 16:15:43 +00:00
Sébastien Theys b9e1f0d700 [IMP] test_mail: introduce performance test for message_format
It was partially tested already as part of some other performance tests, but
this new test will cover more specific cases of `message_format` and
`_message_read_dict_postprocess`.

The goal is to ensure the performances are not made worse by the following
commits, or even to be able to notice when they are made better.

Part of task-2180311
PR: #43841
2020-03-06 16:15:42 +00:00
Sébastien Theys 70eeb2ece9 [IMP] test_mail: adapt query count
Part of task-2180311
PR: #43841
2020-03-06 16:15:42 +00:00
Sébastien Theys 60dc58cdf4 [IMP] test_mail: clean test log with appropriate mute logger
Similar to what is done for the other tests, mute unnecessary log such as
`odoo.tests: skip sending email in test mode`.

Part of task-2180311
PR: #43841
2020-03-06 16:15:41 +00:00