Commit Graph
166990 Commits
Author SHA1 Message Date
Valeriya(vchu) fdb6f62742 [IMP] payment(_demo, _stripe), website_sale_picking: PM improvements
1) Add default filter to list view of payment methods.
2) Raise UserError when the user activates a PM linked to
   only disabled providers.
3) Activate default PMs with the activation of the provider.
4) Disable PMs linked to only disabled providers.
5) Add multi editing to list view of PMs.

task-3557315

closes odoo/odoo#139641

closes odoo/odoo#140084

Related: odoo/enterprise#49551
Related: odoo/enterprise#49729
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-27 16:09:39 +00:00
TSO c5237e1ac1 [FIX] discuss: use the right rtcSession property in activeCall check
Before this commit, since https://github.com/odoo/odoo/pull/137750,
the `RtcSession.channelId` property was removed, which prevented
the "LIVE" state in calls to be displayed (and hidden) in the right
conditions, a missing button in call invitations, and possibly other
bugs.

This was not caught by tests because there is no test for that.

closes odoo/odoo#140082

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-27 16:09:39 +00:00
Rodolpho Lima 2074c7e714 [FIX] web_editor: open powerbox in mass_mailing
Steps to reproduce:
- Edit a mailing (mass_mailing)
- Click the save icon
- Type to '/' to open the Powerbox (it does not...)

The `getPowerboxElement` function fails to return the correct node
because `this.options.document` is no longer the iframe document after
the Wysiwyg component is re-rendered. This happens because when the
Wysiwyg component has its props updated, its `options.document` is
overwritten by its default option (the top document).

This commit makes sure that, when the editor is mounted inside an
iframe, `options.document` evaluates to the iframe's document throughout
the entirety of the Wysiwyg component lifecycle.

task-3548120

closes odoo/odoo#140075

Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-10-27 16:09:38 +00:00
JF Aubert 848ada778b [FIX] stock: 2 buttons 'validate' in picking view
closes odoo/odoo#140073

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-27 16:09:37 +00:00
Mathias Mathy (MAMA) 4695ae8641 [FIX] repair: populate when create from return
Main changes :
    Force the default picking type when creating a Repair Order
    from a return
Before :
    When creating a Repair Order from a 'return' picking,
    recyled and removed parts location are not assigned,
    which lead to tracebacks and disallow the user to save
    the created repair.
After :
    When creating a Repair Order from a 'return' picking,
    set the repair operation type of the 'return'
    picking's warehouse by default.

closes odoo/odoo#140072

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-27 16:09:36 +00:00
Alexandre Kühn b3c231b1b2 [FIX] mail,*: markup chatbot livechat message
calendar, im_livechat

Before this commit, messages in chatbot conversation were not
properly markup. This comes from changes from [1] that added
trusted insert. Original code in `Record.insert()` makes a model
insertion of the data using the `html` flag. Patches must not
override `static insert()` as only the super call is affected by
the provided `html` flag. For patches to take account of it, they
must instead patch `_insert`, with `_` prefix, which is internally
called by original `Record.insert()`.

In addition:
- `static insert` allows array of data while `static _insert` works
  with data on single record. Patches were designed with data on
  single record, so some code were not working properly
- Signature of `static insert` has been overloaded with new option
  `html: true`, so patches must propagate it. They were only
  propagating `data` and omitting the 2nd paramater, which results
  in omitting provided `html` thus falling back to `html: false`,
  resulting to non-escaping message body

This commit fixes all model patches to override `static _insert`
instead of `static insert`.

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

closes odoo/odoo#140064

Related: odoo/enterprise#49718
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 16:09:34 +00:00
Aaron Bohy 01f03b1e19 [IMP] mail: do not wait for init_messaging at webclient startup
The messaging service starts synchronously and exposes a promise
isReady that is resolved when the call to init_messaging is done.
This is good as this call thus doesn't slow down the services
startup and thus the webclient mount.

Unfortunately, the ChatWindowContainer, which is a main component,
i.e. a child of the WebClient, waits for that promise in its
onWillStart. As a consequence, the webclient can't be mounted
until the rpc returns, which can take a while (in odoo.com, this
rpc lasts ~500ms).

The chat windows being "peripherical components", there's no reason
to block the whole application for them. Instead, the webclient
can be mounted, and when they are ready, the chat windows can be
rendered. This is what this commit does.

Back-port of https://github.com/odoo/odoo/pull/139750/

