Commit Graph
160631 Commits
Author SHA1 Message Date
Rodrigo ca62e32aa4 [FIX] account: account_searchpanel.scss add width 0 to firts elemnet with class .o_toggle_fold for align header test to left
closes odoo/odoo#119904

X-original-commit: b3b05e6f764229298c9e74abf0dd42c06a5dd73d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-27 12:31:41 +02:00
Jan Brodersen (Armitxes) 5d5099a0f5 [FIX] mail: No crash from "enumerateDevices" in discuss calls
Before this commit, when accessing the discuss call settings
in non-localhost without SSL, there was the following crash:

```
"Cannot read 'enumerateDevices' of undefined"
```

Odoo uses zxing-js to detect devices within the discuss app.
zxing-js provides methods such as "hasNavigator",
"isMediaDevicesSuported" or "canEnumerateDevices" to check if
features are available. These are not called by Odoo before using
the related features what can result in a JS traceback.

This commit fixes the issue by showing a warning as a toaster
notification and in the dev tools, instead of a traceback.

The zxing-js methods are not exposed, hence the reliance on
truthy mediaDevices.

See also https://github.com/zxing-js/library/issues/225

Closes https://github.com/odoo/odoo/issues/112255
Closes https://github.com/odoo/odoo/pull/112813

closes odoo/odoo#119903

X-original-commit: 32238dd680396c6ccb519aa8b3fb7487c38395f7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 12:31:39 +02:00
Didier (did) 3a86405a09 [IMP] mail: remove unuse variable
This code was moved to `_bus_notification_target` in https://github.com/odoo/odoo/pull/119413

closes odoo/odoo#119911

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-04-27 11:21:20 +02:00
roen-odoo 5db35ac7c5 [FIX] point_of_sale: correctly show discount on receipt
Current behavior:
When a fiscal position is applied on an order in the PoS, the change of
price was interpreted as a discount. This shouldn't be the case.

Steps to reproduce:
- Create a tax that is included in the price (e.g. 10%)
- Create a fiscal position that match this tax and change it to no tax
- Change the pricelist option to show discount
- Create a product with a price of 100€
- Open the PoS and add the product to the order
- Apply the fiscal position
- Pay the order, and go to the receipt screen
- There is a discount showed on the receipt

opw-3154499

closes odoo/odoo#119902

X-original-commit: c7e1e634f76ef01920f7bcc7ccb43b3f28736499
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-04-27 11:21:17 +02:00
Josse Colpaert 04bfbb4e7e [FIX] account_edi: we forgot to add the edi documents in the mail send wizard
The send and mail wizard was replaced by something simpler, but we
forgot to automatically attach the attachments of the edi documents
of the old account_edi in the mail.

Before, the XML of e.g. the Mexican EDI, generated when the invoice gets
sent (and signed) by the government,  would not be included
automatically when the user wants to send the invoice by mail to the
client. Now, it will be.

closes odoo/odoo#119435

X-original-commit: b3cbd7ea2b6cc07efd9a6358bd37f23f1ba4e6ab
Signed-off-by: Laurent Smet <las@odoo.com>
2023-04-27 11:21:12 +02:00
luvi 894090914e [IMP] web, *: add supportedOptions documentation as field metadata
*: mail, mass_mailing, sms, web_editor

This commit adds a new supportedOptions attribute that can be added to any
field widget metadata object. This documentation can be used from other places
(Studio for example) by getting the field from the registry and then read
this key. This attribute can contain an array, detailing the list of available
options for the field widget.

By using an array, it can be ordered easily without having an object with keys
unalphabetically. Ordering the options can make sense, especially when two
options are tied to each other, it is easier to group them one after the other.
(eg: 'start_date' first, then 'end_date')

Each option documented is an object and has the following attributes:
- help: contains more details on the current option and its use
- name: name used in the options object from the node
- label: a label with a more explicit name than the option name
- type: the type of value that must be used as a value (string, boolean, selection, field, domain)
- choices: for options with a 'selection': can be used to know available values
  where multiple values can be chosen as the value. This must be
  an array containing the options.
- availableTypes: for options with a 'field' selection: can be used to filter the
  available fieldNames to choose as a value.
- default: the value that is used by default, when the option is not set
  in the options

task-3259617

closes odoo/odoo#118713

Related: odoo/enterprise#39847
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-27 11:21:09 +02:00
niyasraphy 1e7127c92e [FIX] product: traceback on deleting category
before this commit, when deleting a product
category from a db where expense category
is already deleted before this commit [1]
is raising exception

