Commit Graph
160552 Commits
Author SHA1 Message Date
Bastien Fafchamps (bafa) e4e10337d4 [MOV] web: Moved CodeEditor component from web_studio to web
This component was created as an easy way to add a code editing field
without needing a record (unlike the AceField component). It also
completely abstracts the use of the Ace Editor library.

The CodeEditor has been moved to web core as it was needed in other
places.

The name "CodeEditor" was purposely chosen to clearly state what the
component is used for and abstract the use of Ace.

Part-of: odoo/odoo#117782
2023-04-25 12:57:44 +02:00
Victor Piryns (pivi) 5962a1516f [FIX] sale_project: show inv.smart btn with draft inv in project update
Current behaviour:
In the project update section, if the project has only draft
invoices linked to the analytic account of the project, the invoices
smart button isn't present. But once we have at least 1 posted
invoice, the button is shown, and when triggering the action, we see
both the posted invoice and all the draft invoices that were not
shown previously.

Expected behaviour:
The button should be visible, even if the only invoices linked to
the analytic account of the project are only in draft.

Steps to reproduce:
- Install Project, Sales, Accounting
- Activate Analytic Accounting in the Settings
- Create a Project and make sure it has an analytic account linked to it
- Create a new invoice in draft, make sure on the line you have set
  the analytic account of the project we just created. Save.
- Go to the project update page, there is no smart button that will
  go to the invoice we just created.

Reason for the problem:
The Invoices smart button is shown only when the `invoice_count` is > 0.
`invoice_count` is a related field to the same field name of the
analytic account, which is a compute. In that compute we explicitly
only take invoices that are posted, since in the context of an
analytic account, it only makes sense to take actually posted
invoices, since those are real revenues. So the button is shown only
when we have at least 1 posted invoice. The action itself is just
fetching all the `in_invoice, out_refund` invoices that are linked to
this analytic account.

Fix:
Transform the `invoice_count` in `sale_project` module from a
related to a regular compute and do a query with the same heuristics
for the action of the invoice smart button.

Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- master

opw-3227421

closes odoo/odoo#119578

X-original-commit: 1b45e22530cb07ca437d2fd53bda3af2c918c223
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-25 09:38:12 +02:00
flvr-odoo 931dd59aa6 [FIX] sale_quotation_builder: same field description as template
This commit put the same field description between 'sale.order.template.line'
and "sale.order.line"

closes odoo/odoo#119576

X-original-commit: 811cf78ee1e63a7c41efe578fb64ee2deeca1dde
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-04-25 09:38:10 +02:00
Xavier ALT 781934262f [FIX] sale_management: confirmation email should be visible in chatter
With the refactoring of the mail API, use the new
`message_post_with_source()` to ensure the message content is visible
in the chatter

To reproduce:
- Create a quotation template with a confirmation email
- Create and confirm a sale order using that quotation template

=> We expect that confirmation email (content) to be visible in the
chatter, currently the email (mail.mail) is ok but the message
(mail.message) has no body which make it not/partially visible in the
chatter.

closes odoo/odoo#119566

X-original-commit: 6b3d74cde697ea655d5101d9ea426dc814ce2fa1
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-04-25 09:38:05 +02:00
luvi 22cc9660ed [FIX] web: fix SelectMenu object shallowEqual
With commit (1), the clear button is only displayed when a selected
value is found from the available choices. But since we used
shallowEqual to find the corresponding choice, we couldn't use objects
containing objects in its values, since a simple comparison was made
in the utility function. This was a wrong usage of the SelectMenu and
we don't want to support objects and arrays as values. The value
attribute should only be a string, and it's the parent responsability
to handle any object related to this string.

The test using an object and an array as values has been removed since
it had no purpose after the removal of this partial and wrong support.

With this fix, an assertion for the presence of the clear button has
been added instead for the import action.

(1): d760b81271

closes odoo/odoo#119298

Related: odoo/enterprise#40177
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 09:38:00 +02:00
Géry Debongnie 41ae9fe011 [IMP] web: update owl from 2.1.1 to 2.1.2
This release only contains a bug fix:

[FIX] t-out: does not crash when outputting null

See https://github.com/odoo/owl/releases/tag/v2.1.2 for more details.

closes odoo/odoo#119582

