The `ratio` class used for embeds creates a static context.
Using `position: relative` for the subsequent element makes sure it doesn't
end up 'under' the embed on large viewports sizes.
For simplicity, we chose to not test for the actual presence of an embed
or window size before applying position-relative on the next div.
Task-2663320
Part of odoo/odoo#79615
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
* = blog, forum, slides
For performance reasons, allow to increment multiple fields of the same record
within the same query.
With python tests.
Task-2663320
Part of odoo/odoo#79615
The layout of slides needs a little freshening-up.
### Comments and slides
* The ratings are only showed once, and only for "documentation" contents
* Indications of why the user cannot post a comment are added (signing up,
Karma, commenting not allowed), and the portal template is not called if
there is no comment and commenting is not allowed (for user or course).
In addition, the "Comment" tab is never hidden anymore, to not hide
the available/activate-able features.
* Detailed view statistics are now shown only to selected users.
* Slide public views represent views by the public and all users that
are not members of the course.
* When channel/slide images are not set or inaccessible, a default image
is used (instead of plain background or unauthorized requests).
* These images are now editable on frontend.
* The 'Additional Resources' subtitle is hidden from the detailed slide view
for invite-only courses as nothing else was shown with it.
### Misc.
* This commit also fixes the "unresponsive" `total_views` count after public
views, by manually incrementing it too. This is required because `public_views`
is directly updated via SQL query and does not trigger model _computes.
* We also adjusted the test in survey that used a public user while in all
cases users must be logged-in (and therefore get portal privileges) before
they can participate.
Task-2663320
Part of odoo/odoo#79615
- Before this commit
Validating an invalid kanban record on quick creation
would leave the quick creation mode.
- After this commit
Validating an invalid kanban record on quick creation
will stay in quick creation mode, indicating which fields are invalid.
closesodoo/odoo#98874
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In commit 0194fa8236144596042a20f182ec3f48ea29b998, we fixed
the appearance of the color list in the livechat channel view.
But w-auto classnames were not added to some fields, which let
the positioning issues only partially fixed.
This commit concludes the fixed introduced in #98755.
closesodoo/odoo#98871
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit reverts changes that are no longer
necessary since PR #98711 which fixed a lot
of issues regarding styles and alignments.
closesodoo/odoo#98867
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, in a legacy view, clicking on debug menu
"View Metadata" causes a crash.
closesodoo/odoo#98866
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when you double-clicked on an image in the Images
Wall block, the modal appeared twice. This commit ensures that for the
block Images Wall, only one modal can be present at a time.
Steps to reproduce the problem:
- Drop the block Images Wall on a page
- Save
- Click twice quickly on the same image
-> Two modals are open (one on top of the other)
task-2937538
closesodoo/odoo#98857
X-original-commit: e21ff31c429a8bc339f527a2e4eacc0f1b2f6d7d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_tour, test_website
Since [1] when the link popover was introduced, when the URL of a link
was made empty, an validation error appeared by the previously shown URL
did still appear inside the popover.
After this commit the previously shown link is replaced by a message
that indicates that no URL is specified.
The telephone and envelope icons are now also always removed when the
URL is change: they used to be only toggled, which made it possible to
make them appear and disappear by updating an email address or a phone
number.
Steps to reproduce:
- Add an image-text snippet to the page
- Select the image
- Add a link on the image
- Specify URL
- Click on image => link popup shows the entered URL
- Make the URL field empty
- Click on image
=> link popup still showed the previously entered URL
[1]: https://github.com/odoo/odoo/commit/8fcf930a6b6b7ffb0965b0a689c7a3117962ce7e
task-2765857
closesodoo/odoo#98845
X-original-commit: f212c56d73f5dad8eb5850b0b39cc92f55706ee2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Since [1] the link tools got created when the destroyed sub-elements of
the link were clicked on. This causes a problem when the element is a
media because upon destroy the tools reset the link to an incorrect
state.
After this commit the link tools is not touched anymore if the element
that was clicked on is a media.
Also, it reflects the changes done in the popup into the media link
options, and the ones done in the option into the popup.
Steps to reproduce:
- Add an image-text snippet in the page
- Click on the image
- Set up a link
- DO NOT click on the image again
- Click on the left of the image (to click on the snippet itself)
- Click on the image again
=> The image was removed instead and a text link remained
[1]: https://github.com/odoo/odoo/commit/d69d26a2dd8830aca8c5922d3548e5ff59c688fc
task-2765857
X-original-commit: 11ee7d5520c3a14a381b3f5b973114670f1e2edb
Part-of: odoo/odoo#98845
- Before this commit
On an empty m2m_tags(_avatar)_field, triggering a keydown event yields to a traceback due to an owl issue.
This will be fixed in owl later.
- After this commit
The 't-on-keydown' attribute on TagsList component has been moved into the tags themselves.
closesodoo/odoo#98840
Signed-off-by: Samuel Degueldre <sad@odoo.com>
- Before this commit
The browser autocompletion feature may conflict with
the AutoComplete component. First, the browser could
display its own autocompletion dropdown over our component's.
Secondly, selecting an item in the browser's autocompletion
dropdown simulates a keydown event with an undefined 'key' property,
leading to display traceback when the AutoComplete component
uses the keydown event (i.e. in getActiveHotkey).
- After this commit
The <input/> of our AutoComplete component now has the following attr
`autocomplete="off"`. This disables the browser's autocompletion feature
for this <input/>.
Part-of: odoo/odoo#98840
Before this commit, clicking on any part of a kanban record would
initiate a drag & drop sequence, this included its dropdown. This caused
2 issues:
- You could start to drag & drop records by dragging their still opened
dropdowns ;
- Said dropdowns would remain open when dragging their parent record.
This commit fixes both of these issues by hiding dropdowns during drag
sequences and preventing drag when clicking inside the dropdowns.
closesodoo/odoo#98791
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit adds a new parameter to the 'useSortable' hook that allows
HTML elements to prevent a drag sequence. This 'ignore' param can be a
string or a function returning a string, that will be a selector
targetting the elements that need to prevent drag & drop sequences.
Part-of: odoo/odoo#98791
When using CABA and reversing a move, we expect the CABA move to
be the one impacting the tax grids, and not the reversed move.
Thus, we now avoid setting the tax grids for CABA taxes on
move lines created when making a reverse move.
Task id # 2895267
closesodoo/odoo#98789
X-original-commit: 5dd50ac1433be262ddd49d8b165e240afd16e675
Signed-off-by: Laurent Smet <las@odoo.com>
Since #96791 the currency is reset to USD when starting a test to be
less dependant of demo data when starting tests.
Unfortunatelly, some l10n_modules will add account.move.line demo data
leading to an error:
You cannot change the currency of the company since some journal
items already exist
An initial solution would be to delete the existing account.move.line
cls.env['account.move.line'].search([('company_id', '=', company.id)]).unlink()
This is only possible passing some context flags in order to disable some checks
existing = cls.env['account.move.line'].search([('company_id', '=', company.id)])
existing = existing.with_context(dynamic_unlink=True, force_delete=True)
existing.unlink()
Actually, unlinking account.move.line also creates other ones.
existing = cls.env['account.move.line'].search([('company_id', '=', company.id)])
existing = existing.with_context(dynamic_unlink=True, force_delete=True)
existing.unlink()
existing = cls.env['account.move.line'].search([('company_id', '=', company.id)])
existing = existing.with_context(dynamic_unlink=True, force_delete=True)
existing.unlink()
Finally, it looks easier to bypass all business logic leading to the proposed solution.
closesodoo/odoo#98736
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit fixes behavior issues in the progress bar field:
- the progressbar would not write on a field if it was declared as
'readonly' on the server (it sounds counter-intuitive but this widget
was supposed to write on records unless given the 'readonly' flag in the
field options);
- the "isEditable" prop was incorrectly computed, resulting in the field
not being editable in kanban views when it should be;
- when editing a value in the field, the focus should be automatically
given to the first input.
These issues have been fixed in this commit.
closesodoo/odoo#97411
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit introduces an object parameter to the "useAutofocus" hook,
that has 2 new optional keys:
- "refName": to override the ref "autofocus" (effectively allows to run
the hook multiple times)
- "selectAll": selects the whole value of the input/textarea (instead of
putting the cursor at the end).
Part-of: odoo/odoo#97411
Current cut-off entry labels are always "Adjusting Entry", which is unclear, especially when viewing entries from General Ledger.
Adding the Invoice number and adjusting the % recognized within each entry will make the labels easier to understand.
The percentage will be calculated accordingly, the cut-off percentage for the adjusting entry and (100% - cut-off percentage) for the original entry.
Also, the percentage on labels should be rounded.
task-2897292
closesodoo/odoo#97045
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
The aim of this commit is to improve UX by helping the user to find duplicate
bills in a more convenient way.
With this commit, when a user create a bill or credit note on bill that might
be a duplicate, a warning banner is displayed on the Form view of the
account.move.
On this banner there is a button that leads to the list of the duplicate
bill/credit note.
The previous warning message on post is also replaced by a RedirectWarning
Context:
Previously, the warning for duplicated bills was thrown when the bill was
saved. This was changed with https://github.com/odoo/odoo/pull/81748
It made the blocking warning being delayed until the bill is posted.
Previous to this commit:
A duplicate bill can only be detected automatically when posting the bill with
a non convenient blocking warning preventing the user to post his bill(s).
After this commit:
- A warning banner is displayed on the bill form during the bill creation.
- The banner contains a button leading to the list of duplicates.
- The blocking warning is improved by providing redirections to the duplicate
move.
closesodoo/odoo#81765
Community-pr: https://github.com/odoo/odoo/pull/81765
Task: #2612299
Signed-off-by: William André (wan) <wan@odoo.com>
Current behavior:
In the PoS if you use 2 differents payment methods (cash and customer
account), and that the cash amount given by the client require you to
give some money back, the amount due on the customer account would be
incorrect on the invoice.
Steps to reproduce:
- Start a PoS session
- Add the 750$ desk to the order
- Go in the payment screen
- Add customer account with 300$
- Add cash with 460$
- Click on invoice
- The invoice show that the client need to pay 290$ which is not
correct
Before the fix calling `_prepare_reconciliation_partials()`
with the sorted lines we had 2 credit lines (750€ and 10€)
and 1 debit line (460€).
Debit lines | Credit lines
460€ | 750€
| 10€
The function would reconcile the 2 first lines and stop after that
because the only debit line was fully reconciled
After the fix we have this
Debit lines | Credit lines
460€ | 10€
| 750€
After reconciling the 2 first lines we have this
Debit lines | Credit lines
450€ | 750€
And after reconciling the 2 last lines we have the correct amount left
to pay by the customer (300€)
opw-2857064
closesodoo/odoo#98828
X-original-commit: 1201123e272012b7b5ab65eebfd12a911ecc6c1a
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
The account_move view was changed in master and that way
the document type and number were not visible anymore or in
a weird way. If we just put it after the journal_div, everything
seems fine.
closesodoo/odoo#98810
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Before this commit, when a many2one's input shows the choice
"No records", the dropdown does not close.
Cause:
When blurring, the many2one will select its first item. In our case,
"No records" is not selectable and it will not close the dropdown.
How to reproduce:
- go to a form view with a many2one field
- insert a non-existent value in the many2one ("No records" is displayed)
- leave the many2one input ("blur" event)
Result before:
The dropdown containing "No records" is still open.
Result after:
The dropdown containing "No records" is closed.
closesodoo/odoo#98799
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
In screen with high dpi, scale of the canvas generated by html2canvas
is larger than normal (defaulting to scale 2). Apparently, receipt
printers don't recognize this so in this fix, we force the scale
to 1.
closesodoo/odoo#98796
Signed-off-by: Masereel Pierre <pim@odoo.com>
[MOV] various
Move code, views and data of mail / rating models into their own files.
Purpose is to have one file / model, easier when searching for inherited parts
of the code and see at a glance various usage of those models.
[FIX] in ir_cron
Trigger methods are defined as api.model but actually use self. Those are
therefore not model. Smart.
LINKS
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
closesodoo/odoo#98661
Related: odoo/upgrade#3805
Related: odoo/enterprise#30663
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Just doing the summer file cleaning. Move mail data into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
Just doing the summer file cleaning. Move rating code into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
Purpose is to have one file / model, easier when searching for inherited parts
of the code and see at a glance various usage of those models.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
Trigger methods are defined as api.model but actually use self. Those are
therefore not model. Smart.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
This commit adds the possibility of having a placeholder in a
required SelectionField.
Solution:
We always add a false option with the placeholder but it is "display:none"
if the field is required.
How to reproduce:
- create a new record in a form view with a required selection field
Result before:
The first option of the selection field will be selected
Result after:
The placeholder of the selection field will be selected
When editing the selection field, the selection field does not propose
the placeholder.
closesodoo/odoo#98823
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently, computing an account's current balance takes canceled and
draft invoices into account. Only posted invoices should be considered.
opw-2896728
closesodoo/odoo#98843
X-original-commit: d3a7115feab9ca1bd8372f4450d3abc3eb52cdb0
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
Previously, if you updated a legacy field widget in a new view twice in
quick succession, it may be that the first update recrates the widget,
but the second update doesn't wait for that widget to be created by the
previous update, even though the second update may rely on the widget's
$el to be defined, which can result in a crash.
This commit fixes that by making sure the widget has finished starting
before attempting to recreate it with the new params.
closesodoo/odoo#98822
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Exporting data incorrectly formats the float values of group headers
Steps to reproduce:
1. Install Planning
2. Open Planning and trigger the list view
3. Remove the default filter and add a group_by on employees
4. Export the data
5. The file produced doesn't have the same format for Allocated Hours in
the group headers and in the line details
Solution:
Create formats for float and monetary values using the user's
preferences in decimal separator and decimal precision. For monetary
format, we use the biggest decimal precision used in the company
currencies.
opw-2864273
closesodoo/odoo#98813
X-original-commit: 718e8eea7862ad307479190336baf5b5e7092ae4
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Current behavior:
If the UoM of a product is not 'units' (e.g 'kg') and tracked by lot.
When trying to print labels 'per unit', some users except one label printed
per 'kg'. But it will actually print one label per lot.
This is not a bug so we are just adding a tooltip to make it clear that only
one label will be printed for lots using UoM different from 'units'
Steps to reproduce:
- Create a product tracked by lots with 'kg' as UoM
- Create a purchase order for 5kg of this product
- Validate the PO and receive the products in 2 lots
- Print the labels "Lot/SN Labels" > "One per unit"
- Confirm, the PDF shows 2 labels
opw-2941942
closesodoo/odoo#98812
X-original-commit: 5b2eb07d3831406146d70150e3a9f61fa3aca7c3
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Before this commit, after:
- Drop a popup,
- Click on the undo button,
=> The invisible elements panel was still displayed, with the popup
entry.
To fix that, the panel visibility is updated on the
'historyUndo'/'historyRedo' events alongside refreshing the snippets
editors.
task-2687506
closesodoo/odoo#98807
X-original-commit: 76704f47db46ac7e71a894f620d8061a3eb594a7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2961782
closesodoo/odoo#98798
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Properly position the field first_contract_date by using a more explicit
xpath, as the previously used field was added as invisible in odoo/odoo#95729.
closesodoo/odoo#98777
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the message
id is more than enough and available. This PR replaces follower subtype
local id data attribute by its subtype id.
task-2959366
closesodoo/odoo#98776
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
With the current implementation of the kanban dropdowns, clicking on a
element doesn't drop the dropdown.
Often it's not a problem as the clicked element initiates a new action.
However, on some occasions (like with a color picker), we want it to
close.
Waiting for a kanban card refactoring, we need to find a bit of a hack:
we wrap the content comming from the arch inside a small component that
only listen for clicks and close the parent dropdown.
closesodoo/odoo#98773
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Skip test on database manager rendered page when option
--no-database-list is used
closesodoo/odoo#98771
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
In Bootstrap 5 the `.col-X` classes don't have position relative anymore
and the button use position absolute (relative to its parent) to
position themselves.
> Columns no longer have position: relative applied, so you may have to
> add .position-relative to some elements to restore that behavior.
Ref:
https://getbootstrap.com/docs/5.1/migration/#grid-updates
Note: we have set the position relative in CSS to avoid doing a
migration script.
closesodoo/odoo#98768
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
When a websocket is disconnected, its subscription is removed.
Each channel leads to a set of subscribed websockets. When no
more sockets are listening to a channel, this channel should be
pop from this mapping or the map will keep growing.
closesodoo/odoo#98766
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The websocket client library is used during tests but is not in
requirements.txt. Therefore, imports are usually wrap into a try/except.
An import present in `websocket_rate_limiting` is not wrapped leading to
errors for those who have not the library installed. This PR fixes this
issue by wrapping this import in a try/except block.
closesodoo/odoo#98763
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Previously, the colspan of empty lines in list view did not account for
the fact that the column with the delete action is not always present,
resulting in incorrect colspan on empty lines when it is not.
This commit fixes that by accounting for it, and also fixes the size of
the header of that column, which is supposed to be fixed at 32px but
wasn't in some circumstances.
closesodoo/odoo#98711
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Previously, when a label in a form arch had an empty string attribute,
we would not render it at all as it seemed useless. In practice, some
existing form arch rely on empty labels being rendered for layout
reasons, and the corresponding views are now broken.
This commit fixes that by instead rendering an empty label, just as
legacy views used to.
Part-of: odoo/odoo#98711