closes odoo/odoo#140056

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 14:22:14 +00:00
clesgow 1085afd637 [FIX] stock: compute locations for picking partners
Steps to reproduce:
- Enable multi-step reception
- Create a reception in WH/Input
- Open an internal picking further down the chain
- Change its contact

Issue:
The location_id and location_dest_id is getting reset to Operation
type's default locations, which will raise a warning because the
location/dest don't match the ones from the moves anymore.

It was decided to only allow the automatic compute of locations for
draft pickings. Which means :
- Compute will trigger normally when manually creating a picking
- Picking type is readonly outside of draft anyway, so don't change
anything for this change
- Changing locations of a non-draft picking is a risky operation, as
they won't match the moves. So better leave it as a manual change.

closes odoo/odoo#140055

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-27 14:22:13 +00:00
Hugo Carlier (Huca) 074a453611 [IMP] project: add tests for personal stages unlink
This commit adds tests for the new unlink method of project.task.type
model and in particular for the deletion of personal stages.

task-3345132

closes odoo/odoo#140050

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-27 14:22:12 +00:00
Hugo Carlier (Huca) 463f67c22f [IMP] project: adapt tests for project_task_type
After the refactoring of personal stages, some tests are adapted.

task-3345132

Part-of: odoo/odoo#140050
2023-10-27 14:22:12 +00:00
Hugo Carlier (Huca) 2236e5c97c [REF] project, project_todo: refactor personal stages
Personal stages of project.stage records are based on two main field:
- personal_stage_type_ids: the list of all personal stages linked to a
  task (M2M)
- personal_stage_type_id: a computed field (not stored) indicating the
  personal stage of a task for the current user.

When reading a set of project.task records grouped by personal stages,
two options are possible:
- Group the records by personal_stage_type_id (approach used in former
app Notes): in which case the read_group method has to ne rewritten as
it can be used on a non-stored field.
- Group the records by personal_stage_type_ids (approach used in app
Project) in which case, the kanban view has to be overriden to be able
to drag and drop a task between personal stages (which is not possible
by default, when grouping according to a M2M field).

The main evolution proposed by this refactor is to use an hybrid
approach that would:
1. Group the project.task records by personal_stage_type_id
2. Use the read_group with groupby set to 'personal_stage_type_ids' as
this should give the same result.

This would allow to:
- Avoid a complex and costly (performance wise) read_group override
- Avoid an override of the kanban view that is costly to maintain
- Simplify the implementation (and thus readability) of personal stage
management (among which, removal of the model
project.task.stage.personal).

task-3345132

Part-of: odoo/odoo#140050
2023-10-27 14:22:12 +00:00
Adrien Guilliams (adgu) c6bed1a843 [IMP] pos_self_order: display attributes with long text
In this commit, we change the display of product attributes with long
text. Now, if an attribute has a long text (>15 characters),
the attributes will be displayed in 1 column.
We also prevent the user from adding a product with attributes
to the cart if some attributes are not selected.

closes odoo/odoo#140045

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-27 14:22:11 +00:00
Adrien Guilliams (adgu) 9634fd87bb [FIX] point_of_sale, pos_online_payment: fix bug force close session
In this commit we resolve the bug that force close session when
deleting orders in a point_of_sale config. The problem was that we did
not take into account that orders can be canceled when closing
the session. This led to picking move and account move created for
canceled orders which is obviously not wanted.

Part-of: odoo/odoo#140045
2023-10-27 14:22:11 +00:00
Theo VINCENT (thvi) 455c3f8d5b [IMP] pos_self_order, *: receipt tracking number
*: point_of_sale

- Makes the tracking number displayed on frontend receipt (in small `Order: <tracking number>`, preserving the big `<tracking number>` title for kiosk self-order receipt).
- Fixes printing of kiosk self-order receipt after a successful Adyen payment.

closes odoo/odoo#139694

closes odoo/odoo#140044

Task-id: 3570253
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-27 14:22:10 +00:00
David Monnom (moda) e9ce5608dd [IMP] pos_self_order, pos_*: overal improvements & fixes
*:pos_self_order_adyen,pos_adyen,pos_online_payment_self_order

Some overral improvements and fixes

closes odoo/odoo#140041

Related: odoo/enterprise#49707
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2023-10-27 14:22:08 +00:00
Levi Siuzdak (sile) d9c043e9bf [FIX] purchase/sale: filter on company in package computation
Versions:
---------
- 16.0+