X-original-commit: 363f946b13c268a280a03b57ad9ba94f60feaaa5
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 08:35:47 +02:00
Aurélien Warnon cbdc1f8bcb [FIX] web: ensure bound function is not undefined for "checkDefinitionWriteAccess"
This commit fixes the property field tag components and sub-components by
ensuring that the ".bind" function of the component always receives a function.

As the "checkDefinitionWriteAccess" prop is optional, it could crash because
OWL would try to call ".bind" on an undefined function.

The new code will pass an empty function instead as a fallback.
(When it's not passed, it's never called, as it is in a display context and we
do not create tags, e.g: when showing the tags in a kanban view).

Task-3280847

closes odoo/odoo#119565

X-original-commit: 7d52600263bfd911156a2d94041fc522e2baff8a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-25 08:35:45 +02:00
Lucas Lefèvre 352c28b995 [FIX] spreadsheet: evaluate new ODOO.LIST functions
Steps to reproduce:

- Open any listview (e.g Sales order listview)
- select records from the listview, go to Favorites, and click on 'Insert list in spreadsheet' option
- Once the spreadsheet is created, Reload your browser.

Current behavior:
- Spreadsheet goes to an infinite loading.

opw-3284058

closes odoo/odoo#119561

X-original-commit: 6993d3e36d2f2540100e1bd248b629cc9e191659
Related: odoo/enterprise#40234
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-04-25 08:35:42 +02:00
Maximilien (malb) e54e74db2c [FIX] account: filter on account root
Before this PR, the filter on account root was present 2 times in the journal
items views. By removing one of the two, the problem is solved.

opw-3275279

closes odoo/odoo#119544

X-original-commit: bffa837a3b11144a53300e93249767ce4e9374d2
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-04-25 08:35:34 +02:00
Thomas Lefebvre (thle) 3b51de1861 [FIX] hr_holidays: remove employee requests must remove validation type
Steps to reproduce:
- create a time off type;
- select 'Extra Days Requests Allowed' for 'Employee Requests';
- select 'Approved by Time Off Officer' for Approval;
- choose a Responsible Time Off Officer;
- change the select for 'Employee Requests' and select 'Not Allowed';
- create an allocation for an employee with this type.

Issue:
The allocation is blocked at step 'TO APPROVE'.

Cause:
Even if we choose `no` for `employee_requests`,
the `allocation_validation_type` always contains `officer`.

Solution:
We have to test the `employee_requests` field during the
validation action

opw-3264758

closes odoo/odoo#119542

X-original-commit: a270267c34d42bba79190422143673f585e554d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-04-25 08:35:32 +02:00
Alexandre Kühn 4ee10c2814 [FIX] bus, im_livechat: lazy start bus worker
Before this commit, the bus service was starting worker at page
load, regardless on whether the user interacts with chat features.

This commit starts bus worker only when it's really useful, e.g.
when adding a new channel to subscribe. Functionally, on livechat,
the worker does not start before the livechat is open.

Task-3266973

closes odoo/odoo#119528

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-04-25 07:37:56 +02:00
Florent de Labarre ba785f0a2e [FIX] website_sale: show correctly the acquirer name
Like here https://github.com/odoo/odoo/blob/14.0/addons/payment/views/payment_templates.xml#L69, if the acquirer have display_as, it is more logical to shpw everywhere this field.

closes odoo/odoo#119526

X-original-commit: 2b80e84d29346b7d672e42ffb1dd7a3804388f04
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-04-25 07:37:51 +02:00
Andro Gvivradze ac9af81802 [FIX] mail: remove unnecessary modal
this commit removes unnecessary modal that does not let users create
a new users from apps like crm, sale, etc. Now instead of giving requests
that lack email redirectWarning, we open user creation form where user must
set email up.
Reason behind this change is the fact that login is required at the model level,
so the manual checks for this value is not necessary anymore.

task-3262468

closes odoo/odoo#119508

X-original-commit: 7796e8ca971167a96b23baa4b57056c2007ea8b4
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-25 07:37:49 +02:00
dhba-odoo 508d4d75a1 [FIX] web_editor: shift+enter on styled elements.
Before this commit:

After selecting the text of shift+enter which is styled and pressing any key
the new hideous child gets born.

After this commit:

Now, The new input will replace the selected text.

