When inserting a format with a collapsed selection, we need to insert a
zero-width space. It should not be saved so we need to isolate it and
put the "oe-zws-empty-inline" attribute on its parent so it gets cleaned
up by the sanitizer.
X-original-commit: 4ce274ba39cd8046b9ef4e0b99df66913375f993
Part-of: odoo/odoo#86930
Take `<p>a<b>bcde</b>f` and select the whole paragraph. If you click the
"bold" button, you would expect the whole paragraph to become bold. Only
if you only select "bcde" do you expect to unbold it. This is the
behavior of other editors. Odoo-editor so far was unbolding as long as a
part of the selection was bold.
The same applies to other formats.
Currently the format buttons are active when the closest start container
is that format but it should be active when pressing it would undo the
format, ie when the whole selection is that format. This harmonizes it
with the browser defaults.
task-2754127
X-original-commit: 69c5db26f81ace1a9a032b2ef7f488c997be00ad
Part-of: odoo/odoo#86930
When a background color is applied on an ancestor, while it's visibly
there, `getComputedStyle` doesn't know. Because it did depend on it,
the toolbar showed the wrong color in these cases.
Eg: `<span style="background-color: red;"><b>a[]bc</b></span>` was
showing no background color.
task-2778416
X-original-commit: a125933b34500d51183bc5eb02a531fb3b293de5
Part-of: odoo/odoo#86930
The link button was toggling its active state on every update of the
toolbar because we weren't passing the toggle function a boolean. and
if the element we were passing it was `undefined`, it triggered the
default behavior which is to just toggle. Instead we want it to be false
if the element is `undefined`.
X-original-commit: 7aecd36a169033a89defeb00ba0ae53cd64cdcd5
Part-of: odoo/odoo#86930
Underline and strikeThrough styles are special beasts in that they both
are applied to the `text-decoration-line` property. Unlike `font-weight`
or `color`, They behave like a border: setting
`text-decoration-line: none` to an element won't undo the value of the
parent and therefore the text will still show the decoration applied to
its parent. Similarly, nested decorations will apply over each other:
a text node whose parent has an underline decoration and whose
grandparent has a line-through decoration will be both underlined _and_
struck through.
Consequently, we can't treat these styles the same way we treat bold,
italic and colors:
1. To undo the style, we have to split the text from its styled ancestor
2. To apply eg underline to a struck through text, we have to insert a
new span.
task-2778416
X-original-commit: 93102a7dcb3e2c1a5803ab99f2f924b0b24e44c2
Part-of: odoo/odoo#86930
Consider the following situation: `<p>a[]b<span><zws></span>c</p>`,
where `<zws>` is a zero-width space and `[]` is the collapsed selection.
On pressing the `ArrowRight` key, we want to enter the `<span>` so we
don't press once to be after the "b" then once again to be before the
`<zws>`. The cases with a non-collapsed selection, and with the left
arrow are analogous. This is what this commit allows us to handle.
X-original-commit: 8e1d5ff3f3bdef8ca2f0eb069c62140260aad3f6
Part-of: odoo/odoo#86930
When the selection is collapsed it was impossible to set a format (bold,
italic, underline, strikethrough), a font-size or a color. This makes it
possible by inserting and selecting a zero-width space first, then
placing the caret to its left when we're done.
task-2778416
X-original-commit: b4eb0fe69bce5ca18d8450cd7118740f1d31f780
Part-of: odoo/odoo#86930
The bold format is overridden to use inline style on a <span> rather
than a <b>. The other formats (italic, underline, strikethrough)
continued to use the default browser behavior. This harmonizes them.
X-original-commit: ce59bbd1c13d7fd4cc6971b89cc95386d95fcd75
Part-of: odoo/odoo#86930
When pressing the italic or underline buttons, we pass through a command
in the editor. Their corresponding keyboard shortcuts however were not
intercepted by the editor and were therefore triggering the default
browser behavior. As a result we had different behaviors when using the
buttons and the shortcuts.
X-original-commit: 2e3c3b3a15fa6ff4fa209fc7dbac10864f8898a2
Part-of: odoo/odoo#86930
Newly created taxes were missing the correct type_tax_use and
price_include values, thus making them not working properly.
closesodoo/odoo#86883
X-original-commit: 161208315c2bb6e49fae243ead680710c040b872
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Mock server's mail channel write method is incorrect. It assumes
the id of the channel will always be 20 while it could be anything.
closesodoo/odoo#86860
X-original-commit: 96e732f6bbc7622d50c3a969f5c2bb44c85c2b48
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The res.fake model has a partner_ids fields which
is a many2one but is used as a one2many.
closesodoo/odoo#86849
X-original-commit: 02b34c6b252c6a1d5a474c6de4e88f714a384286
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to reproduce:
- create a contact with a very long name
- create a quotation
- in customer, type the first letter of the very long customer's name
- try to use the horizontal scroll bar
Issue:
close window on horizontal scroll
Solution:
Discriminate an horizontal scroll from a vertical scroll
A test has been added as well as the triggerScroll utility function
to allow proper tests when scrolling on elements
opw-2777443
closesodoo/odoo#86744
X-original-commit: e0b26496196bd4ee39fa06e1a3274982d2c7fb12
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Iucapad <luvi@odoo.com>
Add the possibility for portal users to manage API keys
in the frontend portal interface.
- Allow for portal users to manage their API keys if the system parameter
`portal.allow_api_keys` is set.
A settting in `res.config.settings` is added in order
to enable or disable the feature (to add/remove the system parameter)
through a compute field,
to avoid adding a new database column in standard
(as this revision targets stable 15.0).
The setting appear only in debug mode.
- Display the API keys in the portal in debug mode only
(as in the back-end for regular users, in their profile)
- The flow in the frontend is a mimic of the flow from the backend,
the wording and the look and feel is from the back-end.
closesodoo/odoo#86915
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Models can be defined by an SQL table, an SQL view or an SQL query (with
attribute _table_query). Counting records makes little sense when the
model does not correspond to a table, and actually fails when it is
defined by an SQL query.
We fix the compute method by counting records only for models where
_auto=True.
closesodoo/odoo#86913
X-original-commit: 956a0a1cc22f3f35fc128e32cb267e2baa793fb9
Signed-off-by: Raphael Collet <rco@odoo.com>
Correction that enables the display of the "unpublished" red label next to the
track name that are not published for the user of the group event manager only.
Task-2692907
closesodoo/odoo#86907
X-original-commit: 4d5f07dc5b393f15dc7c82e8af7da2cfeaf7720c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
unless there is another template to apply by default
closesodoo/odoo#86899
Task-id: 2798588
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
website_slides was relying on a model that belongs to a module
it does not depend on. This makes the single module builds fail.
Moreover, it appears this model was not even used during tests.
closesodoo/odoo#86876
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Since [1] illustration shapes are only obtained from their slug. Before
they were obtained from their URL.
After this commit the old behavior is restored as a fallback in case the
illustration shape cannot be found from its slug.
This is needed to allow importing shapes into the system from data
files.
[1]: https://github.com/odoo/odoo/commit/bde8abcfeb57c74438943e44215a7c8cb822329f
task-2793073
closesodoo/odoo#86858
X-original-commit: 91f2a989ddd7961f92a377b1bf74cc741dcbd3d0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When creating the results of a writeoff button for the manual reconciliation widget, debit and credit are actually inverted with regards to what will actually get created (final inversion is then done here to bring them back to the right sign: https://github.com/odoo/enterprise/blob/15.0/account_accountant/models/reconciliation_widget.py#L986). Because of that, the conditions defining whether or not the compute_all should compute refund repartition need to be inverted as well.
Note that it wasn't the case for bank reconciliation widget, for which the sign was directly right.
Before that, compute_tax_tag_invert computed a different value for the tax_tag_invert field on base and tax line (as the tax line uses the repartition type of tax_repartition_line_id, and the base line depends on debit/credit and the tax type). Hence, the tax_tag_invert values between those two lines where inconsistent, and the tax report was wrong (since we did * -1 on one of them, but not the other).
OPW 2769586
closesodoo/odoo#86870
X-original-commit: fdf448ef226ecf27685675ea4a49a4501d4f9263
Signed-off-by: Laurent Smet <las@odoo.com>
Expected behavior : The pricelist must be the one chosen by the customer on the website.
Current behavior : The price list is reset when the address is edited
Steps to reproduce the error :
First of all, you need to setup 2 pricelists on the website:
~ The first in dollars
~ The second in euros
~ Removes the group of countries from both
1. Create an order with the second price list (EURO)
2. Set your address
3. Edit your address
4. The pricelist will be changed to dollars
When you set the address for the first time, It redirects to /shop/confirm_order which
executes sale_get_order(update_pricelist=True) to correct the price list.
But when you edit the address sale_get_order(update_pricelist=True) is not executed
closesodoo/odoo#83061closesodoo/odoo#86764
X-original-commit: e5a76880320ce0606e6a0fc2a6ba776f79ce126e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Deleting an orphan translation is mostly impossible, since it requires
'write' access on the corresponding records, and checking access rights
fails because the records no longer exist!
Simply enable operations on orphan translations by ignoring the
corresponding records that do not exist. And make sure that the patch
does not allow to create orphan translations.
closesodoo/odoo#86869
X-original-commit: 454aa2587dcda2582ae58650019669ff0e8baa2c
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Martin Trigaux <mat@odoo.com>
Step to reproduce:
- Create leave type approved by the employee manager (and no limit
allocation)
- Set User A with user B as his manager
- Set User C as a time off Officer
- As user A request leaves of the before-mentionned type
- As user C, try to approve A's leave request
Current behaviour:
- Leave is accepted
Since V15, the groups have change and `is_officer` no longer
represent time_off all approver but time_off officer.
All approver are now timeoff Administrator and so the right
of time off officer should be limited.
Behaviour after PR:
- Error is shown to the current user explaining that he need to
be the current employee manager.
opw-2753845
closesodoo/odoo#86867
X-original-commit: e34e466970cab5a3774c24ac6380d0691cc773d2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When changing the structure of a kit, it lead to undesirable behaviors
on Odoo
Issue 01:
1. Create 3 products P_kit, P_compo01, P_compo02
- Type: Storable
- Category: PC
2. Create a bill of materials:
- Product: P_kit
- Type: Kit
- Components:
- 1 x P_compo01
3. Create a purchase order PO with 2 x P_kit
4. Confirm PO and process the receipt
5. Edit the bill of materials of P_kit:
- Add 1 x P_compo02 in components
6. Return 1 x P_compo01
7. Go back to the PO
Error: The received quantity is 0 while it should be 1.0
When processing the return, the received quantity is recomputed, which
lead to:
https://github.com/odoo/odoo/blob/59fcb31f5a0b8136dae26b70ca0087f9b5cf3d24/addons/purchase_mrp/models/purchase_mrp.py#L29
However, since in the mean time the user added a new line in the BoM,
`_compute_kit_quantities` doesn't find any associated SM
(`bom_line_moves` is empty in [3]) and thus returns 0.
Issue 02:
(Need account_accountant. Use demo data)
1. Create a product category PC:
- Costing Method: AVCO
- Inventory Valuation: Automated
- Set up the Price Difference Account
2. Create 3 products P_kit, P_compo01, P_compo02
- Type: Storable
- Category: PC
3. Create a bill of materials:
- Product: P_kit
- Type: Kit
- Components:
- 1 x P_compo01
4. Create a purchase order PO with 1 x P_kit
5. Confirm PO and process the receipt
6. Edit the bill of materials of P_kit:
- Add 1 x P_compo02 in components
7. Create and Post the bill
Error: an Odoo Error is raised "ZeroDivisionError: float division by
zero"
While confirming the bill, some anglo saxo lines are generated. To do
so, the valuation of the kit is computed: [1]. In the above case, it
will lead to [2]. However, since in the mean time the user added a new
line in the BoM, `_compute_kit_quantities` doesn't find any associated
SM (`bom_line_moves` is empty in [3]) and thus returns 0. Back to [1],
the quantity is used to divide the total price -> it will raise an error
if this quantity is zero
Suggestion:
Such situations should not happen: once a product is used at least once,
it should not become a kit nor have a new structure (if it was already a
kit). Otherwise, `_compute_kit_quantities` will not correctly work since
it is not possible to take the BoM changes into consideration.
[1]
https://github.com/odoo/odoo/blob/abfe37fcea5b20f77799d9331d4d011530880669/addons/purchase_stock/models/account_invoice.py#L72-L74
[2]
https://github.com/odoo/odoo/blob/75191404788ab83645ee35b779991ea6fcdfa406/addons/purchase_mrp/models/stock_move.py#L19
[3]
https://github.com/odoo/odoo/blob/7d1af314320547ab5e37c1d97cad22992c98565b/addons/mrp/models/stock_move.py#L275-L294
OPW-2780855
closesodoo/odoo#86821
X-original-commit: 33fa43f795798276fa9d29dd0810289cbb1a2a9c
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Before this commit
The style for `li.oe-nested` was loaded only when the editor loaded.
The problem is that the style needs to be visible even when the editor
has never been loaded.
After this commit
The style for `li.oe-nested` is always loaded in the backend and in
the frontend.
Task-2793528
closesodoo/odoo#86817
X-original-commit: 6c26e24c3d52410c0a3a06ee9a9d0aad6858a438
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Context
-------
Web design specific require a lot of work and need maintenance.
So far the style files were not taken into account despite the
amount of maintenance they require.
With this commit they are going to be counted,
knowing they still can be excluded in the manifest.
Imported module allow to deploy frontend assets: stylesheet,
javascript, xml template and Qweb view that require
as well some maintenance. They are going to be counted
Implementation
--------------
- Add method to parse css and scss file
- Include .scss and .css file in the count
- Add external_id to attachment that store
frontend asset of imported module
- Find all attachment with .js, .css, .scss, .xml
from imported module
- Find qweb view from imported module
- cound the content of the attachment and the qweb view
closesodoo/odoo#86816
X-original-commit: d2e0b48271dbd8cd7bbdbc5c2c1649c55c51417b
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
Since [1] non-image documents uploaded in web editor were stored as
received in base64 without being decoded.
This led to downloading them as they were stored in base64.
After this commit uploaded documents are base64-decoded before being
stored.
Steps to reproduce:
- edit a web page
- drop a "Text - Image" snippet
- replace the image
- upload a document (PDF, TXT...)
- save page
- download document
=> received document was base64-encoded
[1]: https://github.com/odoo/odoo/commit/6b8752604898bf2b583b7f5334e35f6a1583595e
task-2782269
closesodoo/odoo#86812
X-original-commit: b0218b8ff50c7cea2a018d20a62e63510bfdd01e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Make the channel_type required in UI and add SQL constraint for the database.
task-2774970
closesodoo/odoo#85146
Related: odoo/upgrade#3273
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>