Steps to reproduce:
-------------------
1. install stock & purchase;
2. in Inventory settings, enable product packaging;
3. create a packaging for a product;
4. assign the packaging to the current company;
5. switch to a different company;
6. create a purchase order with the product.

Issue:
------
The packaging that gets selected automatically shouldn't be accessible
to the current company (and isn't in the drop-down). Trying to save
the form will return an access error.
Similar issues arise in `sale`.

Cause:
------
726179af78 and
ccdd113260 updated product packaging
onchange methods to computed methods, changing the environment these
fields exist to a `sudo` one. As a consequence, it includes records that
are normally inaccessible.

Solution:
---------
Use the follwing filter before calling `_find_suitable_packaging`:
```python
lambda p: p.product_id.company_id <= p.company_id <= line.company_id
```
- if `p.product_id.company_id` is set, `p.company_id` has to be set too;
- else `p.company_id` has to be `False` or equal to `line.company_id`.

opw-3457782

closes odoo/odoo#140025

X-original-commit: 05f6e91cd9babd8d65e2526a17439a7d81c65fc9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2023-10-27 14:22:03 +00:00
Levi Siuzdak (sile) 10ede45cf5 [FIX] product: keep package.company_id in view
Versions:
---------
- 16.0+

Steps to reproduce:
-------------------
1. install stock;
2. in Inventory settings, enable product packagings;
3. set the company_id of a product to current company;
4. in user settings, remove access to all other companies;
5. from the page of the edited product, add a package;
6. try to save changes.

Problem:
--------
User Error pops up due to incompatible companies on records.

Cause:
------
As of version 16.0, a field with the `groups="base.group_multi_company"`
attribute might as well not exist outside multi-company contexts,
preventing the context that automatically added a company_id to a newly
created package from working properly.

Solution:
---------
Add an invisible field containing the `company_id` with the
`groups="!base.group_multi_company"` attribute.

opw-3457782

X-original-commit: 0e4ae108cc191ca469770c456a341e455d664886
Part-of: odoo/odoo#140025
2023-10-27 14:22:03 +00:00
uso-odoo ecc6066642 [FIX] tools,spreadsheet_account: prevent traceback for day out of month
In the 'Accounting Settings' of 'Fisical Year', When the User tries to set
'February' as a month and the 29th as a Day and Save it, It will allow the user
to save but when the User opens the spreadsheet dashboard in the terminal,
same error will be generated.

Steps To Produce:-

1) Install the 'spreadsheet_account' module
2) Go to Settings -> Accounting
3) In the 'Fiscal Periods' of 'Fiscal Year', In 'Last Day' select
   'February' month and set 29 as a Day
4) Go to the Accounting module, Customer->Invoices
5) In the 'Favorites', Select 'Insert Link in a Spreadsheet'.
6) Open Spreadsheet, Click on the 'Dashboard' Tab

The Error will be generated in Backend(Terminal)

Applying these changes will resolve this issue.

sentry - 4079962029

closes odoo/odoo#140011

X-original-commit: 1323829d3b5e134300f326f86c887f1cad6119f4
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-27 14:22:02 +00:00
Louis (wil) 83ffd5353e [I18N] update translations of BR localizations
closes odoo/odoo#139947

X-original-commit: b0582b4fbc7661805ea3909e939f3e05e99b6eae
Related: odoo/enterprise#49662
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 14:21:59 +00:00
Odoo's Mergebot 4c9c57dfd5 [DRAFT][IMP] *: adapt report layouts to new report editor
Enhanced reports for better compatibility with Odoo 16.4's new Report Editor:

  - Added `<div class="oe_structure"></div>` for user customization.
  - Converted t-field/t-esc/t-out from div to span.
  - Introduced demo data and adjusted t-if/t-else branching.
  - Bundled t-if/elif/else directives for the 'condition selector' UI.
  - Refactored `<t>` nodes in tables where feasible.

task-3447407

closes odoo/odoo#135739

Related: odoo/enterprise#47501
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-10-27 14:21:55 +00:00
Prakash PrajapatiandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> b55018492e [IMP] survey: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:55 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> 95880f43c5 [IMP] stock, _*: adapt to report layout
_* = product_expiry, stock_picking_batch

