Commit Graph
169243 Commits
Author SHA1 Message Date
roen-odoo de020a5ae8 [FIX] pos_online_payment: Add missing phone number to kwargs
Current behavior:
When you try to pay with razorpay, you got an error saying the phone
number was missing.

Steps to reproduce:
- Setup RazorPay
- Set a phone number on admin
- Go to the POS
- Add a product to the cart
- Click on the payment button
- Select razorpay
- Scan the QRCode with your phone (make sure you'r connected on the
  admin account)
- Try to finalize the payment

opw-3669600

closes odoo/odoo#152040

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-02-01 09:49:54 +00:00
Deependra Solanki d824587776 [FIX] web_editor: should select only selected node in destroyLinkTools
Before this commit:

`destroyLinkTools` function sets the selection to entire link. However, in
case where a website snippet had a structure like
```html
<a>
    <div>
        <i class=fa-xxx>​</i>
        <div>
            <h4>Text</h4>
            <font>Text</font>
        </div>
    </div>
</a>
```
selecting the complete link caused problem. The toolbar couldn't be
updated correctly, also one could not change the a tag of a single element
within the link.

After this commit:

`destroyLinkTools` selects the `anchorNode` and the `focusnode` of the
selection instead of entire link.

task-3245819

closes odoo/odoo#151752

X-original-commit: e88ffecc4bdb0480fc1d47af14558f28f72a665d
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-02-01 09:49:54 +00:00
Deependra Solanki 51e4ac9e09 [FIX] web_editor: properly restore cursor in setTag
Commit [1] introduces an approach to preserve the cursor in `setTag` when new
node is inserted. It used `setStart` at `firstLeaf` of `startContainer` and used
offset of the `startContainer` similarly for `endContainer` which is incorrect
and would throw traceback regarding no child at that offset.
This commit fix it by getting the correct startContainer and endContainer when
new node is created.

[1]: d04e32c

task-3245819

X-original-commit: d9095d277e4dbfa318ff6ddd2692dbb3c71e4775
Part-of: odoo/odoo#151752
2024-02-01 09:49:54 +00:00
Robin Lejeune (role) 38506df2a1 [FIX] web_editor: fix CTA button upgrade
After upgrading (specifically following this [upgrade PR]), when editing
an element, the editor may be tricked into considering that the page
isn't correct even though it is. It causes the "discard" dialog to open.

Steps to reproduce after the [upgrade PR]:
- Remove the CTA in 16.0 with the bin icon (on the button itself, or
from the edit panel, next to the "Block" section).
- Upgrade to 17.0.
- The button is back. Edit the header and click to hide it.
=> a dialog opens "Are you sure you want to discard your changes?".
- Click either "yes" or "cancel".
=> either way, nothing is discarded nor cancelled.

[upgrade PR]: https://github.com/odoo/upgrade/pull/5500

Related to opw-3644220

closes odoo/odoo#151291

Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-02-01 09:49:52 +00:00
asno-odoo 321cffafb7 [FIX] account: update repartition lines correctly
When repartition_lines are added to an already existing account_tax
record, on upgrade, the new repartition lines are inserted with just
tags, which results in the insertion of null value in document_type
column.
To reproduce:
1. Modify l10n_fr/__manifest__.py version to 2.0
2. Create an empty DB
3. Start ./odoo-bin -c ../.myodoorc -i l10n_fr with demo data
4. Stop the database (can dump it for convenience)
5. Start ./odoo-bin -c ../.myodoorc -u l10n_fr
6. Add a couple of repartition lines (invoice + refund) to an existing tax to odoo/addons/l10n_fr/data/template/account.tax-fr.csv
7. Modify l10n_fr/__manifest__.py version to 2.1
8. Start ./odoo-bin -c ../.myodoorc -u l10n_fr

closes odoo/odoo#149733

X-original-commit: 8dfdc6f9abe490f46d3df92bf056e334e1a02750
Signed-off-by: Aslam Noman (asno) <asno@odoo.com>
2024-02-01 09:49:51 +00:00
Raphael Collet b00d135599 [FIX] core: optimization of Cache.set() to avoid multiple record.id
The expression record.id relies on a Python descriptor that has some
overhead, which is small but not negligible when used in a low-level
method of the ORM.  We simply factor out this expression in order to
evaluate it once for the method.

closes odoo/odoo#149624

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-02-01 09:49:50 +00:00
Rémy Voet (ryv) 65a2c2ebc8 [FIX] core: new record shouldn't force fetching inverse x2many fields
In e0297bdac4, the creation of a new
record always patches the inverse fields of relational fields in order
to make the cache of those inverse fields consistent.

