Currently if event website menu main checkbox is unchecked the related website
menu is removed. Its children are also removed through the cascade attribute on
parent_id field.
However this is done in SQL, meaning some overrides on unlink of website.menu
is not called. This does not properly cascade unlink views linked to website
menus through the specific "website.event.menu" model. This leads to some
views staying alive in DB. This causes issues with web editor when calling
``_views_get`` as he may receive several views linked to a given view_id (key)
while it expects only one.
We fix that behavior by removing the menu and its children explicitly. This
calls various overrides done in website_event.
Task-2616588
X-original-commit: 9722baee83adea9808de1247c300e226cf6fc537
Part-of: odoo/odoo#80391
Currently in the mobile view, all the event sub-menus are showing horizontally
which looks ugly and hard for selection. This horizontal display is ok for
big screens, not for mobile.
This commit changes the direction of the events sub-menu from horizontal to
vertical when being in mobile. It also sets the left margin to fix the
flicker effect in the mobile view.
Task-2616588
X-original-commit: 2cb67c6be51af61fbdbe6f069e6a32839d7a682a
Part-of: odoo/odoo#80391
PURPOSE
After this commit when creating a partner the language will default
to the crm lead value.
LINKS
Task-2580065
Pr: odoo/odoo#76812
Related: odoo/enterprise#20689
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
PURPOSE
Before this commit, when a partner was created through the
suggested recipient tool the langage wasn't considered...
The email was thus sent in the wrong langage most of the time
After this commit, the suggested recipient tool had the
langage correctly if present in the record.
LINKS
Task-2580065
PR : odoo/odoo#76812
If the subject is not set, the wizard set the subject as "Re: False"
closesodoo/odoo#80372
X-original-commit: 169775419e0f14723c19ff5f14e0907c179721d9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When changing a value for a o2m (list) within a form, the _setValue
returned a Promise that did not take into account the real rendering of
the list renderer.
The use case at hand is:
- enable product configurator
- have a product with options
- add that product in a SO
- add the option as well through the product configurator
- confirm the configurator
The configurator triggers an add_record event, with an onSuccess callback
Before this commit, the onSuccess callback was called too early, when the previous
rendering operations were not finished yet.
After this commit, the onSuccess is executed when the list renderer is really ready
opw-2580044
closesodoo/odoo#79591
X-original-commit: 8def0d103020aed4211fd22f2b917567fb06de1e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Commit [1] and its forward-ports introduced a test tour (properly added
in assets_tests) but was not declared as a test one. Meaning that if you
were in debug=tests, you were able to follow a strange tour not meant
for user testing.
[1]: https://github.com/odoo/odoo/commit/3c194faa930b0d3a537ca8b893b2c0442b5464e7closesodoo/odoo#80362
X-original-commit: 732addec9452813a404823f28703d54d37a6b87f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The use case happens in studio.
have some overflowing app submenus in an app
go into studio
refresh with a simple F5.
Before this commit, the navbar's overflowing buttons wouldn't put themselves inside the "more" dropdown
This was because the studio client action also reacts to change in the menu service, so the technical flow was:
- laodState (webClient)
- setMenu (MENU-CHANGED on the bus), then because of it:
- studio client action > render (1)
- studio navbar > render (with adapt right after that render!) (2)
- studio navbar > render (because of 1) which cancels the render in 2 without cancelling the promise, that is
adapt is still called.
To remedy this, the standard use of useEffect and useBus are is put into place.
After this commit, the studio navbar has its overflowing menu items in the dropdown.
The adapt algorithm now uses getBoundingClientRect to get the not rounded width of elements that should be adapted,
otherwise, slight differences in browser's computation and rounding of offsetWidth may influence test results.
closesodoo/odoo#80353
X-original-commit: 231902738287a897f50a1711f991bc55928b77d9
Related: odoo/enterprise#22498
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Introduce the onDestroyed hook which makes a callback executable
whenever the component is destroyed.
X-original-commit: 0f454392b39dcbc7e297e882117452c5adc342be
Part-of: odoo/odoo#80353
From a list view with multiple records, go on a record of that list
Click on the pager next button
Before this commit, the browser tab's title was not updated to the second records.
After this commit, it is.
closesodoo/odoo#80346
X-original-commit: 3d27b739a3e8243d50e9764000727b31727dc2d2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Allow log date changes tracking by adding chatter on company and tracking lock date fields.
closesodoo/odoo#78730
Task: 2651834
Related: odoo/enterprise#22479
Signed-off-by: Laurent Smet <las@openerp.com>
Description of the issue/feature this PR addresses:
In hr_holidays, there is no information about the conflicting time off when a second time off is scheduled at the same time.
There is a validation error saying "You can not set 2 time off that overlaps on the same day for the same employee".
The validation error should display the conflicting time off
Current behavior before PR:
The validation error displays the following:
"You can not set 2 time off that overlaps on the same day for the same employee"
Desired behavior after PR is merged:
The validation error will display the following:
"You can not set 2 time off that overlaps on the same day for the same employee.
Existing time off: Mitchell Admin / Trip with Family : 24.00 hours / from 06/09/2021 to 08/09/2021 / To Approve"
task-2641682
closesodoo/odoo#76452
Related: odoo/enterprise#22490
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Some data are formatted as a tree structure with a relation of parent.
We are adding meaning to the structure:
* This improves readability and allows to fold/unfold records in
editors.
* This could be done before using `eval`, but this allows to have an
xml_id for those records. It also allows to update the records without
having to rewrite on the parent x2many field.
Part-of: odoo/odoo#76675
Before this commit, website shop had some blocks without names
which could make it hard for a user to understand to which block was
an option related.
This commit adds names to these blocks.
task-2670809
closesodoo/odoo#78889
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit when a website page was deleted, its related website
menu was deleted inside the database only through the ondelete="cascade"
of the Many2one relationship. This however did not perform the menu
cleanup on the ORM side.
This caused problems when the related menu id was kept in cache by
website's _get_menu_ids(), because the record could not be fetched
anymore. E.g. deleting a website-specific version of the "Contact Us"
page caused the problem, making the menu bar non renderable on all
pages.
After this commit the caches are cleared when a page is unlinked to
avoid this problem.
task-2686221
closesodoo/odoo#80348
X-original-commit: dd9997753d442f8923b31c3ceaa0cd29b09a06b2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
After the update in [1], the tip is centered on text content
instead of text container to prevent asymmetry caused by text
alignment.
The goal of this commit is to prevent tours from failing when
the target node is empty[2] by centering the tip on text content
only when the target "hasChildNodes".
[1]: https://github.com/odoo/odoo/commit/ea3b1ec9a0984560f8fce5b5a04f6f24347f97c4
[2]: e.g. After #66844 : The blog will have title as <h1> tag
which is empty by default > which makes 'blog' tour fail.
task-2454130
closesodoo/odoo#80343
X-original-commit: 574ffa2a9f6ece51e446fefa4bc5f4b5acb4340a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Purpose
In discuss, improve chat UI so that it will be easier to read when a voice/video
call is started.
Specification
- Reduce paddings above and below message box.
- Put a white background for the massage box instead of light gray.
Task-2591180
closesodoo/odoo#74312
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to reproduce the bug:
- install `”purchase_product_matrix”`
- Go to the purchase settings and enable “Warnings” option
- Create a product with variants
- Add purchase warning
- Create a PO and add the product
Problem:
The warning message is not appearing
Solution:
the `”_product_id_change()”` function has no return.
To trigger the warning message, we have to call the `”onchange_product_id_warning”` manually because it is not triggered automatically in the grid case
opw-2696007
closesodoo/odoo#80340
X-original-commit: 26bdebf6fd8b77013ea449a02184e8a843ffe9e9
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Steps to follow
- Go to the purchase app
- Create a RFQ, add a line, confirm it, lock it and save it
- Click on the one2many line
-> An editable popup is opened and the main form is also switched in edit mode
Solution
- Check if the one2many list has a readonly modifier before switching the main
form to edit mode
- When opening the one2many preview popup, pass along an editable param
opw-2689420
closesodoo/odoo#80338
X-original-commit: d1c9265659572c738596889f7a5ad53f673e9db4
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Fixes 2 issues:
1 - odoo/odoo#61027 made mrp.routing.workcenter.company_id =
self.bom_id.company_id. This made it so the work center selection is
empty until a BoM is selected, which is confusing to users. To make it
less confusing, we switch the order since we expect users to fill in
the fields from top to bottom.
2 - odoo/odoo#65628 made it so the BoM can be changed. This made it so
it's possible to save the record and have the company of the BoM and
the work center not match. This can lead to a usererror when users try
to start the WO associated with the operation. Steps to reproduce:
- create a new operation from Configuration > Operations
- select a BoM from company 1 and a Work Center from company 1 + save
- edit and change BoM to a BoM from company 2 and DO NOT change the
Work Center
Expected result: save error
Actual result: Save will be allowed, but WO will throw an usererror
when you try to start it.
To fix this, we prevent the user from saving when the workcenter
company does not match the BoM's (if both have a company_id assigned).
closesodoo/odoo#80337
Task: 2682365
X-original-commit: f77c9560ad304940610d797018246a8f5d32f721
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
When using the 'new quotation' button on the opportunity view, the tags of the
opportunity are propagated on the quotation. However, this is not the case when
using the stat button 'quotations' and creating a quotation from there.
This commits adds the tags in context to propagate them in that case as well,
as well as the other fields propagated on the 'new quotation' button:
medium, campaign, user / team if any...
This means both behaviours now have the same context, except for the search
default values.
--- LINKS ---
Task-2679488
closesodoo/odoo#79352
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the bug:
- install `”sale_product_configurator”`
- Go to the sales settings and enable the “Warnings” option
- Create a product with variants
- Add sale warning
- Create a SO and add the product
Problem:
The warning message is not appearing
Solution:
The product configurator does not need to hide modals after the product is added.
This fix ensures that any modals displayed after adding the product (such as warnings, messages, etc.) are correctly displayed and not hidden.
opw-2696002
opw-2679495
closesodoo/odoo#80331
X-original-commit: e82230fd395fa71081dc94ffefc39b51ad258382
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Current behavior :
When we try to add a member through channel's settings by clicking on "Add a line", a blank line is correctly added but can't be edited.
Steps to reproduce :
- Install Discuss
- Go to channel settings
- Try to add a member by clicking on "Add a line"
Reason :
Since commit 89eef4cdd419cc23cfb8d3e0af7a7115119549c2 , 'partner_id' field as been set to readonly because it doesn't make sense to edit the partner_id of a channel. However, this prevents the possibility of adding a member.
( diff : https://github.com/odoo/odoo/pull/75496/files#diff-d02eca5ffaa6b9765330a905661cd6cb917b92d851b473d459ee011bb2c5be3cR17 ).
OPW-2677329
closesodoo/odoo#80326
X-original-commit: 9536f8ec556670f67939fdee825630e06d5b4808
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
- Hide the field 'currency' on the journal entries (for the miscellaneous journals only) because it is neither necessary functionally nor doing anything technically.
- Accounting journal views: amount in currency is made optional (shown by default)
- Journal entry view: currency is made optional (hidden by default)
closesodoo/odoo#79486
Purpose: lighten the user interface/make it clearer
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
PURPOSE
When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.
SPECIFICATIONS
Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.
When grouped, display should be the old one, aka a standard card.
This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.
A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.
An override in website_slides_survey is added to add number of courses using
the survey.
Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.
Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).
Task-2388785
closesodoo/odoo#77227
Related: odoo/upgrade#2862
Related: odoo/enterprise#21194
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
PURPOSE
When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.
SPECIFICATIONS
Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.
When grouped, display should be the old one, aka a standard card.
This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.
A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.
An override in website_slides_survey is added to add number of courses using
the survey.
Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.
Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).
Task-2388785
Part-of: odoo/odoo#77227
As we are about to refactor survey views, especially kanban, let us rename
some views xml IDs. Especially they have few overrides so quick to do.
Task-2388785
Part-of: odoo/odoo#77227
Currently mail override of avatar user widget strips user name in
kanban view. Real reason is quite obscure, see odoo/odoo@59641325c7
In this commit we add an option to display both the avatar and the name.
Sometimes you want to display an avatar and a name to have a nice display
especially when focus is more on the displayed user / partner than on
chat capabilities.
Task-2388785
Part-of: odoo/odoo#77227
Before this commit, the opening of a calendar popover could crash
because we tried to evaluate the domain of the readonly modifier.
Only the invisible modifier is necessary in the calendar popover so
this commit fixes the issue by evaluating only the invisible modifier.
It was also evaluated twice to do both the same thing so this commit
remove the duplicated lines.
closesodoo/odoo#80318
X-original-commit: c558ae309ff63a26c30ea0196930eb15a279e1dc
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Since https://github.com/odoo/odoo/pull/79858,
we define the patch._super with an `Object.defineProperty`.
It works well but it prevents objects from being patched
by the legacy patch method afterwards.
closesodoo/odoo#80317
X-original-commit: 2090e09c51876b9b8af4097ca8f093a8c19361e0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Previous implementation was generating an unoptimised query which
lead to unacceptable loading time on large databases.
task-2697814
closesodoo/odoo#80316
X-original-commit: fa1578abea4ebe887d4e23a81bb1011ed986cc0c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Purpose
=======
Improve UI of mass_mailing module to give the user a clearer view of the
mailings they send, enabling A/B test by default since it is not invasive.
Specifications
==============
Remove border and padding around the chatter in mass mailing form view.
Add sum and average in mailing list view for KPIs
Change sort order from sent_date to calendar_date
Move user_id in form view
Set group_mass_mailing_campaign to True by default
Task-2679537
closesodoo/odoo#79213
Related: odoo/enterprise#22202
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit slightly improves the quiz error management when building a quiz
directly on the website or when answering to the quiz.
When there is a validation or submission error, instead of displaying a toaster
very far from the user focus, we add the error next to the button he just
clicked.
For the question validation, this requires a small trick in the controller,
where we catch the ValidationError to return the message to the JavaScript.
Task-2678061
closesodoo/odoo#79081
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
After this commit:
- The livechat button is redesigned as a floating icon in website.
- The "colliding" check between buttons and bottom fixed elements is no
longer done only on the buttons but also on the <a> elements.
- When the livechat button hides a button/link, it is moved up rather
than made invisible.
task-2614762
closesodoo/odoo#78891
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
From the portal view of a SO, when a public/portal user tries to open
the delivery order, he will have an error
To reproduce the issue:
(Need sale_management. Use demo data)
1. Create & Confirm a SO:
- Customer: Joel Willis
- Add some products
2. Log in as portal (i.e., Joel Willis)
3. Open the SO
4. Open the Delivery Order
Error: It leads to a 403 error page.
When rendering the template, the `sudo` flag is forced to False. Since,
in this case, this is a public controller that uses a token, we can use
`SUPERUSER_ID` (see [1] for more details)
[1] 61b4b6777d64218f94c51ec839c187fdc7b2034f
OPW-2689053
closesodoo/odoo#80308
X-original-commit: cb098f6348ddc85edfef06c284c74c8af44ca7ba
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Align style of company_image.png with avatar_grey.png to keep interface
and usage coherent.
Task-2487489
Task-2688887
closesodoo/odoo#80304
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently no chatter is added on team member form views. Indeed this model is
mainly technical and accessed through a dedicated menu in configuration.
However some fields are tracked and being able to see tracking information is
important in day to day dealing of team members. This is why we add chatter
on team members form view.
We also add context key to avoid autofollow when creating team members. As
chatter is mainly present for tracking and information no need to add extra
followers automatically. This causes unnecessary notifications.
Task-2679897
closesodoo/odoo#79356
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Make the slide.embed feature more reliable and more visible.
REASON
Currently, we use the same URL to embed slide content within the e-learning
module and when the end-user wants to embed that content on an external
website.
However, we want to know whether the slide is embedded externally or not to
show different controls and update some statistics.
The code previously relied on the presence of the "referer" header to achieve
that detection, if the referer URL comes from a domain that is not this Odoo
website -> then it's embedded externally.
The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).
SPECS
- Introduce an external embed URL to ease external embed logic
- Improve various sharing controls when slide is embedded externally
- Globally improve the slide.embed feature and give it more visibility
See underlying commits for more details.
LINKS
Task-2654009
closesodoo/odoo#77736
Related: odoo/upgrade#3059
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently, the slide.embed statistics only work if a 'Referer' header is passed
in the request object.
The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).
This commit refactors the slide.embed feature to work even without a referer
header.
When the header is missing, the incremented count will be stored under a
common slide.embed record with a url field = False.
This count is still useful because the end-user will want to know if the slide
is popular externally, even if we don't know on which website it has been
embedded exactly.
In addition, we add more visibility to the slide.embed feature by introducing
a stat-button on the slide.slide form view, that redirects to the list of
slide.embeds for this slide.
Finally, we also renamed the 'embedcount_ids' field to 'embed_ids' to get a
better / clearer naming.
A few tests about embed detection were added to ensure this behavior.
(Tests are based on the work of Nathan Marotte <nama@odoo.com>).
Task-2654009
Part-of: odoo/odoo#77736