Task-3209969

closes odoo/odoo#119506

X-original-commit: f15d5ad27c6b764f54904f6ea8f6a714974b7bd0
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-25 06:39:52 +02:00
Pierre Masereel 44f5881511 [FIX] product: give correct currency when computing based pricelist
When your pricelist item price is based on an other prcicelist in
another currency, the wrong currency is given to the function
_get_product_price. we sould give the currency of the base_pricelist
instead of the target one.

Here is a example:
We have a priclist in INR based on a pricelist in USD. And the company
currency is euro.

When we go for the first time in '_compute_base_price', where we'll call
_get_product_price to get the price from the base pricelist (the $ one)

We get as src_currency the USD and target the INR. Since we are calling
_get_product_price with INR as currency, when _get_product_price will
call _compute_base_price, we'll get EUR as src_currency and INR as
target.

This will lead to apply on the EU price (the one on the product) the
rate of EUR->INR then apply over it USD -> INR. Instead of EUR -> USD
and then USD -> INR

closes odoo/odoo#119505

X-original-commit: 8ace9942368688dc1183133f451ea788a03e0f14
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-04-25 06:39:49 +02:00
Guillaume (guva) ac06c5f974 [FIX] l10n_es: fix tags on IVA 0%
Some tags were not correct on taxes
IVA 0%.

closes odoo/odoo#119504

X-original-commit: 79900c1e8bd798f345c141f4edea83c399691019
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-04-25 06:39:47 +02:00
Florent de Labarreandvfe-odoo c7f4f907f8 [FIX] website_sale: redirection to shop if no transaction doesn't work
In V14 this case is managed : https://github.com/odoo/odoo/blob/14.0/addons/website_sale/controllers/main.py#L1075

closes odoo/odoo#119503

X-original-commit: 01fe517010ff33d9e5665bd9633d0365b2c3e6d5
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: vfe-odoo <Feyensv@users.noreply.github.com>
2023-04-25 06:39:44 +02:00
Louis (loco) d5f86d4995 [FIX] website: prevent edit menu tour to fail sometimes
The goal of this commit is to fix the race condition introduced by
[this commit]. Here were the problematic steps:
- Open the mega menu.
- When then mega menu is opened, scroll up.
- Open the mega menu after scroll.
Before this commit, what could happened was that the mega menu did not
have enough time to be closed after the scroll. Clicking on it would
then actually close it rather than open it as wanted. This commit adds
a step to ensure that the mega menu is closed before open it.

[this commit]: https://github.com/odoo/odoo/commit/9b1de9e28697edbb6e1fa88665294f983f60e37f

runbot-20660

closes odoo/odoo#119438

X-original-commit: abd0038de73a057eb9c34dc8d316b67d96fac409
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-04-25 05:06:51 +02:00
Nshimiyimana Séna b65e7a4a10 [FIX] l10n_mx: fix refund column in DIOT report
# Steps to reproduce
- install l10n_mx_reports
- switch to a mexican company
- create a Vendor Bill, confirm it and register a payment for it
- create a Credit Note for that bill, confirm it and register a payment
  too
- go to the DIOT report (called `Transactions with third parties
  [ DIOT ]` in the menu )

The amount in the column "Refunds" should be the tax amount, and not the
base amount.

opw-3107102

Enterprise PR: odoo/enterprise#39628

closes odoo/odoo#118887

X-original-commit: 8c9cde34ac1fb74a42997b0a1d847ae1c9bb1312
Related: odoo/enterprise#39929
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2023-04-25 02:42:05 +02:00
Chenyun Yang de607a7296 [IMP] spreadsheet: add YTD in period filters
This commit adds YTD (year to date) filter to global period filters in
dashboard.

YTD filter gets the data from Jan 1st of the current year to
today (included). The unit of its offset is year.

task 3215947

closes odoo/odoo#118466

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-25 00:52:47 +02:00
Andrea Grazioso (agr-odoo) ff35bf57a7 [FIX] hr_expense: force company currency on company payment
Activate Multicurrency (USD company curr, EUR foreign currency, 1 EUR = 2 USD)
Have a Bank account in both currencies.
Create an expense of 100€, paid by company
Create report, set EUR journal as Bank Journal
Send To manager > Approve > Post Journal Entries
Open created payment