For instance, when creating a new record like

    user = model.new({'group_ids': [Command.link(group.id)]})

The inverse of field 'group_ids' on the new record having 'group' as
origin is patched so that its value includes record.  A side effect of
this mechanism is that it fetches group.user_ids in order to patch the
value of new_group.user_ids, where 'new_group' is the new record having
'group' as origin.

The side effect described above is problematic when that inverse field
has huge cardinality, like hundreds of thousands of records, and this
performance overhead is unacceptable when the inverse field is actually
not used at all.

We address this performance issue by patching the value of x2many fields
only when they are used.  If the value of the field is not in cache yet,
the patch is applied once a value is put in cache.  If the field is not
used, the patch is simply never applied.

Part-of: odoo/odoo#149624
2024-02-01 09:49:50 +00:00
Mélanie af1c406db0 [IMP] hr_leave : check if a list is empty before creation's call
To prevent no-wanted behaviour on empty list during creation, we will check it before the call creation

closes odoo/odoo#144394

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-02-01 09:49:49 +00:00
Mélanie d0363dd475 [FIX] hr_holidays : fix duplicate allocation for batch allocation
STEP TO REPRODUCE :
	1. create a time off type with alloation_validation_type == 'no'
	2. create a batch allocation (with company, department, employee tag or employee mode but with some employees)
	3. records will be duplicated
Expected behaviour : no duplication

task : 3615657

Part-of: odoo/odoo#144394
2024-02-01 09:49:49 +00:00
Luis González c183585c80 [FIX] web: add missing ARIA attributes to command palette
Since searches in the home screen are now handled by the command palette,
some ARIA attributes are required for assistive technologies to know
what is the currently-selected result. That because the actual focus is
always on the search box, while the actually-selected result is
highlighted by toggling classes, which makes not possible anymore to
know what is the selected result for e.g. screen reader users.

For more info, see original implementation on enterprise's home menu on
[1]. This commit is just re-applying such changes here.

[1] odoo/enterprise#14511

closes odoo/odoo#152147

X-original-commit: 9764e6f7fe39a10f3b04e1764110d8c274d0431a
Related: odoo/enterprise#55562
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-02-01 08:24:13 +00:00
Eteil Djoumatchoua(etdj) etdj@odoo.com 1cc0a9faf2 [FIX] account: send multiple records of the same model to the same recipient
Steps:
- Go to Invoicing, list view.
- Select two records with the same partner.
- Send receipt by mail.

Issue:
Just one mail is sent.

Reason:
``mailing_document_based`` parameter which is used to enable sending multiple records to the same recipient
is not passed in the context.

opw-3552562

closes odoo/odoo#151273

X-original-commit: b806ef9fbdbb149ab0df1b63902236982ca88233
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-02-01 08:24:11 +00:00
Sven Fuehr 544857ba26 [FIX] account: no "Draft" title on invoices that were posted before
Consider an invoice that was reset to draft.
When its is edited to be '/' (and the record is saved) an additional "Draft" title appears.
It should not appear.

After this commit the "Draft" title will not be shown on invoices
that were posted before.

task-3680398

closes odoo/odoo#152110

X-original-commit: d0876de81dc66cb6483598deb33bf6c81212ec89
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
2024-02-01 07:07:00 +00:00
Anh Thao Pham (pta) 96560c4db6 [FIX] website_sale: fix prices on Products snippet on branch website
Steps to reproduce:
- Create a branch for a company (e.g. Branch X)
- Go to "Website / Configuration / Websites"
- Create or configure a website on Branch X (e.g. Website X)
- Go to "Website / Configuration / Settings"
- Select Website X
- Set "Display Product Prices" to "Tax Included"
- Create a product for a price of $100 and a tax from parent company (e.g. 15%)
- Go Website X
- Edit Home page and add Products snippet

Issue:
On the Products snippet, the price of the product should be "Tax Included" ($115),
but it is not. The displayed price is $100.

Cause:
When computing the prices, taxes from parent companies are not taken into account.

This fix is a complement to https://github.com/odoo/odoo/pull/151223

opw-3660156

closes odoo/odoo#152105

X-original-commit: ba6cb4f16fdbfa121e52f3c17c70e9783e8c2ea5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-02-01 07:06:59 +00:00
vava-odoo 873a13ef62 [FIX] base_import_module: fix missing field name in non-debug mode
Before this commit, the website of the industry module ends with
`/False`. This is because the website of the module requires the name
of the module. It is therefore added in the _get_modules_from_apps
method.

