Commit [1] introduced an automatic start of edit mode when
selecting a theme but didn't take into account wether the frontend lang
of the user was matching that of the website that is supposed to enter
in edit mode.
Steps to reproduce:
- Create an empty database and install website.
- Add an extra lang on website (e.g FR) and visit the website in that
lang.
- Go in settings an create a new website, skiper the configurator,
select a theme.
- Redirect is with enable_editor but nothing happens.
The editor isn't started if not in the source's lang.
This commit redirect the user to the default_lang of the website
so that editor can always be started. It also introduces a tour
to test out the flow.
[1]: https://github.com/odoo/odoo/commit/f474eac4543712ae5b1c7d614f9eff9367445107
task-2687416
closesodoo/odoo#85058
X-original-commit: 02e08af7278cd66d768fe6a4f23aa17eb816be3c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Before, there was a mismatch between the course's sales smart button
and the reporting it leads to. The amount shown is the total, taxed,
amount. Once in the reporting, the default measure is the subtotal,
untaxed.
This commit harmonizes both as well as course revenue reporting by
replacing the current default measure (price_subtotal) by the total
amount. This measure price_total is used in both graph and pivot views.
Task-2718756
closesodoo/odoo#83184
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
PURPOSE:
Before this commit when they were a lot of tags they were all
displayed inline being hidden by the card size. This commit
fix this bug and display them nicely row after row.
LINKS
Task-2737156
Pr: odoo/odoo#83082
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
PURPOSE
Before this commit the tags were ordered only by their own sequence
making the display quite random when several tags had the same
sequence but belonged to different categories.
After this commit the tags are ordered by their category sequence
followed by their own sequence.
LINKS
Task-2737156
Closes: odoo/odoo#83082
Purpose
=======
Ensure that the names of the UTMs models (campaign, medium and source)
are unique.
If not, generate automatically an unique name.
The name field is no more translatable; it makes no sense to translate
a technical which will be added in the URL, and can even cause issues
(the UTM record is not recognized because of the translation).
For the campaign, we keep a "translatable" name which is called
"title".
For the UTM source, use a mixin to generate automatically the name of
the source based on the content (_rec_name) of the record. So we remove
the override of create / write / copy in the different models and
ensure consistency between those models.
Task-2245823
closesodoo/odoo#60501
Related: odoo/enterprise#21882
Related: odoo/upgrade#1863
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This is a followup to odoo/odoo#3250 where a test for this case is
missing.
TaskId-2768450
closesodoo/odoo#85076
X-original-commit: 3d1f2f2d540a97506e0238f579199116aa8646dc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps :
Install project and sale_project
Log in as portal > Tasks
Search bar > Dropdown > Search in All
Type anything and search
Issue :
Access Error : You cannot read sale_order_id.name, sale_order_id.invoice_ids.name,
sale_line_id.name, message_ids.body fields in task.
Cause :
We search in every field including those portal doesn't have access to.
Fix :
Add the domain of the rule of task to the search domain, so the search
only occurs on allowed fields.
opw-2762212
closesodoo/odoo#84934
X-original-commit: 7c2855e17a85af6609a705abe50e69720f9bad75
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Issue :
In the kanban view related to shared project with portal user,
the term 'assignee' is not translated in the portal user language.
With this commit, this term will be translated based on the user language.
opw-2746504
closesodoo/odoo#85063
X-original-commit: 0231e1b78a3b377153c9d2e097b9d4aad9bc3b0d
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
- JS and DOM registrations are now shaped similarly,
so this help to handle them with the same piece of code
- the keydown event object is now manipulated only in a single function,
so it is clearer what it is used for and when it is eventually
stopped or default prevented.
- some constants were converted from Sets to Arrays because they had
no particular reason to be Sets.
closesodoo/odoo#84969
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit
The hotkey service was not taking into account that a new hotkey press
may have been triggered from an editable element.
This led to unwanted behavior, i.e. pressing ArrowLeft on an input
inside a sub Dropdown closed the sub Dropdown instead of navigating
through the text written in the input.
After this commit
The hotkey service now detects if the hotkey press was triggered from an
editable element (any input, textarea or other element with
[contenteditable=true] attribute) and does not dispatch this hotkey,
unless a candidate registered handler has explicitly asked to bypass the
editable protection. In that case, its callback will still get called.
task-2764821
Part-of: odoo/odoo#84969
Before this commit, the hotkey service will potentially
dispatch many time the same pressed hotkey.
After this commit, it will dispatch only to the newer
registrations or the first that match in the DOM.
task-2764821
Part-of: odoo/odoo#84969
ENCOUNTERED ISSUE:
Unable to close a dropdown with ESC when the focus has been given
to a select element inside the dropdown.
TO REPRODUCE:
i.e. in the searchpanel, go to "FilterMenu > Add Custom Filter" and
open the field select element.
Press ESC once: the field select element closes just fine.
Press ESC a 2nd time: we expect the dropdown to close but nothing occur.
REASON EXPLANATION:
Since 84715436d our Dropdown component uses the 'dropdown-menu'
bootstrap class.
But under some conditions bootstrap stops the keydown events propagation
when the event.target matches the query selector '.dropdown-menu'.
IMPLEMENTED FIX:
This commit refines this selector directly inside the bootstrap library.
This is admittedly a bad practice but:
- this modification is trivial and sensible
- the modified selector is only used locally
in the bootstrap's 'dropdown.js' file
- the added test should prevent the lost of
this customization in the future
task-2764821
Part-of: odoo/odoo#84969
Step to reproduce:
- Schedule activity on a project update
- Access the activity
Current Behaviour:
- On Project.update, we try to compute the info related to the project_update's project
due to the project update view showing information about the project.
In case of notification, we can show multiple project and thus no project_id can be
provided.
- Traceback
Behaviour after the PR:
- If there is no set project_id when opening the project update kanban view
We do not show the RightPanel related to the project and do not compute
related PR in enterprise odoo/enterprise#24427
opw-2755473
closesodoo/odoo#85060
X-original-commit: 9e30888195db0d01f06dffa9d59ae652fe6de5f0
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Purpose
=======
Loading a view trying to retrieve the hierarchy of a record using the field
parent_path could lead to an access error if records are mixed up.
Note:
Easily achievable for an end user. It could happen in a multi company
environment (you activate 2 companies at the same time) while configuring
the departments (using _parent_store=True), and you say that you have:
R&D (company=1):
- R&D Belgium (company=1)
- R&D India (company=2)
Then you go back to a single-company environment, you click on the form
view of an employee and crack, since there is a multi-company rule on the
departments, and that the search panel is loading the hierarchy for
display purpose.
Use sudo to avoid access rights issues, as the forbidden records will be
filtered automatically by the constructed domain like this:
```py
parent_ids = [
int(label)
for rec in left_model.sudo().browse(ids)
for label in rec.parent_path.split('/')[:-1]
]
domain = [('id', 'in', parent_ids)]
```
This actually makes the search consistent with the case where
_parent_store=False.
closesodoo/odoo#85042
X-original-commit: a7e13b32e6c47a3fdcfad8a6c6337b89580ad70a
Signed-off-by: Raphael Collet <rco@odoo.com>
This commit uses the `is_html_empty` util method to detect empty HTML
fields in cleaner and more resilient fashion than what was done in
808cc53bb02b0f1851a2a229bd5235a5fb944408.
closesodoo/odoo#84999
X-original-commit: 89f3aa8a979c5236b587f9690595117b52f0dd63
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Usecase to reproduce:
- Product A 0 unit in stock
- Product B 10 unit in stock
- Create planned delivery with product A and B
- Do a wave transfer and selected reserved `stock.move.line` from
product B
Current behavior:
The whole picking is move into the batch
Desired behavior:
The picking is splitted and only the move for product B is in a new
batch
It happens because the add_to_wave function check if all the picking
`stock.move.line` are in the `stock.move.line` to batch. If it's the
case, it moves the picking in the new batch. However in our case,
some `stock.move` are not reserve and should not be move in the new
batch. Also check if all the quantity is reserve on the `stock.move`
if it's not the case split the move to only put the reserve quantity
in the wave picking
closesodoo/odoo#85038
X-original-commit: afe2a3a7f913459d88ef197e63bc897fda5f90f8
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Usecase to reproduce:
- Create an immediate transfer and enable detailed opeations on the
picking type
- Create 2 `stock.move.line` with qty_done = 5
- Add the picking to a new wave and select only one of the sml
Traceback
It happens because the move split is base on the reserved quantity.
However in the case of an immediate transfer, the reserved quantity is
zero and the split fail
X-original-commit: 709372b0160a93cb9c30d391c4b3fc6c07ea2f9a
Part-of: odoo/odoo#85038
Usecase to reproduce:
Create a transfer with 3 moves for 3 products:
A - qty 60 (2 move lines, each move line has a quantity of 30)
B - qty 40 (2 move lines, each move line has a quantity of 20)
C - qty 40 (2 move lines, each move line has a quantity of 20)
Create a new wave picking containing the first move lines of each product (3 move lines)
Traceback
The error is due since it take all the `stock.move.line` from the
picking instead of the `stock.move` that is browsed
Fix#83450
X-original-commit: 788d08bb64204a0cb1c696f89228f6b4ae8d9620
Part-of: odoo/odoo#85038
Before this commit:
When switching to mobile view and refreshing the channel in discuss than back
arrow button is not working
After this commit:
Back arrow button will close the channel
Task-2685187
closesodoo/odoo#85034
X-original-commit: ebe56aac6d11e967d3b2fc8b57031e1b0e8ea726
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit there was no easy/clean way to extend the domain, searchbar sorting and filtering.
By adding it in subfunctions we can do clean extending of the domains/filters
closesodoo/odoo#84912
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Current behavior :
In a multi-company environnement if you generate a payment link and access it from incognito page the company was always the logo of the first company.
Steps to reproduce :
- Get in a multicompany environnement
- Create a invoice in company B
- Generate the payment link in the action menu
- Access the link in incognito mode
- The company logo is always the logo from company A
opw-2756438
closesodoo/odoo#85000
X-original-commit: 0e2e79d055e8565e2913b30477fcfdb71e99bdae
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Before this commit when a text color was applied on a text within
which an already colored text already existed, the inner coloring was
lost during preview. All text was therefore set to the initial coloring
of the external selected text.
After this commit the "reset" of the text color preview is done by
undoing the draft "in progress" history step that contains the preview
changes, but that is not stored within the history itself.
Steps to reproduce:
- drop the Text snippet
- select a word in the middle of a sentence (e.g. "personality")
- set text color to red
- select several words containing the colored one (e.g. "story with
personality for potential")
- open text color palette
- hover over colors but do not click
- leave color palette
=> colored word is not colored anymore
Steps to reproduce a secondary problem also fixed by this commit:
- drop the Text snippet
- select text surrounding some bold (e.g. "have a personality. Consider")
- open text color palette
- quickly hover through several colors (i.e. move pointer downwards)
=> text selection range changed between some of the color previews
task-2742112 (was task-2666200)
closesodoo/odoo#84998
X-original-commit: 9cb5a138244783580c2d1baa4dc01d1824ed20f4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When install the module on a db with huge amount of account move,
prefetching data when accessing partner_id of first move iteration is
costly and should be avoided.
closesodoo/odoo#84989
X-original-commit: c80700ee616e5588669879fd5e020ea868665a8f
Signed-off-by: William André (wan) <wan@odoo.com>
the search method of contract_renewal_due_soon and
contract_renewal_overdue return a domain
id in res_ids where res_ids are id of contract
not vehicle
So it return random result
Solution
--------
Get the vehicle_id from the contract record set
closesodoo/odoo#84987
X-original-commit: 975841953adaa6b7adc8016fb96cc6efc8891613
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The logic should not be made in the post init hook of account otherwise
modules will only get installed like expected during the database
initialization, based on the country set on the main company before the
installation of `account`.
closesodoo/odoo#84975
Related: odoo/enterprise#24576
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Purpose:
The "column choice" is a remainder of a previous implementation in which users
could decide how the survey would look like.
Since the re-design however, this option is no longer working as we prefer
handling this ourselves:
- To make the code simpler
- Because this is not really a "game-changer" feature
- Because we prefer to decide ourselves how the answers will look like to make
sure it always looks nice
As the field is not used anymore and some customers are wondering why it does
not work, we have decided to remove it.
Specifications:
Remove the field column_nb from the survey_question model
In the form, to make sure the "Answers" group is never empty,
we'll move the "Comments" options there instead
Task 2730409
closesodoo/odoo#83645
Related: odoo/upgrade#3231
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#84970
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
In 2e3075693b06d71222b446bd8a805dacb639d0e4 we used a head request to
determine type of page before trying to get a title out of it.
But requests.head does not allow redirect by default:
https://docs.python-requests.org/en/v2.9.1/user/quickstart/#redirection-and-history
so if an URL was a redirect, we would not longer get the page title.
opw-2457640
closesodoo/odoo#84832
X-original-commit: 63346cf4b77f760121f88762ab2911c37603b548
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Create a credit note for an amount between 0 and 1, confirm it.
In Accounting app, open Reporting -> Invoice Analysis
Switch to Pivot View
The credit note amount will be positive
This occur because in `insertThousandsSep` the number -0 is converted
to "0" (string), thus losing the sign before saving it
opw-2759964
closesodoo/odoo#84946
X-original-commit: c71d4c2349e623a4bcc49c2318fbbc9de08e0fa4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Steps to reproduce:
1. Go to Configuration > Website
2. Enable Automatic Invoice and Save
3. Remove the value from Invoice Email Template and Save
Result:
* The field shows as set by the default value.
* The ir.config_parameter doesn't exist.
Excepted:
* The field should be shown as unset.
closesodoo/odoo#84901
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Remove str from IdType, because those kinds of ids are no longer
necessary, and lead to unusable recordsets.
Because IdType now only contains int and NewId, simplify (and speed up)
the conversion of the parameter of browse().
Preferably wrap single NewId into a tuple instead of a list, as tuples
are faster.
closesodoo/odoo#83687
Signed-off-by: Raphael Collet <rco@odoo.com>
Simplify __bool__(), __repr__(), __hash__() by removing calls to
getattr/hasattr. We can expect a performance improvement of these
highly used method (for a single record):
- __bool__(): 145 -> 108 ns
- __hash__(): 330 -> 289 ns
Discard support for user id in sudo(), the method now only accepts a
bool.
Part-of: odoo/odoo#83687
The method filtered_domain() didn't conserve the order of `self`, which
may be confusing, and a subtle source of bugs. It now preserves the
order from `self`.
The processing of `child_of`/`parent_of` making a search with the
default order of the model, which may be slow.
Add documentation.
Part-of: odoo/odoo#83687