after this commit, exception wont be shown
in existing db where expense category is
deleted.

1 https://github.com/odoo/odoo/commit/09e4b2fb586ac83adb984672e027ce6dd62affb2

closes odoo/odoo#119754

X-original-commit: 20b5518110b233ba3b59158a8362db04b9a89aad
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-04-27 10:13:10 +02:00
Géry Debongnie a7cd003173 [FIX] web: do not reload webclient in some cases with errors
Whenever an user updates a company or a currency, the webclient has to
reload, to properly apply these changes. It is done automatically,
immediately after the rpc has completed.

However, before this commit, it would do that always, even if the rpc
has failed (for example, if the user tried updating an invalid field),
so the user would briefly see an error window, then the browser is
immediately reloaded.

With this commit, we only reload the webclient when the rpc succeeded.

closes odoo/odoo#119730

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-27 10:13:05 +02:00
Ricardo Gomes Rodrigues (rigr) ef9c74f698 [FIX] stock_account: prevent stock account update on product change when using manual stock valuation
If the category of a product is using manual stock valuation, when changing the product on an invoice line,
the account should not be set to the `property_stock_account_input_categ_id`. It should be the case only if
we use automatic/real-time stock valuation.

opw-3226536

closes odoo/odoo#119717

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-04-27 10:13:02 +02:00
Loukas Wets (lowe) cd65f8bdb2 [IMP] point_of_sale,pos_loyalty: gift card info notification empty cart
When a valid gift card is added in a empty cart, the pos will display a
notification of the resume of the gift card.

We also made the notification component to preserve white space.

Task-3265311

closes odoo/odoo#118609

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-27 10:13:00 +02:00
Julien Castiaux 1bbdd77f0e [IMP] core: prettify_domain function
This commit add a new `odoo.osv.expression.prettify_domain` function
that can be used to format a domain as a string with the correct
indentation.

Example:

    ['&', '|', ('name', 'like', 'Jack'), ('name', 'like', "O'Neill"),
     ('function', '=', 'Colonel')]

Becomes:

    ['&',
        '|',
            ('name', 'like', 'Jack'),
            ('name', 'like', "O'Neill"),
        ('function', '=', 'Colonel')]

closes odoo/odoo#118067

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-04-27 10:12:57 +02:00
Julien CastiauxandRaphaël Collet 5a998694a6 [IMP] core: merge subqueries WHERE clauses
Rationale
---------

Given the following domain:

    ['|',
        ('company_id.name', 'like', 'BE'),
        ('company_id.city', 'like', 'Brussels')]

The ORM would generate the following SQL query:

    SELECT "res_partner"."id"
    FROM "res_partner"
    WHERE "res_partner"."company_id" IN (
        SELECT "res_company"."id"
        FROM "res_company"
        WHERE "res_company"."name" like 'BE'
    ) OR "res_partner"."company_id" IN (
        SELECT "res_company"."id"
        FROM "res_company"
        WHERE "res_company"."email" like 'help@odoo.com'
    );

Which is sub-optiomal as the WHERE clause of the two subqueries could be
regrouped inside of a single query like so:

    SELECT "res_partner"."id"
    FROM "res_partner"
    WHERE "res_partner"."company_id" IN (
        SELECT "res_company"."id"
        FROM "res_company" WHERE (
            "res_company"."name" like 'BE'
            OR "res_company"."email" like 'help@odoo.com'
        )
    );

Postgres-wise, it is faster to execute the latter query than the former
one. This commit is about optimizing the ORM so that it generates
queries where the WHERE clause of compatible subqueries are grouped
together.

Technical solution
------------------

The solution explored by this work is to replace the regular relational
field accesses (over a dotted path) by a new `any` operator that look as
follow:

    (relational_field, 'any', domain)

For instance, the above `('company_id.name', 'like', 'BE')` leaf becomes
`('company_id', 'any', [('name', 'like', 'BE')]` using `any`.