closes odoo/odoo#152078

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-02-01 07:06:57 +00:00
Shaan Thakkar (THSH) ba3980e132 [FIX] web: resolve traceback when switching to mobile view
Steps to reproduce:
===================
1. Configuration > Projects
2. Open any project
3. Setting tab
4. Document field
5. Create and edit a new workspace.
6. Inspect mobile view
7. Save it or discard it -> traceback occurs

Technical Reason
================
The dialog values are prepared based on the desktop view, which results in the
scrollToOrigin function is not being prepared when the condition is not met.
Consequently, when the view is switched to mobile and inside the onWillDestroy,
the scrollToOrigin is called but it is not prepared so traceback occurs.

After this commit
=================
Now the function will be prepared even if we are not in the mobile view and
traceback will not occur.

Task-3573747

closes odoo/odoo#152074

X-original-commit: bc0a313f56347ea74eea1e5106cef8d86357c9ef
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-02-01 07:06:56 +00:00
Robin Lejeune (role) 1e94c7f0cd [FIX] google_recaptcha: update recaptcha score
The reCaptcha score was set by default on 0.5. According to [Google's
documentation], that score isn't valid by default. It should be one of
0.1, 0.3, 0.7, 0.9. To use other values you must first go through a
security review from reCaptcha.

[Google's documentation]: https://cloud.google.com/recaptcha-enterprise/docs/interpret-assessment-website#before_you_begin

task-3585213

closes odoo/odoo#152073

X-original-commit: 6f18069c71fc09fc624df03243bccedf0dbf96e5
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-02-01 07:06:56 +00:00
Rodolpho Lima 457686ceae [FIX] mass_mailing: duplicate call to saveModifiedImages
The 'saveModifiedImages' function is already called by the parent class'
(HtmlField) 'commitChanges', in which the replacement of the images' src
attribute and the removal of the 'o_modified_image_to_save' class are
done with the editor's observer deactivated.

Before this commit, calling this function before the call to
super.commitChanges resulted in converting the images within a history
step that was later reverted by the 'historyRevertCurrentStep()' call at
the end of the '_pendingCommitChanges' function.

Morover, the '$content' property is undefined.

closes odoo/odoo#152065

X-original-commit: 622ca94b958444ae2279f13871c6a05942fdaf0e
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
2024-02-01 07:06:55 +00:00
Rodolpho Lima 69dc6d845a [FIX] mass_mailing: multiple attachments for same image
Before this commit, base64-encoded images were converted to attachments
only for the body_html field, leaving the body_arch's content unchanged.
As a result, every time a record was updated, the body_html content,
which is generated from the body_arch's content, would have the same
base64-encoded images, which were converted again to new attachments.

Moreover:
- the created attachments were not linked to the mailing record (no
  res_model and res_id).
- the attachment name contained "cropped_image", even for images that
  were not a result of cropping.
- when the image conversion happened for a record in creation, the
  resulting attachment name was "cropped_image_mailing_False_0" (or any
  other number, the relevant part is "False", where the record's id was
  expected).
- the body_arch could take an excessively large amount of space in the
  database table, due to its base64-encoded images (see [1]).

This commit makes sure the body_arch has its images converted to
attachments as well, and also makes sure such attachments are reused
when replacing the image sources in the body_html, instead of creating
new ones.

Besides, the "cropped_image_mailing" in the attachment's name was
replaced by the more generic "image_mailing".

Lastly, when a record is being created, the conversion to
attachments now happens after the call to super().create, so that the
record's id is known when creating attachments.

task-3479586

[1]: https://github.com/odoo/odoo/pull/128452

X-original-commit: 9c5a56d2be9c1a480d526755327c79e2daa90a35
Part-of: odoo/odoo#152065
2024-02-01 07:06:55 +00:00
Martin Quinteros 3e41ca178e [IMP] payment_mercado_pago: add two states in mapping constant
Although the lack of these statuses does not block the flow of a
transaction, they create confusing records for the user.

 - Authorized: it is returned by Mercadopago when it authorizes
payments by bundle. It should behave as a pending payment as it's not
yet captured and could still be canceled by timeout.
 - Cancelled: It is returned by Mercadopago when a payment is not made
within the expected timeframe. This prevents odoo from leaving payment
transactions in draft that cannot be cancelled by the customer.

closes odoo/odoo#152064

X-original-commit: 44790e7f115610548b140c0d53f97bb11f973224
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2024-02-01 07:06:54 +00:00
Pedram (pebr) 179d91a0cb [FIX] pos_mrp: handle multiple order lines with kits
This commit fixes a ValueError that occurred when an order contained
two or more order lines with kits. The error was caused by the
'self.qty' expression, which failed when 'self' was a recordset.
The code has been updated to correctly handle multiple order lines
with kits.

opw-3708950

closes odoo/odoo#152053

X-original-commit: 668933002e2912f8df531b065f81777b2b491514
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-01 07:06:53 +00:00
Carlos Dauden 8b1cbeb71a [IMP] stock: Avoid unneeded write in _enable_show_reserved method
As long as the framework is not able to avoid rewriting values that are already set, we must add checks to avoid triggering multiple processes linked to that value assignment.

Example:
https://github.com/odoo/odoo/blob/66c11acdbedf8d1bcae6deb8ec54c5da5a3ae16d/addons/stock/models/product_strategy.py#L111
https://github.com/odoo/odoo/blob/11d81b2145e95c50481101a63d3ad1d244279af4/addons/stock/models/stock_move.py#L302-L341
https://github.com/odoo/odoo/blob/daea3d4e10b8fc2c4840fff30474a1203eff55c2/addons/sale_stock/models/sale_order.py#L402-L418

It may be unusual for a field to compute stored depending on a non-stored, but the reality is this.

closes odoo/odoo#152026

X-original-commit: 123212a5f5598d91f31869c49ac8d28aba1f698a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-02-01 07:06:52 +00:00
Lucas Lefèvre (lul) 7e6a02ac0f [FIX] spreadsheet: keep leading zeros of char fields
When a char field contains a value which represents a number (e.g. "00036"),
the value is inserted as a number in the formula instead of a string.
Because of this, the function value is not found.

actual:	​	=ODOO.PIVOT.HEADER(1,"x_studio_barcode",00003456799)
expected: 	​=ODOO.PIVOT.HEADER(1,"x_studio_barcode","00003456799")

closes odoo/odoo#152018

Opw: 3623662
Task: 3631998
X-original-commit: 9fedd9a5c3daacb71862864ede466d25420749bb
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-02-01 07:06:51 +00:00
Abderraouf Ghrissi (abgh) 537a96d1aa [FIX] project: task date_deadline not copied
Steps to reproduce:
- create a project and a task inside
- set date_deadline on the task
- copy the project
=> the copied task has date_deadline = False

Source:
- date_deadline copy property wasn't changed to True when the field
was merged with planned_date_end in 17.0

Fix:
- copy was removed as its default value is True

closes odoo/odoo#152006

X-original-commit: https://github.com/odoo/odoo/commit/56073896a69d9f68ce7e7938d9dec7ef094e19b3
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-02-01 07:06:50 +00:00
vlst-odoo cb0efa815d [IMP] point_of_sale: allow hiding images
In this commit we add the ability to toggle between showing and not
showing product and category images in the pos ui.

Because this change is done in stable, we store the user's selection in
`ir.config.parameter`.

In the forward port, this will be removed and the settings will be
stored in `pos.config`

Task 3704416

closes odoo/odoo#151823

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-01 07:06:48 +00:00
Aurelien MARIE (auma) 42a72f6a20 [PERF] mrp_subcontracting: Speed up confirmation of PO
Current behavior:
Confirming a Purchase Order with more than 50 lines takes
too much time to be processed. In the case of the client
they had PO with more than 200 lines which makes it
impossible for them to confirm them.

Step to reproduce:
- Install mrp and mrp_subcontracting
- Create PO with more than 50 order lines or more
- Try to confirm it
- Take a long time or timeout

Benchmark (made in 16):
| No. of PO lines | Before  | After  |
|-----------------|:-------:|:------:|
| 9               |  1s30   |  1s30  |
| 91              |  1min   |   16s  |
| 273             |  4min   |   50s  |
| 405             | 4min30s | 1min6s |

Fix:
Batch more actions and records to reduce the number of
queries generated by the ORM.

opw-3625892

closes odoo/odoo#149830

X-original-commit: 7d9d7917948df966ada2055dcfead0cabaaf0651
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-02-01 07:06:47 +00:00
Arthur Jochems (ajoc) 31f4e932c5 [FIX] stock(_account): don't count unpicked moves for analytics
As a result of the Quantitypocalypse (7dda6bb), move lines are being
created for MO components before they're actually consumed. This in turn
automatically creates analytics lines, debiting accounts for these
unconsumed parts. This commit globally prevents any move line that is
not yet picked (i.e. consumed/reserved) from being included in an
analytic entry.

Additionally, an edge case where setting a move's qty to 0 did not
trigger adjustments of dependent models was fixed.

Part-of: odoo#146114

Task-3621105

closes odoo/odoo#146114

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-02-01 07:06:46 +00:00
Arthur Jochems (ajoc) 43f296177e [IMP] {mrp,stock}_account: cross analytics support
A recent feature in accounting (odoo#139225) introduces cross analytics,
which allows submitting multiple accounts per line (one account per
plan). This is not done, as would be assumed, by changing the
`account_id` field from a Many2One to a Many2Many, but by adding fields
to `account.analytic.line` every time a new root analytic plan is
created.

This approach has certain advantages, but a particular disadvantage is
that it becomes harder to update existing lines. For MRP, updating
rather unlink-recreating lines is important for employee time tracking,
where the analytic line will be updated every time the time worked is
updated, and the employee's wage can change between updates. In this
edge case, the accumulated cost must remain calculated at the old wage,
and newer costs must accumulate at the new, actual wage.

Concurrent closing line edge case
================================
An analytic distribution assigns divides an expense into smaller
expenses for analytic accounting. Typically, every fractional expense is
credited to a different analytic account, and they total to 100% of the
original expense. With multiple analytic plans, dividing that expense
can happen different ways. For example, one analytic plan may track
expenses per department, while another keeps track of expenses per
region. This means that an analytic distribution may contain accounts
belonging to different plans, with every plan dividing the original
expense in different ways across its own accounts. For cross accounting,
fractional expenses can be assigned simultaneously (i.e. on one line) to
multiple accounts (up to one per analytic plan). In our example, this
would mean that this fraction was spent by a specific department in a
specific region.

For an analytic distribution to be accurate, we must ensure that for
every plan, the sum of all accounts come out to the total percentage
(usually 100%) that was distributed in the first place. Because
multiplying large numbers with small percentages can introduce rounding
errors, we need to correct for any discrepancies. With one account per
line, this is easy; when a line closes out one of the plans in an
analytic distribution, we assign the exact outstanding amount for that
plan to that line, ensuring that the sum across all accounts adds up to
the exact total percentage of the expense that was divided in the first
place. Since every plan closes out on a different line, we can apply
this correction every time and the amounts are always correct across the
entire analytic distribution.

The problem with cross analytics, and thus multiple accounts per line,
is that a line can now sometimes close out two different plans, with
slightly different outstanding amounts. This means we can no longer
guarantee that every plan in an analytic distribution sums out to the
original expense. Luckily, only certain analytic distributions are
vulnerable to this edge case: they must distribute across multiple
plans, and must have at least one line where not all participating plans
are credited. There exists no trivial way to fix this. The current
implementation follows the approach of the accounting module, which
takes no special precautions against this edge case.

Part-of: odoo#146114

Task-3621105

Part-of: odoo/odoo#146114
2024-02-01 07:06:46 +00:00
Antoine Boonen 4f2982f403 [REV] account: Fix test in account taxes
Revert of commit da251b757d

Problem
---------
In said commit, tests were failing due to
1. the new restrictions on tax
2. default creation of repartition lines.

However, updating the way chart_template._get_chart_template_data is
patched in those tests was not the way to go. Because of that, some
fixes due to migration error to 17.0 failed - PR #149733.

closes odoo/odoo#151189

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-31 20:40:42 +00:00
Arnold Moyaux c5175077ff [FIX] mrp: don't block base on start date but on BoM order
The `test_conflict_and_replan` was not properly setup and doesn't
show the real issue when plan workorders in wrong order and use the
replan action.

.workorder_ids return base on the _order of `mrp.workorder` that is the
'leave_id, date_start, id'. However in our case, when the dependency are
not active, we want to do them in the order define on the BoM. So we
sort them before by operation sequence before defining the
`blocked_by_workorder_ids`

closes odoo/odoo#143850

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-01-31 20:40:41 +00:00
Hoang Tien Dung 17a3306d8b [FIX] mrp: The start date of a manufacturing order is never set.
Issues
------
All manufacturing orders are not having a start date

This commit
-----------
- Fix not updating start date on manufacturing orders.

X-original-commit: 2e5da1130f4a7056f746a4cce6ba75bf699dbe62
Part-of: odoo/odoo#143850
2024-01-31 20:40:41 +00:00
Jairo Llopisandxmo-odoo 18b4902a19 [FIX] base: allow browsing form view of missing module
Before this patch, if you once had one module available and, later, remove it, you'd be getting an exception when browsing its form view and trying to get its icon image.

Now it gets the base module icon image, just like it should.

@moduon MT-1524

closes odoo/odoo#151870

X-original-commit: 4543f45e0066814d5722acfcac3c8bc8d09b8cb1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
2024-01-31 18:59:10 +00:00
Anh Thao Pham (pta) 5047377ff6 [FIX] l10n_fr: fix "Domestique - France" fiscal position
Issue:
This PR (https://github.com/odoo/odoo/pull/145412) wrongly removes
"vat_required" option from "Domestique - France" fiscal postion.

Solution:
Set "vat_required" option back.

opw-3617761

closes odoo/odoo#151844

X-original-commit: 44e53832f28be4bbc170ae0441e48636d2f437fb
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-01-31 18:59:08 +00:00
Xavier ALT 308c5b38e2 [FIX] sale_purchase: cancel order wizard warn about PO when there's none
To reproduce on runbot:

- edit the access rights of internal user 'lauriepoiret' and grant she
  the group "Sales / User: own document only" (and ensure she does not
  have the group  "Purchase / User")

- as 'lauriepoiret', create a sale order for a product without
  'service subcontracting' (ex. Bacon Burger) and confirm it

- click on "Cancel" button

In the wizard and warning is shown:

```
There are active purchase orders linked to this sale order that are
not cancelled automatically!
```

As the user is not a member of `Purchase / User`, he has no right
to read the `display_purchase_orders_alert` field which prevent
the invisible attrs to be correctly evaluated, showing the warning
in all cases even when there is no purchase order linked

This commit restrict the PO warning to the same `Purchase / User`
group to ensure that warning information is coherent

closes odoo/odoo#151968

X-original-commit: 6086d6fcc87128a72bad055a9a749c5329c6e901
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-31 17:13:58 +00:00
Eteil Djoumatchoua(etdj) etdj@odoo.com a3befcc5a9 [FIX] mail: set body on mail.message on event registration confirmation
Steps:
- Go to any event with tickets and using the ticket confirmation
template, sending 'after new confirmation'.
- Confirm a new attendee.
- An email is sent but the chatter only shows the attachment and the
subject, with no body.

Issue:
Chatter should show full content of the email.

Reason:
Above 16.2+ the 'body' is not implicitely set when genrating the
template in ``mail_template.send_mail()``. As discussed with RETH, when
requesting the 'body_html' for a template, setting the 'body' solves the
problem.

opw-3562438

closes odoo/odoo#151930

X-original-commit: 0a3d4b10a7c81d05d9bf6864b0b9a2f48f09b2a0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-31 17:13:57 +00:00
Demesmaeker 844b512077 [FIX] website_sale: hide header from user that shouldn't see an alert
closes odoo/odoo#151912

X-original-commit: 1999beb5cc364927fd8ae6a5c15509a62c5af257
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2024-01-31 17:13:56 +00:00
Deependra Solanki b4a7e5333f [FIX] web_editor: fix rollback on pasting using ctrl+shift+v
Before this commit:

When pasting using CTRL+SHIFT+V, if the textFragment includes linebreak(\n),
each textFragment is divided, and each seperated fragment is inserted using
`insert` command, followed by `oEnter` command. However, when `oEnter` is
UNBREAKABLE, the inserted text is ROLLBACKED.

After this commit:

We now check whether the anchorNode's closestBlock is UNBREAKABLE. If so use
`oShiftEnter` command; otherwise, use `oEnter` command which avoids ROLLBACK.

task-3563785

closes odoo/odoo#151911

X-original-commit: f1e35ca82cf72ffb21c586d9bf1714bb388fe257
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2024-01-31 17:13:55 +00:00
Leonardo Pavan Rocha 8ae764a97b [FIX] calendar: fixes traceback when end is not set
In calendar if you delete the end_date, switch to all_day event and set both
start_date and stop_date and try to create the event, it will raise an error
because `end` is not set. This is due to 'end' being a required field and the
end_date not setting the end value. This commit adds an onchange to properly
set the start and stop values from the start_date and stop_date.

task-3682608

closes odoo/odoo#151910

X-original-commit: ff431fc02df59b731ea2a8a7051c1e1d42581637
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-01-31 17:13:54 +00:00
Bruno Zanotti ba2012826f [IMP] stock: allow to filter orderpoint locations
This commit allow to inherit the method _get_orderpoint_locations to
filter in which location compute orderpoints imrpoving performance and
usability

closes odoo/odoo#151909

X-original-commit: 2f245b40e8cecf87cb3334a80b24a54cd6e99d12
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-31 17:13:53 +00:00
FrancoisGe 9891156c3b [FIX] web: CP keep the correct searchValue
Before this commit, in the command palette, during a search, it is possible
that the value entered is modified. The problem only occurs if the namespace
has a debounceDelay bigger than 0 and at least one of its command providers is async.

How to reproduce:
=================
- Go to the command palette with the @ namespace.
- Type a few characters
- Re-enter a few characters
If you repeat this operation several times, some characters may disappear.

Why:
====
The value of the input is modified at each "input" event, but the searchValue
in the state is only modified when the debounce trigger "search".
Since the command palette template is contained in a slot, each state
change causes a complete rendering of the command palette. When the search is executed,
the commands are added to the state after each provider has generated them,
so a rendering takes place and it is the value contained in state.searchValue
that is used for the input and not the value contained in it before the rendering.

Solution:
=========
No longer modify state.searchValue during the search, but at each input event.

closes odoo/odoo#151906

X-original-commit: f4e1350e3a03c8a3a2b6bab8f4f74e278b1d2905
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-31 17:13:52 +00:00
Raja Prasad b7c68826d9 [FIX] project: fix alignment of heading in profitability section in mobile view
Steps to reproduce:

- first install bridge module 'project_account_budget'
- open any project and go to project updates
- in right side panel you see 'Profitability' button
- click the profitability and switch to mobile view

Issues:

- heading of table are not vertically centered

Solution:

- Add style to vertically align center of heading

closes odoo/odoo#151839

Task: 3633405
X-original-commit: 249f8700b9c982c765d712cd27e93bbd7bedfe3e
Related: odoo/enterprise#55460
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-31 13:47:17 +00:00
Jeremy Kersten 433589d744 [FIX] website_[membership,partner,customer]: redirect to real slug
+ website_crm_partner_assign that overrides website_partner

Implement partner slug validation for accurate URL redirection

Prior to this commit, partner slugs weren't verified, leading to Google
indexing outdated partner URLs even after renaming. With this change,
when the virtual slug (fake slug sinc no read access on res.partner)
differs from the actual one, redirection to the correct URL is enforced.

closes odoo/odoo#151824

X-original-commit: a28a9c3a5e635f45e0bfee402b7f0775735adeb7
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-01-31 13:47:17 +00:00
Robin Lejeune (role) b5fd2820bb [FIX] web_editor: fix CTA button class
When a button is updated, its `btn` classes are stripped by the editor.
However, in so doing the regex replaces `btn_cta` by `_cta`. This commit
fixes it.

Related to opw-3644220

closes odoo/odoo#151803

X-original-commit: 61735c84445606b97fdf95f35b6e3dd1384b7ea5
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-01-31 13:47:15 +00:00
Andrea Grazioso (agr-odoo) 521ffebe5a [FIX] mrp: Manufacturing Forecast access from template
Have a product template with bom
Ensure the product variant has not the same id of the template
(Add and remove a template variant)
In the product page > Hit "forecasted" smart button > "Manufacturing Forecast"

Error will raise:
Missing record
Record does not exist or has been deleted.

This occurs because when opening the Manufacturing Forecast from the
template product we are searching the variant using the id of the
template product

opw-3636661

closes odoo/odoo#151776

X-original-commit: df7b80f24bc6ef20d3aea25e9597807f5a6a0195
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-01-31 13:47:14 +00:00
Julien Alardot (jual) 556ab11594 [FIX] hr_expense: Fix product cost digits
Fixes an error where a product cost rounding change
(e.g. from default 2 to 3) would not be reflected
expense product and expense price_unit

task-3679204

closes odoo/odoo#151775

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2024-01-31 13:47:13 +00:00
Xavier ALT 88783d3c12 [FIX] website_event_meet: fix crash when creating event meeting room
To reproduce:

- Log-in as admin
- Switch to debug mode

- Go to Events / Configuration / Event Templates
- Create a new template:
  * Name: Online Conference
- Check 'Website menu', 'Community' and 'Allow Room Creation' option,
- Save it

- Go to Events / Events
- Create a new event:
  * Name: New Online Conference
  * Template: Online Conference
- Save it and click on 'Go to Website' smartbutton
- Then click on 'Community' submenu
- In the right panel, click on "Create a Room"

It crashes with:
```
TypeError: ctx.widget is undefined
    template@.../web/assets/1/debug/web.assets_frontend_lazy.js line 13622 > Function:26:29 (/web/static/lib/owl/owl.js:5532)
    render@.../web/assets/1/debug/web.assets_frontend_lazy.js:66320:28 (/web/static/src/core/utils/render.js:56)
    renderToElement@.../web/assets/1/debug/web.assets_frontend_lazy.js:66272:22 (/web/static/src/core/utils/render.js:8)
    _onClickCreate@.../web/assets/1/debug/web.assets_frontend_lazy.js:132115:35 (/website_event_meet/static/src/js/website_event_create_meeting_room_button.js:25)
```

This revert odoo/odoo@065a2f451a change for `website_event_meet`, as
in that case the `csrf_token` value is provided directly as context
value to `renderToElement` (see `websiteEventCreateMeetingRoom`
publicwidget `_onClickCreate` handler)

closes odoo/odoo#151761

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-31 13:47:12 +00:00
Benjamin Vray ab0e0f4bef [FIX] web, website_sale: fix text color of modals if dark body background
Before this commit, if the text color of the body was light (e.g., due
to a dark body background), the text in certain modals (for example, in
the "Alternative products" modal displayed when adding a product to a
cart on a product page) was also light, making it not visible on the
white modal background.

Steps to reproduce the bug:
- Install the e-commerce on your website.
- Go to the "Customizable Desk" product page.
- Click on "Edit" to go in edit mode.
- Click on the "Theme" tab.
- Click on the 4th color of the theme colors and choose "black".
- Save the page to leave edit mode.
- Click on the "Add to cart" button.
- Bug: The text in the the modal is not visible because both text and
background are white and the input elements have their background the
same color as the body.

After this commit, we now verify that there is sufficient contrast
between the text color of the body and the background color of the
modals. If this condition is not met, we apply an alternative color
("$color-contrast-dark" or "$color-contrast-light") to the text of the
modal to ensure visibility.

opw-3570774

closes odoo/odoo#151346

X-original-commit: ffd2f2363f20b88ec05c153c57057b538c3885d2
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2024-01-31 13:47:11 +00:00
William Henrotin 49e55546c2 [FIX] stock, mrp_subcontracting: split origin moves
This commit corrects commit 7a78839ca6cf45ddec7adb59051da132e0ebceb4
that split the move_orig_ids for new stock moves created in backorder.
The issue is this should only happens in case of subcontracting, not for
every backorders

closes odoo/odoo#151179

X-original-commit: 79f85cba46df610372c740f971182cac8c0498c0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-31 13:47:10 +00:00
Chrysanthe (chgo) b5db4c2661 [FIX] web_editor: fix colorpicker buttons design
This commit fixes an issue related to the colorpicker component, present
in both back-end and front-end. They use the same XML template but they
have two different selectors within our SCSS files.

Some months ago, commit[1] removed some `@extend` rules related
to button design within the `web_editor`, and replaced them
with a `.btn` BS class. This affected both colorpicker and causes layout
issues on the "front-end web editor", which was not the expected output.

The issue was fixed directly with commit[2], but by removing the `.btn`
class from the template, it removed the whole styling on the back-end
color picker, making it use the user agent button styling.

== After ==
Since the colorpicker already has some CSS variables to handle its design
depending on the context, we make use of the CSS variables to customize
the design of the component when it is inside the backend, and make it
look as it was before it lost its `.btn` class.

[1]: ee38c69503
[2]: 711fc86368

task-3693078

closes odoo/odoo#150157

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2024-01-31 13:47:09 +00:00
Antoine (ande) ed76c3700c [FIX] point_of_sale: cannot scroll in categories
Current behaviour:
When there is too many product categories,
you cannot see the last items, because
the scrollbar is hidden.
This was made to hide the scrollbar on mobile.

Steps to reproduce:
1. Go to Point of Sale
2. Configuration > PoS Product Categories
3. Duplicate one category 12 times
4. Uncheck Restrict Categories
5. Dashboard > New Session
6. The list of categories is too long
7. Cannot see the last items

Cause of the issue:
Introduced by https://github.com/odoo/odoo/commit/60f41b1f831248c58f554dbe40114ef0d4ce42c0#diff-f23069b3927b8544dd51433e277cf8b650b10a67e5b8648155e427aaa31c19a3R838

Fix:
Make the scrollbar disappear on mobile,
and appear otherwise.

opw-3653429

closes odoo/odoo#150154

X-original-commit: 0f7fbede653dcb7c91536ea9c87df7d831a0c8cf
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-31 13:47:08 +00:00
Abdelouahab (abla) af66512ea8 [FIX] web: open record from list with a x2m field on virtual record
To reproduce
============
- On a project, on a task
- create a subtask give it a name and from the list view click on the
  "view" button
- you get redirected to form view to create a new task that is not related
to the parent task or the project

Problem
=======
When you click on the "view" button, the task is not saved yet, so the
subtask doesn't exist yet to be viewed in Form view

Solution
========
We prevent the redirection to the form view if the record is not saved yet
same logic as : https://github.com/odoo/odoo/commit/9b136383c2599301413e6770cc0ff204273b589d

opw-3681471

closes odoo/odoo#149753

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-31 13:47:07 +00:00