task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:55 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> a50ffd4fa6 [IMP] repair: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:55 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> e95ea1ab3d [IMP] purchase_requisition: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:55 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> 63c1ccab81 [IMP] product: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:55 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> 809abdf7a1 [IMP] point_of_sale: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:55 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> 967ac550e3 [IMP] mrp, mrp_account: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:54 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> c0d758d142 [IMP] loyalty: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:54 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> 2fc4737cc2 [IMP] event: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:54 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> a45c6c545f [IMP] hr, hr_expense, hr_skills: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:54 +00:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> 0f991a93ef [IMP] account: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:54 +00:00
Djamel Touati 9e638a1ee8 [FIX] stock: prevent a traceback when selecting a package
Steps to reproduce the bug:
- Enable product packing in inventory settings
- Create a storable product “P1”
    - Update the qty with 3 package:
        - Pack 1: Qty 10
        - Pack 2: Qty 10
        - Pack 3: Qty 20

    - Product category: Force Removal Strategy: Least Packages

- Create a SO with 20 units of P1:
    - Confirm → the pack 3 will be selected
    - Validate the delivery

- Create another SO with 10 units of P1
    - Confirm → the pack 1 will be selected
    - Validate the delivery

- Create a second SO with 10 units of P1
    - Confirm

Problem:
A traceback will be triggered:
return len(node.taken_packages) + node.count_remaining / qty_by_package[node.next_index][1] ZeroDivisionError: float division by zero

the issue is related to modifying the “qty_by_package” while iterating
through it. When we use “del” to remove an element, it shortens the list
in real-time. So When we remove an element, the indices of subsequent
elements get shifted, causing a skip of an element. By this why the last
element isn't iterated through correctly.

In the beginning, we have this:
[(6, 15.0), (5, 10.0), (4, 0.0), (7, 0.0)]

after iteration

[(6, 15.0), (5, 10.0), (7, 0.0)]

instead of having this

[(6, 15.0), (5, 10.0)]

Opw-3570784

closes odoo/odoo#139994

X-original-commit: cdd785981b2e7425cafbe4093ece6fdeae40c6ac
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-27 13:02:28 +00:00
Valentin Chevalier 573c689a9b [FIX] sale_product_configurator: exclude product deleted
Before this commit, the product configurator did not handle a deleted
product variant if a product variant had instantly create attribute, but
was deleted from the database.

Now, the product configurator will consider a combination `archived` if
the product variant doesn't exist (based on its id) and its create_mode
is `always`.

opw-3487571

closes odoo/odoo#139986

X-original-commit: 7abeb13ae53962694ec7fb02de133fc3d7a82908
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-10-27 13:02:27 +00:00
Pratik Raval (PRRA) 245d6f00d8 [FIX] survey: fix form view issues
Before this commit:
the scoring field was the only remaining thing in the 'Time and Scoring' Section
which is read-only when `survey_type` is set to 'survey'. so there was no point
of showing the whole section.

After this commit:
The 'Time and Scoring' Section will be invisible if `survey_type` is set to
survey'.

Task-3367524

closes odoo/odoo#139965

X-original-commit: da0927574ed93a532bb59080c7662d9d178d98cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-27 13:02:24 +00:00
Benjamin Vray b5f43b22d4 [FIX] website: fix header overlay with sidebar header
This commit fixes two bugs with the sidebar header.

Steps to reproduce the 1st bug:

- Go to "/shop" and edit the page.
- Click on the header.
- Open the header selector.
- Choose the "sidebar header".
- Bug: infinite loader (or traceback from V16).

Steps to reproduce the 2nd bug:

- Go to "/contactus" and edit the page.
- Click on the header.
- Change the "Header Position" option to "over the content".
- Save the page.
- Go to the homepage and edit the page.
- Click on the header.
- Open the header selector.
- Choose the "sidebar header".
- Save the page.
- Go to /contactus.
- Bug: the "sidebar" header is broken on the "/contactus" page.

The first bug was caused by triggering the deactivation of the "Overlay"
header from a location other than a website.page (in this case, the
"/shop" page in the steps to reproduce). In this place, the "Overlay"
header option isn't available.

However, while trying to fix this, we noticed the second bug => When we
activate the "sidebar" header (which is a general option for all pages),
we were deactivating the "Overlay" header only on the current page (this
option is specific to the page). It was done since this commit [1].
This doesn't make sense because the "Overlay" header should be
deactivated on all pages, not just the current one.

