Create a 15.0 database with website, access the home page via your
browser. Stop the server and migrate the database to 16.0. Restart the
server with a `--dbfilter` that rejects the database you created and
refresh your browser. 500 Internal server error, attribute error:
the `request` object as no `session`.
An error could occurs after a migration to 16.0 due to the presence of
the `geoip` key in the session. `request.session.geoip` has been made a
deprecated alias to `request.geoip` between 15.0 and 16.0, see 04e9726.
Because the session was created before 16.0, the session dict does
contain a `geoip` key. Upon logging the session out, the session dict
is cleared. The default implementation of `clear()`[^1] inside of
`collections.abc.MutableMapping` can be summarized for our usecase to:
for key in self:
value = self[key]
del self[key]
There is an extra `__getitem__` call due to `value = self[key]`, in the
case of the `geoip` key, it would access the alias. It is not possible
to accessing that alias inside of the `_get_dbname_and_session` method
of request as the session has not been set on `self` (the request) yet.
Yet inside of that method, we do `session.logout()` which `clear()` the
session which (wrongly) access the alias because `geoip` exists in the
internal dict (`'geoip' in self.keys() # True`).
The solution has been to implement the `clear()` function ourself
instead of using the mixin of `MutableMapping`.
[^1]: https://github.com/python/cpython/blob/b43496c01a554cf41ae654a0379efae18609ad39/Lib/_collections_abc.py#L925-L931closesodoo/odoo#105763
X-original-commit: b66e1ffa8e348eedf2de735babbc398290a8bffb
Signed-off-by: Julien Castiaux <juc@odoo.com>
Since this commit [1], the header language switcher has been moved out
of the header navbar. This created a bug, when the off-canvas option of
the navbar is activated, the language switcher is no longer accessible
on mobile.
As this commit is in stable version, the fix is only in Javascript. It
puts the language switcher back in the navbar when the off-canvas menu
is opened.
A specific case with the "hamburger full" header template, where there
is the same bug with the "call to action" button, is also fixed by this
commit.
This commit also fixes display issues in the off-canvas menu.
[1]: https://github.com/odoo/odoo/commit/2a000e33c5a44ddf0a777b43d8266cc413d8e4e2
opw-2964824
closesodoo/odoo#105504
X-original-commit: b89dbb2e18c4ccebcd72e87758b5d3363ed875b3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
QWeb views allowed to render QWeb templates rendered by the server in
a view.
Today, QWeb views are only used in website to see the hierarchy of
their views. The use case of website has now more sense in a client
action rather than an extension of a QWeb view.
This commit removes this view because it is not used anymore and will
probably not find any useful use case in the future.
closesodoo/odoo#103477
Related: odoo/upgrade#4016
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, `view_hierarchy` extended the QWeb view to see
the hierarchy of views.
With the evolution of the javascript framework, this use case has
now more sense in a client action rather than an extension of a
QWeb view.
This commit refactors `view_hierarchy` into a client action.
Part-of: odoo/odoo#103477
before this commit:
If a translation is used for web client, the translation has comment
'openerp-web'.
after this commit:
If a translation is used for web client, the translation has comment
'odoo-javascript'
If a translation is used for python, the translation has comment
'odoo-python'
PO/POT files with old comments still works. The only overhead is: translation
only for web client will also be stored as code translation for python.
closesodoo/odoo#105764
X-original-commit: 13a5fa56ac7a102ad38f7ecc11874786bdb2fe85
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
before the commit: web client code translations cannot be exported in the po.
If a web client only translation (not used for python translation and has
comment openerp-web) has its translation in the po file of /i18n, when it is
exported in a po file from Settings -> Translations -> Export Translation,
its corresponding translation is missing.
after this commit: web client code translations can be exported in the po.
X-original-commit: c2bf7665363b988d7c7e8bff43e71b7b1097ad84
Part-of: odoo/odoo#105764
Add the hr_contract.group_hr_contract_employee_manager group on the contract_id field in hr_employee
to avoid having an access error once a user with Manager security group in Payroll tries to open the
Payroll app.
task-3053032
closesodoo/odoo#105753
X-original-commit: fa1b4f14257ca04c85c7541fd94b19dff939626c
Related: odoo/enterprise#33942
Signed-off-by: Kevin Baptiste <kba@odoo.com>
### Steps to reproduce
* install Live Chat (`im_livechat`)
* Go to Live Chat > click any channel
* Under Widget, Click the copy button for the first link
If you're on firefox, nothing will happen (text won't be copied).
On chrome, you will get a traceback saying `Failed to execute 'write' on
'Clipboard'`.
### Expected behavior
The text should be copied to the clipboard, and a tooltip should appear
to confirm that.
opw-3058357
closesodoo/odoo#105756
X-original-commit: 977f5aacf46c3746380dda33585b407df659e07d
Signed-off-by: Luca Vitali <luvi@odoo.com>
### Steps to reproduce
* install `website_sale` (eCommerce)
* go to any product's form view
* in the 'Sales' tab, click `ADD A MEDIA`
* fill the 'Video URL' field and save
You should be met with a traceback saying that the template
`website_sale.FieldVideoPreview` is missing.
opw-3057118
closesodoo/odoo#105755
X-original-commit: 9cbb0ab0bafa4e05673862d601a7b089bbd2b519
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Add a placeholder to beautify the UX of mail preview wizard. Field is currently
a bit hard to sport with the new UI.
closesodoo/odoo#105751
X-original-commit: fd5a5bc38bad09e3e8e99ff22e64a5dda60e32aa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The purpose of this commit is to add extension points that allow code
to be executed before and after the save of a record.
CallBack:
onWillSaveRecord is a callBack that will be executed before the
record save if the record is valid if the record is valid.
If it returns false, it will prevent the save.
onRecordSaved is a callBack that will be executed after the save
if it was done. It will therefore not be executed if the record
is invalid or if a server error is thrown.
This commit will replace all the save overrides by the onWillSaveRecord
and onRecordSaved callBack.
Observed problem:
We could notice that each of the overrides of save in order to execute
for example a doAction after this one did not take into account the fact
that the save did not succeed.
For example, a required field is invalid and we try to save, then the
doAction will be executed without the "write" of the save.
The callBack onRecordSaved will prevent this common error.
closesodoo/odoo#105180
Related: odoo/enterprise#33710
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
`DOM.querySelector` will generally return a `nodeId` of 0 when no node
is found, however there is a small window during which the document
can apparently get collected (?), which leads to an error
Could not find node with given id
which can break otherwise successful builds (cf 20832402 / staging
60731).
Handle errors from the pipeline as if the node had not been found,
though the matter was not fully investigated so it's possible this
explanation is incomplete or incorrect.
The CDTP documentation does not document the failure modes for either
`DOM.getDocument` or `DOM.querySelector`.
closesodoo/odoo#105734
X-original-commit: 5ef975f75cf8044e7dcd67f403ca11058630c85a
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Task Description :
When right-clicking on a cell in a pivot with no matching records
and a positional argument, we get the following exception :
TypeError: Cannot convert a Symbol value to a string
This is coming from the fact we try the get the nth records
associated to the positional argument, but in a case where
there is no associated records.
Reproducibility:
This issue can be reproduced with the following steps :
1. Open a pivot
2. Change some cell to add a positional argument
3. Set a filter so that no related records can be found
4. Right-click on the previously changed cell
Related Task:
task-3009982
closesodoo/odoo#105733
X-original-commit: 4595bed9493b0b4b9a3c5f5ff14a71a9cd59ad95
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Since the provider only accepts A4 letters, prevent the user from using
non A4 formats by giving them an error when clicking the Send button.
closesodoo/odoo#105725
X-original-commit: 452882f4534cb55546bcf19e93390067e1337f6f
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
Since the revamp of the pivot datasource (Odoo task 2779455),
The data stored in the pivot table did not match the format of the
pivots formula arguments. I.E.
A formula mays contain arguments under stringified version or not
```
=PIVOT("1","field","false", "m2m_id", "42")
```
or
```
=PIVOT(1, "field", "false", "m2m_id", 42)
```
but they are stored in their non-stringified version in the table.
Going from stringified to the original value is not possible, we
therefore now store the stringified values in pivotTable and
stringify the formula arguments when required.
Task 2946479
closesodoo/odoo#105732
X-original-commit: ad0b24cb7b80c22c57091254d4161326fbc07adf
Related: odoo/enterprise#33934
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Due to owl conversions the namings of few buttons changed,
thus event_tour and website_event_tour were broken. Commit fixes this issue.
At the same time, test didn't understand the change with datepicker in input
field. Now test moves to next stage whenever the date input field is clicked,
and I added "apply change" step to event_tour to make sure that user saves
their changes.
Task-3060511
closesodoo/odoo#105724
X-original-commit: 10a2cf33c00915a26a473411793e9d20af86a2ac
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Start odoo on a specific database, e.g. 'db-example'. Drop it via JSON
or XML RPC. The database is successfully dropped but the RPC fails with
a traceback because it attempts to commit on a database that doesn't
exist anymore.
import requests
admin_passwd = ...
requests.post(
'http://127.0.0.1:8069/jsonrpc',
json={'params': {
'service': 'db',
'method': 'drop',
'args': [
admin_passwd, 'db-example'
]
}}
)
Closes odoo#104527
closesodoo/odoo#105710
X-original-commit: b6e195ccb3a6c37b0d980af159e546bdc67b1e42
Signed-off-by: Julien Castiaux <juc@odoo.com>
The new `borrow_request()` function has been introduced to properly
separate the HTTP layer from the RPC layer. We forgot to protect some
RPC endpoints, mainly inside of `odoo.addons.web.controllers.database`.
This commit moves `odoo.service.dispatch_rpc` to `odoo.http` as we only
permorm RPC from the controllers and that we don't want to import
`borrow_request` inside of `odoo.service` (circular import).
X-original-commit: d0ee8615d8820e02232989c50a6e6ffbc66a9266
Part-of: odoo/odoo#105710
Reproduction steps:
- Install project module
- Create project and task
- Share the project
- Open the portal
- Open the project sharing list view
- Create a new task
Before this fix:
traceback occurs when we create task from project sharing.
Why traceback occurs:
In `portal_chatter_init` route both res_id and res_model are mandatory.res_id
is undefined during a task created from project sharing.
task-3012469
closesodoo/odoo#105392
X-original-commit: 2c2b7d94bbbe6f785c68bb6a479bc1aa4eceb668
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, the allocated hours of a project are set when
the linked sale order are confirmed. And then, the project manager
can change the allocated hours. However, if the sale manager
changes a qty in the sale order, then the allocated hours of
the project are recomputed according to the changes made in the
sale order and so the allocated hours set by the project manager
are erased.
This commit removes the compute of allocated hours and so only
the default value computed when the linked sale order is
confirmed are set to the allocated hours field of the project.
task-2955983
closesodoo/odoo#105727
X-original-commit: 318c07ec1e12940434d83b84d58603b1e69f9b14
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, when the user uses the `Late Milestones`
filter in the project views, all the projects in the views
are used, but some projects could have the feature disabled
and so those ones should be ignored in the filtered.
This commit filters the projects to only apply the filter
on those projects and not also the ones without the feature
enabled.
task-3033041
closesodoo/odoo#105709
X-original-commit: e8ee1e370ec3c6b4bc13d0d5da6b242af1e9b9c3
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, when the Milestones feature is globally enabled
in the project app, the "Milestones" action button displayed in the
dropdown of the kanban card are always visible even if the project
has the feature disabled in its settings.
This commit changes the visibility of that action button to also
take into account the settings of each project.
task-3033041
X-original-commit: 05485bbd192c2316267d38934544d7f08ff4e9e8
Part-of: odoo/odoo#105709
The code does not actually depend on mail features and it is intended to be used
in the base form view of user.
closesodoo/odoo#105415
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit introduces the following improvements:
- In `My Tasks` list view: the personal stage is displayed instead of the stage for private tasks
- When copying a stage, the new stage name is appended with `(copy)`
- A default filter 'open task' is added in the subtask notebook search
- A default filter on the project is set on the search of the `parent_id` task field
task-3024152
closesodoo/odoo#103318
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Add a setUpClass with a dummy payment provider to ensure that at
least one is always available when the tour is running, and set
the company country_id to None before starting the tour to avoid
any country dependant fields to block the tour during the checkout
process.
closesodoo/odoo#105700
X-original-commit: 779965fbf0471f2b003692f1afa541864a396651
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Define a route that is website but not multilang, e.g.
@route('/example', website=True, multilang=False)
Login to the frontend, change the website lang to another (non-default)
lang (e.g. install french, keep english as default lang, log in the
french website) then access the '/example' controller by typing it
directly in your address bar.
You are being redirected to '/fr/example', you should not.
This commit restore the behavior pre-httpocalypse, that is the address
is kept as-is.
Note: in the comment, the 4th and 5th cases were inverted, we use this
commit as an opportunity to reorder the two.
closesodoo/odoo#105686
X-original-commit: be7a02917a66136a8d3b601d61a898b0419ff79d
Signed-off-by: Julien Castiaux <juc@odoo.com>
* Fix wrong translations for taxes, accounts and tax groups.
* Remove auto_apply for fiscal position israel, because partner from israel can also lead to other fiscal positions (self invoice, eilat,etc).
* Remove the duplicate account Income tax withheld - customers
closesodoo/odoo#105676
X-original-commit: 2e21514eeaabd00aadd80355ccc327667a2c4d14
Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit changes the json widget to no longer edit the `props` of the
component as it might cause reactivity issues.
closesodoo/odoo#105663
X-original-commit: eb4ae1d79c455b1b9e163beebb98fb1935834194
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
\- Add 'Move to next stage'
Generic, we think it is a useful tool to have anywhere.
\- Change the 'Set priority...' command
to 'Set priority as Low/High' :
Only 1 command will be available with the 'not current' priority.
Specific, because it is used on selection fields,
which means there could be more than 2 options.
\- Transform the 'Set kanban state...' command into three commands
Generic. 2 commands will be available.
One for each 'not current' kanban state.
task-2857447
closesodoo/odoo#91821
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit adds the isAvailable option to the command. If you set this
option, then it determines if the command should be displayed or not
in the command palette.
Why add this option?
We want to allow a component to define a command that will be displayed
according to the internal state of the component
Part-of: odoo/odoo#91821
The goal of this commit is to fix indeterministic crashes
in Many2ManyTagsField test suite.
We could see that the wrong helper was used in some tests. We used
selectDropdownItem after an editInput on this same field.
Cause of the error:
editInput => event input debounce which causes the autocomplete to open.
selectDropdownItem => event click which causes the autocomplete to open.
After this event, a second click takes place to
select the dropdown item (call to clickOpenedDropdownItem).
The setTimeout is not patched, it is possible that the input event takes
place after the click which does not cause any crash. But if the click
event happens after the input then the autocomplete is closed before
the dropdown item is selected.
To solve this, we will patch the setTimeout and we will use only
clickOpenedDropdownItem to select the dropdownItem.
We also patched the setTimout in all tests to avoid indeterminate
behavior related to the debounce in the autocomplete input.
closesodoo/odoo#105693
X-original-commit: 36f6e6801166865e0c8047c1c2be43ef8826581f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the modified test sometimes failed on runbot.
We need to wait for an extra tick, because the dialog might be
rendered in another animation frame that the crashing client
action.
X-original-commit: fb73b9f08fbb315544b3a4fce727a4bf2fbaa1bc
Part-of: odoo/odoo#105693
crm_lead.py file does not exist, but models directory is not imported. We
can safely remove the init and the models directory.
Oversight of odoo/odoo@5d4208d44dclosesodoo/odoo#105690
X-original-commit: cf857b86b2073d1e83a5e3e5b009d67058116b69
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
**Issue:**
When moving a record in a kanban view from one column to another,
it is possible to keep holding the record, hover it in one column
for a moment, then move again to another column then eventually
drop the record. Doing this where a folded column is the intermediate
column results to visual issue, such that the darker highlight of
a folded column is lost.
The desired behavior is to keep the background color of a folded
column.
**Solution:**
When moving a record, the hovered column is highlighted, and right
after leaving the column, we remove the highlight. And we are doing
this without exempting the folded column, thus, its darker highlight
is lost during the record-moving-hovering process.
Instead of adding/removing .bg-100 during unhover/hover on each
kanban column to make sure of the "greenish" tint of the column when
hovered, we just make background of the .o_kanban_hover to be important.
closesodoo/odoo#105689
X-original-commit: fdd7f017c73718c9582256dde3124dd2655aeb01
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Before this commit, when using the `many2one_avatar_user` on the `user_id`
field of the crm tree views, an error was thrown because the domain of `user_id`
refers to `user_company_ids` which the view did not have access to, so it
wasn't yet computed.
The field was added in invisible to the tree views so that it can be computed
before being accessed.
Task-3053146
closesodoo/odoo#105688
X-original-commit: 558607d98798d6a55adbcd98a6648a888286c3c9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The goal of this commit is to avoid the execution of code depending
on the validity of the save of a Record.
Before this commit, several override save functions in Record execute
code after the record's save without checking if the record's save has
taken place.
Override before:
export class NewRecord extends Record {
async save() {
const isSaved = await super.save(...arguments);
// doAction
return isSaved;
}
}
Override after:
export class NewRecord extends Record {
async save() {
const isSaved = await super.save(...arguments);
if (isSaved) {
// doAction
}
return isSaved;
}
}
How to reproduce the problem:
Go to a form view with a Record having its save override function.
Edit a record in such a way to have an invalid field
Click on the save button
Before this commit:
The doAction is executed
After this commit:
The doAction is not executed
Real use case
- Go to the form view of a lead in CRM
- Change stage
- Clear the name field
- Click on save button
Before this commit:
A call to get_rainbowman_message is made
After this commit:
No call to get_rainbowman_message is made.
closesodoo/odoo#105687
X-original-commit: 46b93da545b52496196624712c44599fd6467f4e
Related: odoo/enterprise#33913
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The mapped call is supposed to populate the cache, but that's already
taking care of by prefetching. It ends up adding an overhead instead.
The perf improvement is more noticeable on large recordsets.
For example, on a database populated with 100k res.partner records.
Before:
.. code-block:: python
partners = env["res.partner"].search([])
partners.filtered("name") # warm up
timeit.timeit(lambda: partners.filtered("name"), number=10)
# result: 7.15
After:
.. code-block:: python
partners = env["res.partner"].search([])
partners.filtered("name") # warm up
timeit.timeit(lambda: partners.filtered("name"), number=10)
# result: 4.67
closesodoo/odoo#105350
Signed-off-by: Rémy Voet <ryv@odoo.com>
This commit updates the tooltips of disabled form field's duplicate &
remove buttons so that they do not reference the concept of "model".
task-2950433
closesodoo/odoo#105278
Signed-off-by: Romain Derie (rde) <rde@odoo.com>