Issue:
- Payment amount is 200€
- In journal items, amount_currency and balance is 200$

Do the same with "Paid by employee".
Open the vendor bill

Issue:
- Invoice lines are expressed in the wrong currency

opw-3269009

closes odoo/odoo#119490

X-original-commit: 5eab4469d87a4d1ca80916ca5790691ffed68e38
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-04-24 23:49:12 +02:00
Pierre Paridans 7c94decb77 [FIX] web: non deterministic error in calendar view's mobile test
Missing `nextTick` for this `tap` (compared to other similar calls).

closes odoo/odoo#119479

X-original-commit: 7ff8c563edf1b32ecf8222399637c294b5f58e9d
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-04-24 23:49:07 +02:00
Jinjiu Liu aff24fd851 [FIX] web_editor, web: long text and translation button overlapped
Reproduction:
1. Install Project, Helpdesk, go to Project -> Configuration -> Activity
Types-> Upload Documents
2. Type a super long text in Default Note, the text overlaps the EN
button

Reproduction 2:
1. Go to Helpdesk -> configuration -> Helpdesk Teams -> Customer Care
2. Type a super long text in the description of the team, the text
overlaps the EN button

Fix: we set concrete padding to the right to make sure the translation
button is not overlapped. The fix needs to be done in enterprise too

Note: The reproduction 2 is another sub-issue found when fixing the
first one. Reproduction 1 is for the note field with oe-bordered-editor,
and reproduction 2 is for the note field without it.

Related Previous Commit:
Odoo:
https://github.com/odoo-dev/odoo/commit/26ecbc16bc8079c7bb08095f1b27b4f68ca0e947

Enterprise:
https://github.com/odoo-dev/enterprise/commit/e2ca9d5a113bc3adbe085057eff778b24abf5ddc

task-3047773

closes odoo/odoo#119475

X-original-commit: ac5e9681b47787aafeab1a1a3f748801821d66c8
Related: odoo/enterprise#40170
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-24 23:49:02 +02:00
Rémy Voet (ryv) fde7727dd8 [FIX] core: fix recursion error from unlink
On a model X, where there is a field related x_related
(related= 'y_id.y_translate') towards a translate field y_translate
on Model Y.
When you unlink at least 1001 records of X
(r1, r2, ... , r1000, r1001) (cr.MAX_IN + 1), you get a traceback
(`RecursionError: maximum recursion depth exceeded in comparison`).

The stack looks like:

File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3609, in unlink
  self.env.flush_all()
File "/home/odoo/Documents/dev/odoo/odoo/api.py", line 732, in flush_all
  self._recompute_all()
File "/home/odoo/Documents/dev/odoo/odoo/api.py", line 728, in _recompute_all
  self[field.model_name]._recompute_field(field)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6179, in _recompute_field
  field.recompute(records)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1348, in recompute
  self.compute_value(record)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1368, in compute_value
  records._compute_field_value(self)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 4209, in _compute_field_value
  fields.determine(field.compute, self)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 100, in determine
  return needle(records, *args)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in _compute_related
  values = [first(value[name]) for value in values]
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in <listcomp>
  values = [first(value[name]) for value in values]
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5874, in __getitem__
  return self._fields[key].__get__(self, type(self))
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 2771, in __get__
  return super().__get__(records, owner)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1186, in __get__
  recs._fetch_field(self)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3162, in _fetch_field
  self._read(fnames)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3214, in _read
  self.flush_recordset(translated_field_names)
...

-> Extra info:
translated_field_names = ['x_related']
`self = X(r1001, r1, r2, ..., r999)`

...
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5585, in flush_recordset
  self._recompute_recordset(fnames)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6162, in _recompute_recordset
  self._recompute_field(field, self._ids)
...

-> Long recursion starts here but first records to be recomputed will be r1, then r2, then r3, ...
But the maximum recursion depth error will be triggered earlier at the
end of the recursion, because the stack limit in Python is 1000
by default.
...
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6179, in _recompute_field
    field.recompute(records)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1348, in recompute
  self.compute_value(record)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1368, in compute_value
  records._compute_field_value(self)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 4209, in _compute_field_value
  fields.determine(field.compute, self)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 100, in determine
  return needle(records, *args)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in _compute_related
  values = [first(value[name]) for value in values]
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in <listcomp>
  values = [first(value[name]) for value in values]
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5874, in __getitem__
  return self._fields[key].__get__(self, type(self))
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 2771, in __get__
  return super().__get__(records, owner)