To address this in the simplest way, we modified the CSS so that the
"Overlay" header doesn't have an impact when the sidebar header is
activated. Without this change, we would have needed to add an RPC to
remove the "Overlay" header on all pages, which wouldn't have been worth
it.

[1]: https://github.com/odoo/odoo/commit/618fd49642310c7b97ef3b9e6c01f8f691c7b12f

task-3454161

closes odoo/odoo#139955

X-original-commit: b27279492fea98f2cd6bfba962bfd570e464d361
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
2023-10-27 13:02:23 +00:00
Julien Mougenot 43640ceb1c [FIX] web: use same date in object test
Before this commit, a test in the "objects" test suite failed because
the 2 dates generated to verify equality could potentially be created
in a different millisecond, which would make the test fail.

A first fix simply assumed that patching the date would suffice, but
this did not solve the issue since the time advances normally even for
patched dates.

This fix ensures that the dates have exactly the same values (and
removes the patch which was not necessary anyway).

Runbot task 25596

closes odoo/odoo#139953

X-original-commit: b02d7fe6c4eaee09066cf58d0e9bad91e3a3234d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-10-27 13:02:22 +00:00
Rahul Prajapati 3b1d10f0f1 [FIX] mail: message author name and image pointer style tests
This commit adapts message tests to check pointer style on message author name
and author image.

closes odoo/odoo#139951

X-original-commit: 134b7cc1143faf9275683ae12c2b121ab03aed7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:22 +00:00
Alexandre Kühn af3d6bf4a6 [IMP] mail: chat window dropdown show active background
Before this commit, when the command dropdown was open by clicking
on avatar/chat window header name, the clickable area was the same
as the rest of chat window header.

As a result, the dropdown was shown without some UI to help see the
toggler that is responsible from this dropdown.

This commit highlights the toggler of dropdown when it is open, so
that it looks nicer when the dropdown is open as we clearly see the
toggler of this dropdown.

closes odoo/odoo#139920

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:18 +00:00
Joseph Caburnay 8bbe9c8be3 [FIX] point_of_sale,pos_self_order: correct component prices
In this commit, we are changing the way prices of the components of a combo
product is calculated. The idea is that a combo product's price should behave
similarly as normal products.

This results to a simpler logic in calculating the prices of the components. In
order to get the fraction that will be used to scale the prices of the component
products, the lst_price of the combo product is divided by the total of the
pos.combo.base_price. This ratio is then multiplied to each pos.combo.base_price
to get the pro-rated unit price of each component. We then proceed to normal
calculation of taxes based on the tax configuration of the selected products.

Furthermore, we are now taking into account the extra prices from the selected
attributes. If the orderline is a component of a combo (menu) product, the extra
prices of the attributes are added on top of the prorated unit price, just like
we do with the `pos.combo.line`'s `combo_price`.

E.g.:
```
product.product.1 -> lst_price = 10
A1 -> price_extra = 5
A3 -> price_extra = 3

pos.order.line.1, product.product.1, attributes=[A1,A3]
  -> price_unit = 10 + 5 + 3 = 18
```

One more thing, there is a regression in the combo configurator popup where the
total price of the selection is removed. It should be restored in the future
with calculation that properly follows the description above.

closes odoo/odoo#139915

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2023-10-27 13:02:17 +00:00
Joseph Caburnay 7510441cc3 [FIX] pos_self_order: avoid unnecessary rpc when changing quantity
When changing quantity of a menu order line (from combo product), multiple
(number of components + 1) rpcs are made. It makes sense that when incrementing
a menu order line, the components are also incremented. We, however, make the
rpc whenever one of the line's quantity is incremented. This commit extracts the
incrementer, and we only make the rpc when the incrementer method is done
incrementing all the components.

Part-of: odoo/odoo#139915
2023-10-27 13:02:17 +00:00
Joseph Caburnay 29757d1079 [FIX] pos_self_order: product price when fiscal mapping involves tax incl
This commit introduces a new method in product.product model that can be used to
compute the correct product's unit price when fiscal mapping with price-included
taxes are involved. It is patterned after `computePriceAfterFp`[^1] from the
pos_store.js.

In this commit, the method is used to correctly show the products' prices when
making a self order.

[^1]: https://github.com/odoo/odoo/blob/b726842e472b5ad773f42a19db7b1bd8a9506786/addons/point_of_sale/static/src/app/store/pos_store.js#L978