Having a domain as right-hand-side allow for the combination of the
domains of same compatible relations:

    [('company_id', 'any', ['|',
        ('name', 'like', 'BE'),
        ('city', 'like', 'Brussels')])

Having combined domains allows for generating better SQL queries with
minimal changes to the expression parsing algorithm, which can only
translate a single leaf at a time to SQL. With the new `any` operator,
it is still a single leaf but the right-hand-side contains the merged
domain, thus the combined SQL WHERE clause is immediately generated.

task-id-3234671

Part-of: odoo/odoo#118067
Co-authored-by: Raphaël Collet <rco@odoo.com>
2023-04-27 10:12:57 +02:00
Julien CastiauxandRaphaël Collet eee68139d5 [IMP] test_new_api: subqueries made by search() on relational fields
This commit hads a few tests that report the existing behavior (before
merging subqueries WHERE clauses).

task-id-3234671

Part-of: odoo/odoo#118067
Co-authored-by: Raphaël Collet <rco@odoo.com>
2023-04-27 10:12:57 +02:00
Manushi Shah (mash) 417face218 [FIX] mass_mailing: needlessly large gap in mailing list contacts
Prior to this commit:
In email marketing, when we click on the import button of the "mailing list
contacts", we find a needlessly large gap beneath the contact list.

Post this commit:
The class which creates the space is removed and hence we get the required output.

Task-3258581

closes odoo/odoo#119884

X-original-commit: 1ee98fb9f6bd8289c5ffcada14c3db62afba5a0d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-27 09:12:54 +02:00
Khushi Vakil 38cc698aa7 [IMP] l10n_in_edi: check ship from address name is must set
Current behaviour before PR:
  1.Go to Company Partner
  2.Create a shipping address
  3.Set this shipping address in the warehouse
  4.Create a sale order with that warehouse
  5.Create an Invoice
  Then that invoice can't be send because the address name is empty.

Current behaviour after PR:
  If anyone creates a contact under the company as the shipping address and if
  the name is empty then in this case it assigns the company name

Task:3259223

closes odoo/odoo#119896

X-original-commit: 2f395a9baab057293b158fab34f5108786889d7d
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-04-27 08:09:46 +02:00
Pierre Masereel ce61e5fcc5 [FIX] event_booth_sale: wrong price_reduce on booth price
When we are selling a booth from the sale application, and have a
pricelist set on the order with a discount_policy "with_discount", it
needs to compute the price_reduce of the booth catgeroy to get the
unit_price of the sale_order_line.

As the price_reduce depends on the pricelist in the context, we need to
give the pricelist in context to get the correct price. This only
happen from the backend, because when we come from the frontend
(website) the _get_contextual_pricelist() takes the current pricelist
from the website.

So we are now taking the pricelist from the sale order and pass it in
the context when we need the price_reduce, which is the same behaviour
as the one in 'event_sale' for event ticket.

closes odoo/odoo#119893

X-original-commit: c3ec492390b27485934daabdc8e6d2771f01d933
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-04-27 08:09:44 +02:00
Nshimiyimana SénaandLaurent Smet cfeffc3c74 [FIX] account: invoice totals using Cash Discount and price-included taxes
## Summary

Currently, when using both an early payment discount (upon invoice) and
price-included taxes, the invoice totals are not calculated correctly.

## Steps to Reproduce

1. Set `Cash Discount Tax Reduction` to `Always (upon invoice)`.
2. Create an invoice with the payment term set to `2/7 Net 30`.
3. Add an invoice line with a price of 100 and a 21% price-included tax.
4. Save the invoice: The `Untaxed Amount` should be 100, but it
   incorrectly shows 100.35 instead.

## Cause

When calculating the totals, the price-included tax is applied to one of
the early payment discount lines. Since the tax is price-included, the
system recalculates a new base price for the EPD line, which ultimately
leads to an incorrect `Untaxed Amount`.

opw-3239904

Enterprise PR: odoo/enterprise#39007

closes odoo/odoo#119892

X-original-commit: 43b78a96a8961b83cf1c18f58bd549dabc90c50f
Related: odoo/enterprise#40404
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Co-authored-by: Laurent Smet <las@odoo.com>
2023-04-27 08:09:39 +02:00
Soukéina Bojabza 1502c6cf52 [FIX] website_sale: remove cart popover on language selectors in header
Since commit [1], when we are in the `/shop/cart` page and if a language
selector is in the header, a cart popover also appears when hovering the
languages. This happens because the `websiteSaleCartLink` widget
selector also targets the cart links inside the language buttons.

This commit solves this issue by excluding the language selectors from
this widget selector.

[1]: https://github.com/odoo/odoo/commit/ecefa679b224ce0e4a5a7e91ce28936321132d9c

opw-3288727

closes odoo/odoo#119887

X-original-commit: bdfceb8ed274cd343d273c0a7f9bbb513617a0b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-27 08:09:34 +02:00
Touati Djamel (otd) 5968480dfa [FIX] stock: apply only quant with inventory quantity set
Steps to reproduce the bug:
- Create a storable product “P1”
- Create a purchase order with 3 unit of “P1”
- Confirm the PO and receive the delivery
- Go to inventory > operation > Inventory Adjustments
- Select the “quant” of “P1”:
    - quantity = 3
    - inventory_quantity = 0
- Click on “Apply”
- Apply the wizard

Problem:
The quantity is updated to 0

When the `_apply_inventory` function is called, a move is created and
validated to ensure that the quantity matches its corresponding
`inventory_quantity`:
https://github.com/odoo/odoo/blob/15.0/addons/stock/models/stock_quant.py#L606-L611

`inventory_diff_quantity` is equal to -3 in this case, since it's the
result of computing `inventory_quantity` - `quantity`, which is (0 - 3).
Since we add a minus sign to `inventory_diff_quantity`, the final result
becomes `3`.

Afterward, we call the `_update_available_quantity` function with a
minus sign as well, so the value becomes -3:
https://github.com/odoo/odoo/blob/e1cea2640fc064a56b0dba4f79e6b8a91a48b4fc/addons/stock/models/stock_move_line.py#L307

As a result, when we add `quant.quantity`, which is 3, the final result
becomes 0 (3 - 3):
https://github.com/odoo/odoo/blob/9d34c72b2c7bc187c5aac771e9e8cbddd7ead5f2/addons/stock/models/stock_quant.py#L635

Solution:
If no inventory_quantity set, ignore the apply of inventory for this
quant.

opw-3268542

closes odoo/odoo#119867

X-original-commit: 4bedeb514652f5f4a9fd8fa0914d07c8ccba3952
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-04-27 07:06:15 +02:00
Touati Djamel (otd) eac9a940a1 [FIX] purchase_stock: update po_line without purchase access right
Steps to reproduce the bug:
- Create a Storable Product “P1”:
    - Route: buy
    - Reorder Rules: Min 5, Max 0
- Set up a user with only Inventory / User Access Rights
- Using INV User, create a Delivery Order (Delivery 1) so the amount
 of Product On Hand is below the Reorder Rule Minimum
 --> this will genreate a PO created by Odoo bot

- Using the same INV User, create a new Delivery Order (Delivery 2)
so that the amount purchased on the PO will need to be changed

Problem:
This is done by the user who created the need and not Odoo bot and
as the INV User does not have Access Rights to edit Purchase Order
Lines, an Access Error is triggered.

opw-3255007

closes odoo/odoo#119866

X-original-commit: 32c48924e5045b2cad4f6fda2f0222be0683c22a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-04-27 07:06:13 +02:00
Stanislas Gueniffey 7c0d82a3d9 [IMP] web_editor: allow pasting HTML tables
Previously, when a clipboardData contained both files and html content,
we prioritised files. This is correct when the original content is an
image (in which case the clipboard html may contain an image tag or be
empty, depending on the source). This is however incorrect in at least
one known case: copying a table from a spreadsheet app, as those usually
generate an image of the table alongside the actual html table. In that
case, we would rather keep the table.

This commit differentiates the specific case where the HTML represents a
table from other cases. In the former, priority is now given to the HTML
content. In the latter, we keep the files as we did before.

task-3165757

closes odoo/odoo#119862

X-original-commit: 021f2f028b382fe15ca75928d1b30a4eb48322df
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-27 07:06:08 +02:00
Alexandre Kühn f1566d4d2d [MOV] mail,*: move static discuss/ to discuss_app/
*: im_livechat, website_livechat

In preparation of splitting 'discuss' and 'mail' modules.

This allow using new folder discuss/ that contains all static
files of new module 'discuss'.

Part of task-3265211

closes odoo/odoo#119860

Related: odoo/enterprise#40388
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 07:06:02 +02:00
Andrea Grazioso (agr-odoo) 7df7f9b0bc [FIX] account: product description change with journal
Have 2 Customer invoices journals
Create an invoice
Add a line
Save
Edit product description
Change journal

Product description will reset to default

opw-3171099

closes odoo/odoo#119850

X-original-commit: 43b49f8cacff87e15102993ff4e2d06c9bff8ff4
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-04-27 07:05:59 +02:00
Alexandre Kühn 66301a4ac6 [FIX] mail: new needaction message from chatter in messaging menu
Before this commit, when receiving a new needaction message from
chatter, the messaging was not updating itself to show this new
needaction.

closes odoo/odoo#119843

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 07:05:57 +02:00
Xavier-Do ae000f07e1 [FIX] loading: check ir_module existence
When instantiating a new registry, this piece of code is called

    try:
        odoo.modules.load_modules(registry, force_demo, status, update_module)
    except Exception:
        odoo.modules.reset_modules_state(db_name)
        raise

For a new database, load_modules will create the table ir_module_module
in the same transaction as everything else. This means that if any error
occurs, the transaction is rollbacked and the table ir_module may not
exist.

`reset_modules_state` will try to access ir_module_module table leading
to another error and an unecessary and confusing error log.

2023-04-26 12:05:34,823 616958 ERROR ? odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')
ERROR: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
               ^

    2023-04-26 12:05:34,823 616958 ERROR ? odoo.modules.registry: Failed to load registry
    2023-04-26 12:05:34,824 616958 CRITICAL ? odoo.service.server: Failed to initialize database `test-base`.
    Traceback (most recent call last):
    File "/home/xdo/osrc/master/odoo/odoo/modules/registry.py", line 90, in new
        odoo.modules.load_modules(registry, force_demo, status, update_module)
    File "/home/xdo/osrc/master/odoo/odoo/modules/loading.py", line 386, in load_modules
        raise Exception('An error')
    Exception: An error

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/home/xdo/osrc/master/odoo/odoo/service/server.py", line 1302, in preload_registries
        registry = Registry.new(dbname, update_module=update_module)
    File "<decorator-gen-14>", line 2, in new
    File "/home/xdo/osrc/master/odoo/odoo/tools/func.py", line 87, in locked
        return func(inst, *args, **kwargs)
    File "/home/xdo/osrc/master/odoo/odoo/modules/registry.py", line 92, in new
        odoo.modules.reset_modules_state(db_name)
    File "/home/xdo/osrc/master/odoo/odoo/modules/loading.py", line 622, in reset_modules_state
        cr.execute(
    File "/home/xdo/osrc/master/odoo/odoo/sql_db.py", line 311, in execute
        res = self._obj.execute(query, params)
    psycopg2.errors.UndefinedTable: relation "ir_module_module" does not exist
    LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...

With this commit, we check the ir_module_module table existance avoiding
an exception and revealing the minimal traceback.

2023-04-26 12:11:21,218 617810 INFO ? odoo.modules.loading: skipping reset_modules_state, ir_module_module table does not exists
2023-04-26 12:11:21,218 617810 ERROR ? odoo.modules.registry: Failed to load registry
2023-04-26 12:11:21,218 617810 CRITICAL ? odoo.service.server: Failed to initialize database `test-base`.
Traceback (most recent call last):
  File "/home/xdo/osrc/master/odoo/odoo/service/server.py", line 1302, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "<decorator-gen-14>", line 2, in new
  File "/home/xdo/osrc/master/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/home/xdo/osrc/master/odoo/odoo/modules/registry.py", line 90, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/home/xdo/osrc/master/odoo/odoo/modules/loading.py", line 386, in load_modules
    raise Exception('An error')

closes odoo/odoo#119820

Exception: An error
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-04-27 06:10:18 +02:00
Guillaume (gdi) f845d5365d [FIX] website: ignore the scheme for page indexing
When a user sets up a domain name on Odoo, we consider that he has a
configuration that makes only one site visible. To do this, the standard
solution is to have the following redirections:
- http://example.com => https://example.com
- https://www.example.com => https://example.com
- http://www.example.com => https://example.com

It happens that users enter something other than https://example.com in
the setting to define the domain names of their websites. If this is the
case, [this other commit] would cause an error:
- The page indexing bot went to https://example.com but since this was
not what was set in the settings, a no index was added so that the page
was not referenced.
- As soon as the indexing bot went to http://example.com,
https://www.example.com or http://www.example.com, it was redirected to
https://example.com.

As a result, the client ended up with a non-indexed website.
The purpose of [this other commit] was just to prevent double indexation
of websites (the https://example.odoo.com and the https://example.com).

After this commit, the pages will be indexed even if the scheme is not
the same as the one specified in the settings. The same goes for the
www. which is also ignored.

Note that this can have an undesirable effect if the client has a bad
configuration and has several sites exposed (https://example.com and
https://www.example.com for example). If this is the case, he will end
up with a site that is indexed twice.

[this other commit]: https://github.com/odoo/odoo/commit/3739d74afe824554b37b1b52ed32ada33692c01a

task-3110888

closes odoo/odoo#119819

X-original-commit: c75b35b24c868a821089cafd990c15357cf737e7
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-04-27 06:10:16 +02:00
thsh-odoo b8f847e03b [FIX] crm: improve layout of conversion modal
When converting a lead to an opportunity and merging with existing
opportunities, the list view showing opportunities is very tiny.

This is caused by the field not having the correct colspan, as its label is
hidden with the "nolabel" attribute.

This commit fixes it by assigning a colpan of 2.

Task-3179173

closes odoo/odoo#119790

X-original-commit: 6a003a12c92d215f8123538473eeb23a36e9ec7e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-27 06:10:07 +02:00
Didier (did) 8a55e1b4df [IMP] mail: populate res.partner admin with 100 mail.message
Insert 100 messages on the admin res.partner for testing purposes.

closes odoo/odoo#119789

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 06:10:05 +02:00
Sébastien Theys ad58e0fdd8 [REF] mail: move discuss.channel code to its own folder (controllers)
This commit focuses on removing all references to discuss.channel from
controllers of mail module.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119523

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 06:10:02 +02:00
Michael (mcm)andMathieu Duckerts-Antoine a79765ed33 [IMP] web: support of properties in domain selector
Before this commit, users could not query properties
with the domain selector. Now, all the properties are
listed when selecting a properties field.

task id: 3283212

closes odoo/odoo#115270

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-27 04:31:00 +02:00
Alexandre Kühn 187ad14840 [REF] bus: prettify bus files
closes odoo/odoo#119530

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 02:44:42 +02:00
Adrien Guilliams (adgu) 72e9034f9f [IMP] pos, l10n_fr_pos_cert: change price_manually_set behaviour
The price_manually_set variable was used to largely, we fix it
by adding a price_automatically_set variable. The price_manually_set
is now used when changing the price through the numpad, whereas
price_manually_set is used to indicate that the price is not
the price set in the database.

closes odoo/odoo#119362

X-original-commit: aa4f346d27aa28c23f8ee02fe73b892a1f5ef2dc
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
2023-04-27 02:44:40 +02:00
det 244b8502d2 [IMP] account: helper to generate invoices via send&print
https://github.com/odoo/odoo/commit/955091e707df1206ccda8314f1f182e2a37a8362
changed the way we want to generate invoices.

This commit provides an helper method to be used in others modules to
properly generate and send invoices following the send&print flow.

task-id:3253019

closes odoo/odoo#119759

X-original-commit: 8dbf4c8390d9d0e4e2050b0ca318fcb2ec9dc3b0
Related: odoo/enterprise#40330
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-04-27 00:52:20 +02:00
qdp-odoo d563481306 [FIX] purchase: vendor bill autocomplete check for duplicated lines
Failing use case:
Create a vendor bill and use the auto-complete field to select a purchase order multiple times.
The purchase order gets added to the vendor bill multiple times, this doesn't happen in V15 and was never intended.

The reason is simply that the code was checking on self.line_ids which get only populated after the record is saved and its invoice_line_ids are synchronized. Before that, only the field invoice_line_ids is filled witht new_ids.

opw - 3196149

closes odoo/odoo#119758

X-original-commit: 29d5862d447dd369432b345e43d5875d3b2a4474
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-27 00:52:17 +02:00
Loan (LSE) a71bfd5306 [FIX] website: delete visitors by batch in cron
Before this commit:
The scheduled action will repeatedly time out if the number of visitors
to remove is too high. In the case of the client, he has ~ 4 millions
inactive visitors to remove. This might happen after a bot spam attack.

After this commit:
The visitors are removed by batch of 1000, reducing the number of old
visitors with time

opw-3256349

closes odoo/odoo#119757

X-original-commit: b69917ec0e508f8354d831525c5c48ee79b5967a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-04-27 00:52:15 +02:00
Benjamin Vray 2c5096823b [FIX] website: fix animations on rtl pages
Steps to reproduce the issue:

- Open a website page in edit mode.
- Drag and drop several snippets onto the page.
- Add a 'Fade In Right' animation to an element on the page.
- Exit edit mode.
- Change the website language to Arabic to display the scrollbar on the
left.
- Test the animation.
- Bug: the scrolling (using the mouse wheel) becomes stuck or very slow
during the animation.

The issue only occurs with Chrome or Edge browsers and seems to be a
browser display issue. It happens only when animated elements overflow
to the left.

This commit fixes the problem by adding an 'overflow: hidden' to the
main element during RTL page animations. This is not the best solution
because the animated elements become non-visible outside the main
element, creating a difference, for example, with the 'Framed' page
layout.

opw-3260399

closes odoo/odoo#119766

X-original-commit: 69184ea84c78de33d47f1e952530cceb568c937b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-26 23:01:15 +02:00
Jinjiu Liu 25be2d15c2 [FIX] web_editor: don’t delete table cell when its left cell has content
Reproduction:
1. Create a 1 by 3 table, input something in the first cell
2. Go to the second cell, hit backspace
3. The second cell is deleted and the third cell is moved to the second
cell

Note: in 15, we don’t have the table selector to remove a row of the
table but that is another issue

Fix: when we try to delete the table cell and the offset is 0, nothing
should be done. Also added a test to make sure the cell is unchanged
when we try to delete in an empty cell which has a cell with content
at the left. Also we skip the rejoin block step if there's a table cell
element is invoivled because the cells are not deleted and rejoining
them is not needed

Task-3171904

closes odoo/odoo#119765

X-original-commit: f62275ddb3967ff769cddcde070b4688d36dc4dd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-26 23:01:12 +02:00
odoo 36ce1611ed [FIX] project: fix line break between the partner name & city issue
Description of the issue/feature this PR addresses:
In kanban view of field service, there is a break line between partner name and
partner city.

Current behavior before PR:
partner name and partner city are in different line.

Desired behavior after PR is merged:
partner name and partner city are in same line.

Fix:
in kanban view of project module, partner city is inherit from the industry_fsm
module. Style is added in both the fields(partner name and city), due to which
line break is occurs. so style is removed from both the fields and added to the
parent <span> tag of the fields. <t> tag is converted into <span> tag so that
style can be applied.

task-3252521

closes odoo/odoo#119760

X-original-commit: f35b534e6e86d3b5848f3e9cb6aa4d6e0b0c1854
Related: odoo/enterprise#40331
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-26 23:01:07 +02:00
Julien Castiaux 44d60e3e7e [IMP] requirements: drop support for py3.7
All major systems (debian stable, ubuntu lts, windows) support py3.8
and all dependencies used by Odoo come with wheels for that version.
Most developers at Odoo SA uses 3.8 already and runbot is using ubuntu
jammy (which comes with py3.10) to test the current 16.0/master.

closes odoo/odoo#119492

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-04-26 19:49:10 +02:00
Sébastien Theys b1772094b1 [REF] mail: move discuss.channel code to its own folder (models)
This commit focuses on removing all references to discuss.channel from
code located in /models of mail module.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119413

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-26 19:49:08 +02:00
Chong Wang (cwg) b92415023d [IMP] core: prefetch all translations
a new context `prefetch_langs=True` allows ORM to prefetch all translations of
translated fields while fetching.

For example
The activated languages are 'fr_FR' and 'nl_NL'
In the database the value is '{"en_US": "English", "fr_FR": "French"}'::jsonb
after fetch with `prefetch_langs=True` the raw cache value will become
{'en_US': 'English', 'fr_FR': 'French', 'nl_NL': 'English'}

closes odoo/odoo#116947

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-04-26 18:12:08 +02:00
Rodrigo 9e12878cc2 [CLA] signature for RodrigoBM
closes odoo/odoo#119756

X-original-commit: 025507b0cd860b2c05298f1bf3a3fb83bba7fd6e
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-26 17:06:36 +02:00
Rodrigo ae4c249882 [IMP] account: improve tax name search
This commit allows the exact search of a text that is searched between dashes.
Examples:   0EUM      => VAT 0% EU M.
            21M       => 21% M , 21% EU M, 21% M.Cocont and 21% EX M.
            21 M"    => 21% M and 21% M.Cocont.
            21" M"co  => 21% M.Cocont.

X-original-commit: ad2682c513c82052539cf99a54994b035b2afe6d
Part-of: odoo/odoo#119756
2023-04-26 17:06:35 +02:00
Yolann Sabaux d7ce6d9136 [FIX] purchase: prevent unnecesary change of currency
Steps to reproduce:
- put the currency of the bill to eur
- change the partner with a partner with no purchase currency set

Issue:
The bill is re-set to usd

Note:
addendum to https://github.com/odoo/odoo/pull/116852

opw-3233527

closes odoo/odoo#119753

X-original-commit: 51ff9c6026b8f9079aba7c9e26891f62c782761d
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-04-26 17:06:32 +02:00
Yolann Sabaux 57542c6ee3 [FIX] purchase: enable correct currency on onchange partner_id
Steps to reproduce:
- company currency = USD
- set a partner P with a `property_purchase_currency_id` in EUR
- create a bill with Azure partner and set an bill line
- change to partner P
issue -> the currency of the line has not been change
- change to Azure
issue -> no change about the currency

Cause:
- We update the move.currency_id but not the line_ids.currency_id
- after setting Partner P, we try to set a partner that no `property_purchase_currency_id`, we do not enter in the condition

opw-3233527

X-original-commit: 213e22c63f6259e2e69193b7d6a7022d8b6eab20
Part-of: odoo/odoo#119753
2023-04-26 17:06:31 +02:00
Achraf 20e4bd9bb3 [FIX] google_calendar: Change logger type from error to exception
In sentry we receive like 2k syncing issue from google_calendar.

This commit converts `_logger.error` to `_logger.warning` because we don't
need an erro for that

sentry-4121123364
https://online.sentry.io/issues/4121123364

closes odoo/odoo#119742

X-original-commit: e797712561113f098edc1346995cecd7e96ad362
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2023-04-26 17:06:28 +02:00
Stanislas Gueniffey 4b4ea80787 [IMP] web_editor: improve focus() for LinkDialog
Previously, LinkDialog always focused on the first editable input field.

This commit introduces a new option in the LinkDialog constructor,
`focusField`, that allows to designate a specific field to focus on.

This option is now used to focus on the second editable input field when
the first one is already filled (for example, from the user selection).

task-3224551

closes odoo/odoo#119699

X-original-commit: 70649465c35736ae5a8b918817bfd0f598600852
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-26 17:06:25 +02:00
Adrien Widart (awt) e9528d8741 [FIX] stock_landed_costs: set AML's account on its creation
To reproduce the issue:
1. create a product category with inventory valuation set as Manual
2. create a landed cost product using above category
3. enable anglo saxon accounting in accounting settings
4. create a vendor bill with this product and click save

Error: An error is displayed because of a missing account

When creating the AML, `_compute_account_id` tries to find the
appropriate account. However, for a landed cost, it always use the
the stock accounts, even if they are not defined. We should rather
recycle `/stock_account._compute_account_id` which already handle
such a situation.

OPW-3251714

closes odoo/odoo#119564

X-original-commit: 9416be3cbe630ed693a0285f203e1de9f45acc7a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-04-26 17:06:13 +02:00
Adrien Widart (awt) 4bccbb175f [FIX] {stock_,}account, stock_landed_costs: set categories properties
When a product category valuation is set to `real_time`, we use the
stock accounts. However, in the code, to know which account we
should use, we do: "use stock accounts if defined, else use basic
ones" (the best should be "use stock accounts if `real_time`" but
this refactoring task will be done in master). So, here, we need to
ensure that stock accounts are not defined when the valuation is manual.

This is the case when installing `stock_account` module: the
valuations will be set to manual, so we need to force the stock
accounts to `False`. Same when creating a new company, we also need to
ensure that the stock accounts are not defined. This explains the
changes in `_post_load_data`

About changes in `_check_valuation_accouts`, the explanation is in
the method body: the defined values directly depends on the value of
`property_valuation`

Note about test modification: for the tests in `stock_landed_costs`
module, we set the categ to auto so the stock accounts are defined.
Otherwise, when validating the landed costs, it will lead to an error
https://github.com/odoo/odoo/blob/9cd316f038dc95051814ede9474f8f15f7d165df/addons/stock_landed_costs/models/stock_landed_cost.py#L396-L397

OPW-2746384

X-original-commit: 2780c37cfdb8560ac7c725fd27f4fe272f1d3072
Part-of: odoo/odoo#119564
2023-04-26 17:06:13 +02:00
Jeremy Kersten f854a0d4ea [FIX] website_crm_partner_assign: fix url in email Forward to partner
Bug exists since a long time ago, but because url is empty, nobody
reported it before today since the consequence is just to don't have
any link.

On our prod we have some automation/customization that make this bug
visible.

opw-3257270

closes odoo/odoo#119554

X-original-commit: 5a5ee4a73ede391877bfef51a0aafcefa682e856
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-04-26 17:06:09 +02:00