File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1186, in __get__
  recs._fetch_field(self)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3162, in _fetch_field
  self._read(fnames)
File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3214, in _read
  self.flush_recordset(translated_field_names)
...

------ Extra info:
translated_field_names = ['x_related']
`self = X(r1, r2, ... , r999)`
...

Since 9c3b9a4926, the `x_related` is
flagged to be recomputed at the end of the delete
loop of `unlink`, but it shouldn't be, because records are deleted now.
The problem is in these lines:
```python
with self.env.protecting(self._fields.values(), records):
    self.modified(self._fields, before=True)
```
The `records` are only a part of `self` (batch of 1000), so the
`protecting` call only protects the current batch and not `self`.
Then, the second batch (here with only one record), will flag to recompute
`x_related` of the first batch records. Then, later on, the `flush_all`
will generate the recursion error trying to resolve
these `to_recompute`.

To fix it, only move the modified call (+ protecting) before
the batch loop and executes it on `self`.

This issue shouldn't exist in master, because having a
related translate field triggers a warning (`Translated stored related
field (<field_name>) will not be computed correctly in all languages`).
Also `https://github.com/odoo/odoo/pull/100472` fixes the issue in
master, but it generates one SQL request by record, which isn't great.
Then in master, we should forward this commit (but test will be remove
because it generates the warning message).

closes odoo/odoo#119471

X-original-commit: 78450cae5900e267de439e4988b314aa644e76bd
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-04-24 23:48:55 +02:00
Rémy Voet (ryv) f25df506af [FIX] calendar: groupby on calendar.event triggers 'danger' notification
The `read_group` of `calendar.event` sends a danger notification when
the user groups by any field in the list view. It is because the
security reenforcement done in 2c0b3ab670168a155b3974d5a5b39aa1f1df3452
is too strict. It checks all `fields`, even the ones that are filtered
out by the `read_group` (`fields` without aggregation specification
nor `group_operator`).

closes odoo/odoo#119459

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-04-24 23:48:53 +02:00
Rémy Voet (ryv) 0c9e591965 [FIX] core: read_group same relational grouping
Before 916c9c46f58f27c68c5558a2a57fdca43a89fe89, we could
groupby several times on the same relational field with `read_group`
Example: `read_group(..., groupby=['product_id', 'product_id'], ...)`.
Now, it produces a traceback:

  File "/data/build/odoo/odoo/models.py", line 2583, in read_group
    self._read_group_format_result(rows_dict, lazy_groupby)
  File "/data/build/odoo/odoo/models.py", line 2396, in _read_group_format_result
    ids = [row[group].id for row in rows_dict if row[group]]
  File "/data/build/odoo/odoo/models.py", line 2396, in <listcomp>
    ids = [row[group].id for row in rows_dict if row[group]]
AttributeError: 'tuple' object has no attribute 'id'

It is because `_read_group_format_result` try to convert the record
into tuple (id, display_name) twice (one for each groupby).

Fix this issue introduced by the refactor of `_read_group`.

Part-of: odoo/odoo#119459
2023-04-24 23:48:53 +02:00
Rodolpho Lima 8e1bc74a67 [FIX] web_editor: prevent colorpicker close on click
Since Bootstrap was updagraded to 5.1.3, `ev.clickEvent` is no longer a
`JQuery.Event`. Therefore, the `originalEvent` property does not exist
anymore, and `__isColorpickerClick` can be accessed directly from
`ev.ClickEvent`.

By checking for the non-existent `originalEvent` property, the mechanism
that enables the colorpicker to remain open when clicked was being hindered.
Note that this handler's `ev` remains a `JQuery.Event`, and if a handler
returns `false`, it will prevent the default action and stop the event
propagating.

task-3274987

closes odoo/odoo#119429

X-original-commit: 6db128f7f859d7bb0f96b15b4e6a38955932f7cf
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-24 21:14:04 +02:00
Denis Ledoux e113d0dd6f [FIX] core, website_slides: incrementing public views
There was two issues regarding the slides public views counter

