Commit [1] moved the edition of website from the frontend to the backend
and in doing so, introduced an iframe from which the website is edited.
This broke some behaviours as the event binding for jQuery widgets (such
as the carousel) is no longer done from the same jQuery as the editor.
So bootstrap events triggered inside the iframe do not reach options
that are listening using the top window's jQuery (simple $()).
This commit adds the $bsTarget property to the SnippetOption class.
It wraps $target[0] using the iframe's jQuery instance.
This allows for options to listen to bootstrap events.
(using $bsTarget.on)
Options that were doing that previously are adapted by this commit.
(Carousel, Popup, Accordion (collapse))
Note: Popup was already adapted locally (by [2]), this commit only
changes its use of an $iframeTarget property to the $bsTarget one.
This commit also fixes "Add item" on accordion snippet to properly
assign a unique ID to the new tab.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af
task-2687506
Part-of: odoo/odoo#94564
Commit [1] changed the way styles are handled. Now that the edition of
website is done in an iframe, the styles are computed inside the iframe
instead of the top window / global document element.
But for computing the gray colors, a base style defined
by `web_editor/color_palette.scss` is needed. This style is not part of
the frontend assets, so using the iframe to fetch it creates bogus gray,
which results in the feature not working.
Steps to reproduce:
- Go on the website editor
- Select the THEME tab
- At the bottom expand the gray color picker
- Use the settings
- The preview is not updated while sliding.
- The colors are not updated in the page.
This commit fixes the bug by fetching the base style from the top
window (where backend assets are present).
[1]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6
task-2687506
Part-of: odoo/odoo#94564
Steps to reproduce:
- Go on website
- Click on edit
- Add a snippet
- Click on discard
- Close the popup using the 'X' at the top of the popup
- Buttons are still disabled
Commit [1] adapted the website dialogs to the OWL Api but also
introduced this bug.
This commit fixes that behaviour and re-enables the buttons
if the popup is closed.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
task-2687506
Part-of: odoo/odoo#94564
Commit [1] moved the website builder in the backend and in doing so
transferred event handling to the wysiwyg_adapter from the edit button
widget. Unfortunately, during that process, handling of event for
cloned snippets was forgotten.
This commit restores that and adds a test.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
task-2687506
Part-of: odoo/odoo#94564
before this commit:
users without read permission of ir.module.category cannot search
res.groups by names. An access error will be raised.
after this commit:
all users with read permission of res.groups can search res.groups
by names
closesodoo/odoo#97877
Signed-off-by: Raphael Collet <rco@odoo.com>
Since the new views, the empty domains on the archs were not be taking
into account.
Now, the empty domains are taken into account, this was the legacy
behaviour
closesodoo/odoo#97791
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
An HTTP Partial Request is a regular GET request with a Range header
that indicate what chunk of the data the browser wishes to download. It
is useful to peek in a video stream or to resume an interrupted
download. The server can respond with a 206 - Partial Content response,
set the appropriate Content-Length and Content-Range headers and only
send a chunk of the data in the body.
Werkzeug's `send_file`, the library function we use to stream files over
http, is fully compliant with partial requests and responses. It
understands the Range request header and create the corresponding
response.
NGINX does also comply with the Range header even via X-Accel-Redirect.
closesodoo/odoo#97422
Signed-off-by: Julien Castiaux <juc@odoo.com>
Have a legacy field with the noLabel attribute to true (in the actual widget definition).
Put that field in a list view (new OWL framework).
Before this commit, the noLabel attribute was not taken into account.
After this commit, it is.
closesodoo/odoo#97899
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The mistake was made in odoo#81904
Instead of 'default_partner_bank_id' we have 'partner_bank_id' in the
context of action_register_payment.
In this commit, we undo that mistake and also backport the change to v15.
task - 2774594
closesodoo/odoo#97886
X-original-commit: 5c8b74bb3bddd67b5a76d37f7d97a1d5d77c00c4
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Purpose: When re-invoicing the expense on the SO, the cost (purchase_price)
is not correctly set. For expenses with zero product it is set to zero,
and for the expenses with price on it, it is set to unit_price of the product.
As a result, the margin is calculated incorrectly on SO.
It should be set to the untaxed_amount of the expense in case of zero
product, or untaxed_amount of the product in case of a product with
price defined on it.
task - 2867723
closesodoo/odoo#96981
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In case there is no need for currency conversion, the return value of
_sale_get_invoice_price is not rounded. While, when currency conversion
takes place, the return value is rounded. First of all, the behavior is
not universal, It should be the same across these cases.
Secondly, not rounding the return value causes discrepancy when computing
margin (in the sale_margin module) for expense products; as price_unit
is not rounded (in the first case), while purchase_price is rounded.
task - 2867723
Part-of: odoo/odoo#96981
Before this commit, in translate mode, the toolbar and the
table-container were shown when initializing the SnippetsMenu (and
removed for a click on an element that was not a translation).
To reproduce:
-> Install another language on website 1,
-> Click on translate
-> Click on a button of the informative dialog
-> The toolbar was there, then was removed on the click on the dialog,
and won't reappear.
(If the informative dialog is not shown, because it was permanently
dismissed, click on an image, the toolbar is still there and won't be
removed).
To fix that, the clicks on translations elements are not stopped from
the TranslatePageMenu and are taken into account in
_checkEditorToolbarVisibility to show/hide the toolbar.
Related to task-2687506
closesodoo/odoo#97855
X-original-commit: fbe35ed2f4c0727d097227fa6decf544f5db27fe
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- Create a quotation
- Add a product that is invoiced on "ordered quantities" and set the
quantity to a negative number.
- Leave 'delivered' to 0
- Confirm the quotation
- Create the Invoice and validate it.
- Go to the SO list view (Orders > Orders)
You should see that the Invoice Status of the order you just created is
'Upselling Opportunity', which is not correct.
Why this is happening:
Here's an explanation on the 'Upselling Opportunity' state (found in
the code):
" upselling: this is possible only for a product invoiced on ordered
quantities for which *we delivered more than expected.* "
In our case, the invoice line's state is set to 'upselling'
because we have a negative ordered quantity and a zero delivered
quantity (i.e. we delivered more than expected)
opw-2895218
closesodoo/odoo#97830
X-original-commit: 5f10583336bf39430a304e2c47dfd0310ee4fa3d
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
Have a section of a settings view that can be search in.
Have a dynamic invisble modifier (governed by a domain) on it.
Before this commit, the condition were just juxtaposed, which will cause problem
if one of them contains a "OR" operator. So, sections that should have been invisible were visible
because the if looked like: search() or search_other() and isVisible().
After this commit, the t-ifs are correctly combined so that they look like:
(search() or search_other()) and isVisible().
closesodoo/odoo#97811
Signed-off-by: Samuel Degueldre <sad@odoo.com>
During qunit test, the audio notification is never used but the audio
element is still computed. This leads to unnecessary get requests
being triggered on the server. This PR prevent computing the audio
field of the user_notification_manager if canAudio is set to false.
closesodoo/odoo#97785
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Have a field declared in python with a "help" property.
Put that field in a view with a "help" attribute.
Before this commit, the xml declaration was not taken into account.
After this commit, xml declaration has precedence over the python one.
closesodoo/odoo#97782
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a one2many in a form view. It displays its records with a kanban.
Add a record, now click on that new record.
Before this commit, there was not "Remove" button, preventing to effectively
remove a new (virtual at this point) record from the one2many.
Aftet this commit, there is a remove button that effectively removes the
record from the one2many.
closesodoo/odoo#97775
Signed-off-by: FrancoisGe <fge@odoo.com>
In order to prepare the ground/reduce the noise in the PR
introducing the websockets in Odoo, the mocks of the longpolling
route in tests is replaced by calls to sendone/sendmany.
This will allow to keep the same code while changing the underlying
technology.
task-2053917
closesodoo/odoo#97771
Related: odoo/enterprise#30244
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The `key` field is often (`_get_view_id`/`_get_specific_views`) used to
find an ir_ui_view. Because `key` doesn't have index, PostgreSQL will
always do a SeqScan. Because the table is small, it doesn't create a
huge performance bottleneck, but it still not very efficient.
closesodoo/odoo#97478
Signed-off-by: Julien Castiaux <juc@odoo.com>
Prior to this commit, the dashboard was a table and there was
unnecessary scss.
This commit changes the table into the new bs5 grids
and clean the scss files.
In the portal view, a class(orders_label_text_align) that didn't affect
the design was removed.
task-2906527
closesodoo/odoo#95902
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
`content = self._compile_to_str(content)` is done twice in the compiled
method of qweb. Remove it once.
closesodoo/odoo#95755
Signed-off-by: Julien Castiaux <juc@odoo.com>
"website.layout" inherit of "portal.frontend_layout" which inherit of
"web.layout" which contains the creation of the CSRF token.
Add because "website.layout" add a t-cache key, the CSRF token is under
this cache key. But the CSRF token should be always generated,
then add t-nocache on CSRF token t-set.
Part-of: odoo/odoo#95755
Rename from google_cal_account_id to google_calendar_account_id, to have
the complete 'service' name into the field and allow to use it from a
generic way in oauth2callback from google_account e.g.
task-2497212
pr-95744
closesodoo/odoo#95744
Related: odoo/upgrade#3673
Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit removes outdated method no more used since we delete oog
apps like gdrive.
This commit remove the logging of sensitive infos.
This commit allows to override easily api key.
task-2497212
pr-95744
Part-of: odoo/odoo#95744
configuration
Currently, Outlook and Google calendar having same container `id`.
This PR will fix that problem
closesodoo/odoo#97858
X-original-commit: 757cf027afb5eaa1ac831b8dda6664edd45c6a69
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit if Identify Customer option was enabled for a
payment method in point of sale but no customer was set for an order,
we get a SQL constraint error that has no hints on where the problem
comes from.
This process can be improved by a better error message that directly
points out the problem.
opw-2907152
closesodoo/odoo#97566
X-original-commit: 06c8765d362f81aa92f25029cb5d4e9d4069b3d3
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
The cumulative option on line chart is useful for displaying
cumulative information graphically.
closesodoo/odoo#97394
Task-id: 2146487
Signed-off-by: FrancoisGe <fge@odoo.com>
With the conversion to the new views, legacy x2many fields go through a
thin and incomplete compatibility layer to talk to the new model. This
compatibility layer is not very robust and as such most custom x2many
fields are broken in this configuration, in this case the field
"question_page_one2many".
The proper fix is to convert this field widget, but in the mean time,
the simple fix is to force this view to keep using the legacy view
instead of the new view.
closesodoo/odoo#97868
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Reproduction:
1. Install Website and eLearning
2. Add new language Dutch
3. Modify the course responsible’s name as “Gertjan Kleinbloesem” in
eLearning
4. Open the course page in the website app and switch to Dutch, the
responsible name is over flowed
Reason: The background container doesn’t adapt to the length of the text
Fix: Add text break to the responsible's name so it won't break the
style
opw-2862250
closesodoo/odoo#97839
X-original-commit: bb2045f77ee7383af85b2d65c015d91f92b20647
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
The Powerbox crashed whenever a command was wrongly defined. That's a
bit too brutal so this sets defaults instead.
closesodoo/odoo#97794
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
pull-right is not standard Bootstrap 3.
closesodoo/odoo#97851
X-original-commit: 1098377b4e8fff4400c03da405903d9ba246dbd8
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Only for terms containing Credit Note and expenses
closesodoo/odoo#97840
X-original-commit: 1754b094a66476a0bdb29fe60dc5583c03336c3f
Related: odoo/enterprise#30262
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When you print or preview an invoice, the lines with the product are not
displayed. Before changes made in PR: https://github.com/odoo/odoo/pull/96134
the lines containing products didin't have a display_type.
Since those recent changes, their type is product, so we are now
checking that they are of display_type 'prodcuct' instead of having the
display_type to false
closesodoo/odoo#97862
Signed-off-by: Masereel Pierre <pim@odoo.com>
Using named attribute 'start' in sum function is not compatible with
python 3.7, it is also set as 'start=0' which is useless as it is the
default value of start argument.
Part-of: odoo/odoo#97862
Steps to reproduce:
- Switch language to french
- Refresh the page
- Create a new payment
- Select a partner
- Enter an amount of 100000,00
- Save the record
-> The following field is incorrect: amount
Cause of the issue:
Since https://github.com/odoo/odoo/pull/97425 ,
`parseMonetary` wrongly assumed that a currency was always passed in
the parameters
opw-2937403
closesodoo/odoo#97861
X-original-commit: 9d518f847d2204fc5159a92bc4e4de655acf88fa
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Fixup for 4caa9596bc, where a rebase went bad.
Have a translatable field in a form view.
Create a new record with that form view.
Click on the button to open translations for that field.
Before this commit, the record was not before opening the translation dialog, hence
changing the translations could not work properly.
After this commit, this feature is back, and we ask to save a new record before
opening the translation dialog.
closesodoo/odoo#97824
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Issue:
Customers can use Mollie and lower the price on a quotation through changing the
delivery method, if they have two pages "/shop/payment" and proceed with payment
on one they can still change the carrier on the second. Although the quotation is
not confirmed because of mismatching amount, a confirmation email is still sent
and a bank payment is still created. Please see the following test video.
Solution:
We add a check so that changing a carrier can only be done when a no active/done
transaction is linked to the sale order.
opw-2925673
closesodoo/odoo#97818
X-original-commit: 151edb7d088ec9e5ea10fa8f184c7cb3a030a6ab
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Oversight of: 129b91027700313066db0305876adcf9b2a3817d
If the view is not up to date, it will not display any agenda locations.
We need to keep the 'locations' key into the returned values for code
retro-compatibility.
Task-2942630
closesodoo/odoo#97751
X-original-commit: 6c72297e72e0936e5564f175dcb1716057e0ac4b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Since [1] when the search bar was refactored, a search facility was
added on website pages and the rendering of those search results did
not correctly handle the HTML escaping.
This is related to the fact that the `ir_ui_view`'s `arch_db` field is
stored with this double escaping on text nodes, which is done by
`wysiwyg.js` through the `_getEscapedElement` method since [2].
This commit unescapes the last layer of `&` before extracting the
page's text for generating the search results.
Steps to reproduce:
- Add some "&", "<" or ">" characters in a page.
- Use the search snippet to lookup for the page.
=> The results in both autocomplete and the results pages display the
content with an extra unwanted escaping (&...)
[1]: https://github.com/odoo/odoo/commit/9f9c4bb7e40233e633f97c60fb00ae191e9077af
[2]: https://github.com/odoo/odoo/commit/f5acea7f9ce232773ec3adf1828a3d18bbedee1e
opw-2908645
closesodoo/odoo#97748
X-original-commit: 2b95dcdb0d8b49bac8ee38a8d062112468124012
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>