Part-of: odoo/odoo#139915
2023-10-27 13:02:17 +00:00
yhu-odoo dbfbc3a185 [FIX] stock: use quantity from new move_id
`quantity` on sm is depended on `quantity` on sml. When create new
sml, `quantity` of sm will always be 0. To fix it, we use origin sm in
the compute function to get correct value.

closes odoo/odoo#139913

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-10-27 13:02:15 +00:00
Zelong Lin 45ac37425b [FIX] mail: broken AutoresizeInput style
hovering and focusing style is lost.

closes odoo/odoo#139911

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:14 +00:00
Guillaume-gdi 895414bf67 [FIX] web_editor: reload iframe when header change on controller pages
When a user browses a website, he can visit two types of pages:
- Static page: the page is a website.page record.
- Dynamic / controller page: the page isn't a website.page (e.g. /shop).

Some options are only available on static pages, like the option to
make the header over the content. Since [this other commit], when a user
change the header template, the editor activate/deactivate an extra
options in addition to the header template change. The problem is that
this extra option may be available only on static pages, and the option
to change the header template is available on all pages.

Before this commit, if the extra option is not available, we stop the
process, the page was not reloaded and the user didn't see the new
header template. Now, we just ignore the extra option without stopping
the process, so the page is reloaded and the user see the new header.

Steps to reproduce the issue fixed by this commit:
- Go to /shop
- Edit
- Change the header template

=> The header template is not changed.

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

task-3572277

closes odoo/odoo#139896

Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-27 13:02:13 +00:00
Jorge Pinna Puissant 49548e9a8c [IMP] base, test_assetsbundle: avoid parsing broken XML
Before this commit, the `recover` parameter is used when parsing the xml
files. The issue with this, is that it will allow and parse broken XML
files, and the error messages in JS will not be related to the issue on
the broken XML.

Now, the parser is stricter, and the broken template will be replaced
with an error template with a compressive error message of the parsing
error.

closes odoo/odoo#139818

Task-id: 3420400
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-10-27 13:02:12 +00:00
Maryam Kia 9c8d39d1a8 [IMP] account, helpdesk,...: same title for all portal chatters
By this commit, all portal chatters have a same title as `Communication history`

closes odoo/odoo#139735

Related: odoo/enterprise#49566
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:10 +00:00
snd 3554a5c826 [FIX] stock: correctly show detailed operations on incoming pickings
Since the move_line_nosuggest_ids field has been removed, there's no alternative to show on
the detailed operations of incoming pickings. The only alternative is to show move_line_ids_without_package
at all times.

closes odoo/odoo#139907

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-10-27 11:35:09 +00:00
Alexandre Kühn 47be118fb1 [FIX] mail: message reply-to click area should match cursor feedback
Before this commit, when a message is a reply to another message,
the whole row of the message reply-to was clickable to highlight the
reply-to message.

This is ok when the click happens on the actual reply-to message
above the message, but when the content of the reply-to message
is short, the click area extends to more than the "clickable" cursor
show, so that click on thread view hightlights the reply-to message
when it shouldn't.

The `cursor-pointer` style was already correctly shown only the the
actual part of the reply-to message. But the `t-on-click` was more
generous and considered the whole row in the thread view.

This commit fixes the issue by matching the `t-on-click` with the
intentional clickable area, matching the `cursor-pointer` that was
correct.

closes odoo/odoo#139906

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 11:35:08 +00:00
Denis Ledoux c75147bb1e [IMP] mail: restrict create for internal same as write & read
Before this revision, an employee could create a discuss channel
with whatever setup he wants.
Which is fine. The critical part is for an employee to not be able
to join an existing restricted channel.
But creating a channel is not a problem.

However, he would be able to create a channel for which
he doesn't have access, meaning he creates the channel
and then no longer see it, which is not user-friendly.

closes odoo/odoo#139903

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 11:35:07 +00:00
Alexandre Kühn b88ecba36f [IMP] mail: improve label of button to toggle style of email message
Before this commit, when a message is of type email, the button to
toggle between adjusted content style with webclient theme and the
original email style was labelled "Show Original Email" and
"Don't show original Email".

This label is confusing, as it gives the impression that this button
opens a new screen or removes a UI element. This button only alters
the visual of the message, that is the style, so the label should
be better worded to tell that.

This commit rename the label to "Show Original/Custom Format", so that
it's clearer what this button actually does.

closes odoo/odoo#139901

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 11:35:06 +00:00