1. If the `public_views` is set to `NULL` in database,
`increment_fields_skiplock` wasn't properly incrementing the count.
Indeed, in SQL, doing NULL + 1 returns NULL
```sql
16.0=# SELECT NULL + 1;
 ?column?
----------

(1 row)
```
To have the result we expect, COALESCE must be used
```sql
16.0=# SELECT COALESCE(NULL, 0) + 1;
 ?column?
----------
        1
(1 row)
```

2. There is a mechanism, using the session,
supposed to prevent incrementing the public views
counter when a same user visits multiple times the same slide.
However, since 84d17e57e8
the visited slide was never actually added in the session,
because it was adding the slide id in a copy of the set
in session rather than adding in the set from the session.
Or, as this commit does, to re-assign the new set in the session.

closes odoo/odoo#119370

X-original-commit: fa5962d6f08979017842985004b3ec43416ee181
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-04-24 20:09:38 +02:00
Sébastien Theys 694d501a35 [REF] mail, im_livechat: move /mail/chat_post to im_livechat
It is only used there.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119306

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-24 18:25:59 +02:00
Soukéina Bojabza 9b11360c9b [FIX] website_sale: fix cart popover on hover for all header templates
Before this commit, when hovering the shopping cart in the "Boxed" and
"Centered Logo" header templates, the cart popover was not appearing.

This happened because the `websiteSaleCartLink` public widget was never
started with these templates and so, hovering the cart had no effect.
This is due to this widget selector which targeted a cart link located
inside an element with id `#top_menu`, which is not the case in these
templates where the cart link is located outside of it.

This commit fixes this widget selector, in order for the cart link to be
reachable in all header templates.

opw-3267114

closes odoo/odoo#119277

X-original-commit: ecefa679b224ce0e4a5a7e91ce28936321132d9c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-24 18:25:56 +02:00
Jeremy Kersten cb1388ed9e [ADD] website_cf_turnstile: add cloudflare turnstile support
This module allows to add secret key to add the turnstile captcha on
each snippet website_form.

Cloudflare Turnstile
--------------------
A friendly, free CAPTCHA replacement
Turnstile delivers frustration-free, CAPTCHA-free web experiences to
website visitors.
Turnstile stops abuse and confirms visitors are real without the data
privacy concerns or awful UX that CAPTCHAs thrust on users.

closes odoo/odoo#119246

X-original-commit: 4aca39a533e9d41f5f452f36a1ffc001f586b4f4
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-04-24 18:25:53 +02:00
Julien Carion (juca) 761d39658e [FIX] web: Format fields with rawAttrs in kanban
This commit makes sure that fields without widget
in kanban are properly formatted using the rawAttrs.

Steps to reproduce: create a float kanban field without
widget, set the digits to anything other than default and
see if the digits attrs are applied to the field.

opw-3263583

closes odoo/odoo#119161

X-original-commit: 1e635154654efcea59fe1f8bae679fb6bac41809
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-24 16:57:46 +02:00
Julien (jula) 0a267b3336 [FIX] tools: x_studio image field size
__Current behavior before PR:__
The size of an image field is guessed using the field name. For instance, an image field with `field_name = "XXXX_123"` is resized to 123 pixels when fetched.
This is can be an issue if a user creates an image field using studio in a form view.
If the user sets the label of the field as "Image 1", the technical name will become `x_studio_image_1`. Therefore, the image field will be resized to 1 pixel width.

__Description of the fix:__
Refactor the `image_guess_size_from_field_name` method to return `(0, 0)` when the field name starts with `x_studio_`.

__Steps to reproduce the issue:__
1. Open a form view (of any model)
2. Open studio
3. Add an image field with label "Image 1" (notice the technical name becomes in `x_studio_image_1` in debug mode)
4. Close studio
5. Upload an image on the created field
6. Save... The image is resized to 1 pixel width

opw-3242084
opw-3249632
opw-3253133

closes odoo/odoo#118960

X-original-commit: 3318f0e67da40983f52595aba933d8c8fd0f5cc5
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-24 16:57:44 +02:00
William Henrotin d9972ddec4 [FIX] mrp: clear finished moves
The finished move of a production order should be deleted if we change
the product to avoid having draft stock move detached from any business
documents

closes odoo/odoo#118957

Task: 3172098
X-original-commit: 4478560d7769a8a795a94aead875e02d1394dd71
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-04-24 16:57:41 +02:00
lejeune quentin 0fa36d664b [FIX] pos_stripe: Fix loading stripe ressource
Currently the POS does not load if a Stripe payment method is configured and there is no internet connection.
This commit fixes the loading of Stripe resources
to allow the opening of the POS and the display of related errors

task 3177045

closes odoo/odoo#118946

X-original-commit: 00b113721cf6a1de862794f06bd3ba293039ecd5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-04-24 16:57:38 +02:00
Rodolpho Lima afe5455116 [IMP] web_editor: rename colorpicker tabs
The first tab of the colorpicker can, depending on the context:
- display a selection of color combinations for the current **theme**
(when launched as a snippet option, for example, in the website builder);
or
- display a selection of **solid** colors (when lauched from the toolbar).

The commit changes the tab's name to conditionally reflect its content:
"Theme" or "Solid".

The second tab allows the user to pick a **custom** RGBA color. This commit
renames it to "Custom", replacing the inaccurate "Solid" name, now in
use for the first tab.

task-3274225

closes odoo/odoo#118852

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-24 16:57:35 +02:00
hupo-odoo f8f1e8e119 [ADD] l10n_tn : new localization package
Added the first package for the Tunisian accounting localization. This includes:
 - Chart of Accounts
 - Account groups
 - Taxes
 - Fiscal Positions
 - Tax groups
 - Tax report
 - Translation in French
 - A demo company

links to documents can be found in the task details

task-3093908

closes odoo/odoo#119376

X-original-commit: f8cd8eef62034ab2d05e975f03c79a6057f6287f
Related: odoo/enterprise#40139
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
2023-04-24 12:50:46 +02:00
InCeyN 23d7c12c5a [FIX] stock_account: location default account_id
Behaviour before commit:
If the location is a production or inventory location, you can set an
account_id for the valuation. Once this account_id is set, it will still
be there if you change the type of location to a view location for
example. This may
not be the right account_id given the new type of location.
Behaviour after commit:
Check if the location is of a specific type, if it's not inventory or
production, it will take the default valuation account id from the
product category. Otherwise it will take the one set on the location.
OPW-3269584

closes odoo/odoo#119344

X-original-commit: 3f0ea5d0fa5a96eb78e4637781698121434ee069
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-24 12:50:43 +02:00
William Henrotin 008f758536 [IMP] mrp: (de)activate workorder demo data
Some demo data bill of material have workorder operation. Trying to use
them without the workorder setting activated will give an error on some
fields not instantiated.

This commit activate/deactivate the operations depending on the
workorder setting.

opw - 3229621

closes odoo/odoo#119254

X-original-commit: aaba4eb4deb3f9e10fd611924c5a24680d633537
Related: odoo/enterprise#40092
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-24 10:20:20 +02:00
Renaud Thiry 1196d470eb [IMP] mail, crm: reword notification actions
Prior to this notification actions are shown as such:
MODEL RECORD_NAME won | lost | settings

After they will be shown as such:
MODEL won lost settings RECORD_NAME

with the action links colored to match the company color.

The aim is to streamline the layout of e-mails and make actions
clearer.

task-3067315

closes odoo/odoo#106307

Related: odoo/enterprise#34284
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-24 10:20:12 +02:00
Renaud Thiry 87b0189ff1 [IMP] mail: remove default logo
Many templates use the company logo that is set by default on
database creation. As that logo is clearly a placeholder and the user
isn't necesserely prompted to update it. It's possible for a user to
inadvertently start sending emails with "your logo" placeholders
plastered all over.

This removes the default logo of the company and removes it from
templates conditionally.

The logo isn't simply replaced with a transparent PNG as the templates
set a fixed height for the logo, which would look weird.

task-3067315

Part-of: odoo/odoo#106307
2023-04-24 10:20:12 +02:00
amdi-odoo 9ee0b9182e [FIX] sale_stock: fix picking policy field width
Fix the picking policy selection field width which
is currently too short and is consequently hiding
the selected text.

Task-3267526

closes odoo/odoo#119099

Forward-port-of: https://github.com/odoo/odoo/pull/118059
X-original-commit: c98e30fba6d4cd4fe67439caad4d83eb15f67b26
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-04-24 08:38:14 +02:00
amdi-odoo 30d29a48fb [FIX] web: fix selection widget caret overlap
When the text in the selection is long enough to
reach the selection caret, the caret is overlapping
the text making it unreadable.

Adding a gap between the end of the text and the caret
to prevent any text overlapping.

Task-3267526

Forward-port-of: https://github.com/odoo/odoo/pull/118059
X-original-commit: 717bba692d7167dbcd651299e84432dcecf13ab4
Part-of: odoo/odoo#119099
2023-04-24 08:38:14 +02:00
Valentin Chevalier 17fc488e08 [IMP] product,sale(_product_configurator): refactor in OWL
The product configurator dialog was still in legacy code as it was not
required for the migration of the views to OWL. Now that we're moving
forward with the removal of other parts of the legacy code, this dialog
had to be converted as well.

Some parts of the logic have now been rewritten in OWL, getting a better
share of the logic between the server and the client.

The product configurator in e-commerce still uses the old implementation
and will be refactored in another task.

task-3056806

closes odoo/odoo#106511

Related: odoo/enterprise#39525
Related: odoo/upgrade#4550
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-04-24 08:38:11 +02:00
Valentin Chevalier 7e42f381c3 [MOV] website_sale: move variants logic from sale to website_sale
Currently, `website_sale` uses the same logic as `sale` to show the
product variant configuration.

This commit aims to separate this logic and let each module handle its
own product variant configuration.

task-3056806

Part-of: odoo/odoo#106511
2023-04-24 08:38:11 +02:00
JF Aubert 204d4ebf5e [FIX] mrp_subcontracting_dropshipping: ease po's
Ease 'dropship' purchase orders for subcontractors.
At the moment, it is not possible to dropship a subcontractor
with a mix of products, some of which are part of a subcontracting BOM
and some of which are not.
This becomes possible, but it remains mandatory to choose between
- Dropship (for the 'customer' location)
- Dropship Subcontractor (for the 'subcontracting' location).
Due to the destination location, it is not possible to combine
the two streams in a single purchase order.

closes odoo/odoo#119404

Task: 3199595
X-original-commit: c7f49776c74303e277246a4b6302e8a87d6a7def
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Jean-François Aubert <ajf@odoo.com>
2023-04-24 07:33:22 +02:00
Thanh Dodeur 74af371bc9 [FIX] mail: prevents crash when trying to close the audioContext
Before this commit, since https://github.com/odoo/odoo/pull/119014,
the audio context could be closed when already.

Until the implementation of AudioContext.state*, we have to catch the
error.

This commit also removes the forwarding to the destination that was
not necessary.

`* https://webaudio.github.io/web-audio-api/#widl-AudioContext-state

closes odoo/odoo#119444

X-original-commit: 0d28d067d2b848701312deea419acc3fe68ab4c9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-23 00:51:12 +02:00
Bastien (bvdn) 68508f8bae [FIX] web: fix footer button alignement in listview dialog
The footer 'selected count' button in the plan gantt view (project) wasn't aligned,
It's the case for every dialogbox where you can select many records,
simply removed a forced bottom-margin on the container

Task-3254488

closes odoo/odoo#119424

X-original-commit: 0125a3e233eeb4cf11ec7fc0ef429dabfaada05c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-22 15:53:19 +02:00
william-andre 40967ac434 [FIX] account: computation of "Use in Tax Closing"
The computation of `use_in_tax_closing` was overlooked when refactoring[^1]
the CoA templates. Since it was using a `onchange` with an extra code in
`create` of the `account.tax.repartition.line.template`, it didn't work on
its own after the refactoring.

[^1]: 5125748616

closes odoo/odoo#119440

X-original-commit: e51ffcb01be3238338f23946b75f7e034032cf37
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-22 06:54:00 +02:00
hupo-odoo 04489abea9 [REV] account: journal task reminder
Revert the following commit : https://github.com/odoo/odoo/commit/66672cf7f63548638ad218d5cae44cde5868b318
The reason is that it is at the end not functionally desired. We do want to see the task reminder for tax return on journal dashboard no matter the date.

task : 3231957

closes odoo/odoo#119428

X-original-commit: f1f5c5025ac2c7132590065fe701e3117490680c
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-04-22 06:53:57 +02:00