Commit Graph
167008 Commits
Author SHA1 Message Date
Mathieu Duckerts-Antoine 0ff280ec6d [IMP] web: ExpressionEditor: better conversion of in/not in operators
When foo is not an x2many, a condition of the form
("foo", "in", [])
was transformed by the ExpressionEditor into
"set([foo]).intersection([])"
while it can be better expressed as
"foo in []"

In this commit, we improve the conversion of conditions of that kind and
similar other conditions.

Note that we also ideally want domains and their corresponding expressions
to be evaluated the same ways on records (at least on good examples).
For this we want for instance, the condition
("foo", "in", 1)
to be translated to
"foo in [1]"
and not
"foo in 1"
which is an invalid Python expression.

closes odoo/odoo#140140

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-10-27 21:36:53 +00:00
vlst 3c1d74181a [FIX] pos_restaurant,l10n_in_pos: fix receipt data
1. Install l10n_pos_in
2. Make an order
3. Observer traceback in receipt screen

Similar problem in restaurant ( in bill screen )

closes odoo/odoo#140123

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-27 21:36:52 +00:00
snd 7422b96b2e [FIX] stock: JS error when opening stock move menu
quantity_product_uom is a field on stock.move.line
For stock.move, we need to use product_uom_qty.

closes odoo/odoo#140121

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-27 21:36:51 +00:00
clesgow 3d434ea0d4 [FIX] stock: display forecast widget on deliveries
Steps to reproduce:
- Create a Delivery
- Put any product, some quantity and save

Issue:
The forecast icon disappears as soon as the picking leaves its 'draft'
state.

closes odoo/odoo#140114

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-27 21:36:50 +00:00
Xavier Luyckx (xlu) e24c655105 [FIX] web: stat button border-radius styling
This commit addresses issues related to the border-radius styling for
the `buttonbox` buttons. The main goal was to ensure that the first and
last buttons in the button box bar, whether directly inside the `buttonbox`
or wrapped within a `<div>`, consistently receive the desired border-radius.

Existing CSS rules were not consistently targeting the first and last
buttons, especially when they were wrapped inside `<div>` tags, like the
"Go to website" button or "more" dropdown button.

I also added a z-index-0 to the buttons inside `<div>` tags, so they can
receive the correct border-color on their active state.

This commit resolves this issue.

task-3563305

closes odoo/odoo#140106

X-original-commit: d5cf6c6ac7eb7674d6a9c18a23c37ec0861ba258
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
2023-10-27 21:36:49 +00:00
Xavier Luyckx (xlu) 82de0d7dc4 [FIX] web: stat button active border
Previously in the button box, right borders of stats buttons in their
active state were hidden/not displayed correctly.

This commit addresses and resolves that issue.

task-3568551

closes odoo/odoo#140103

X-original-commit: 2ab61bc841f0281c59e6b87700215b06acf07545
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
2023-10-27 21:36:48 +00:00
Arnold Moyaux d80f4e04c0 [FIX] stock: redirect move lines location dest
Changing the destination location on a picking will:
- Change the dest location of its stock.move
- Not change the dest location of stock.move.line

So it the picking has been reserved, everything will
be send to an incorrect location. On top of it, the
system prevent to select a destination location that
is not a child of the move dest location.

This commit, redirect the location dest on stock.move.line
when the dest location on stock.move change.

closes odoo/odoo#140101

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-27 21:36:47 +00:00
Antoine (anso) 5f7aa80c73 [IMP] sale_product_configurator: redesign of the modal
This commit
- Cleans and optimize the SCSS
- Improves the layout and the spacing of the existing modal
- Improves the input's style (`.o_input`, better pills)
- Sets a fixed height to the modal so it doesn't grow/shrink when
fields are shown/hidden

task-3289240

closes odoo/odoo#133056

closes odoo/odoo#140096

Related: odoo/enterprise#49636
Related: odoo/enterprise#49733
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-27 21:36:46 +00:00
clesgow bd187c35c2 [FIX] stock: update picking validation error
The forms are always in edit mode, so no need to refer to the "edit
mode" anymore.
Also the 'done quantities' no longer exists from the user pov, there's
only a 'quantity' field.

closes odoo/odoo#140094

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-27 21:36:44 +00:00
Chrysanthe (chgo) 25b4836cf4 [FIX] onboarding: dark variables not loaded
This commit fixes an issue about the `onboarding.variables.dark.scss`
file not being taken into account inside the manifest.

Since saas-16.4, there is an issue with the onboarding files.
If you turn on the dark mode, the `.variables.dark` overrides are not
taken into account, but instead display the light mode variables.

This causes readability issue about the text being too dark.

This seems to happen because the dark mode file is already loaded
with the light one.

task-3201038

closes odoo/odoo#140090

X-original-commit: 9e1e72bfff1a8f27513dbb2a2a2aae0213bc78ed
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Chrysanthe Gomrée (chgo) <chgo@odoo.com>
2023-10-27 21:36:42 +00:00
FrancoisGe 5696b5686e [FIX] web: select all records should trigger only one rendered
Purpose:
--------
From the new RelationalModel (odoo/odoo#114024), in the list view, when
all the records are selected, the ListController is rendered once per record.
This causes performance problems and can cause a flicker where each record
is selected one by one.

Why:
----
When selecting all records, we will call record.togggleSelection() on each
record but this function uses a mutex. So each record will be selected
asynchronously. As the state is not modified by the same tick,
a rendering will be triggered for each call to record.togggleSelection.

Solution:
---------
Add a togggleSelection function to the DynamicList which will select all
the records in the same mutex. The state will therefore be modified in
the same tick and there will be a single rendering.

closes odoo/odoo#139859

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-27 20:16:02 +00:00
JF Aubert 0c4d1aee26 [FIX] stock: do not reserve expired lots
The context is given on the stock.move currently. However the
stock.move will not propagate it during _get_reserve_quantity
because it uses the quants in arguement. In other to reach the
gather we just use pass it through the quants object itself

closes odoo/odoo#140060

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-27 18:47:16 +00:00
Arnold Moyaux b50a797390 [FIX] stock: missing synch between stock.move and sml
Currently when you fill quantity on the stock.move and directly click on the details operation button,
you will see move lines based on initial quantity.

It happens due to the inverse of quantity on stock.move that is only trigger on the save (expected).
But in our case, we want to do a save before opening the stock.move.line to have something according to the quantity.
We also only trigger the save when the quantity has been change and the stock.move is open.

+ Hide quantity in draft

closes odoo/odoo#140059

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-27 18:47:15 +00:00
Sébastien Theys 0cd23d4d29 [REF] mail: remove _channel_message_notifications
The method is used only once now, it can be removed.

closes odoo/odoo#140063

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-27 17:29:56 +00:00
clesgow 645c0db68f [FIX] maintenance: use company_id
Steps to reproduce:
- Create a new Maintenance Request
- Set an Equipment

Issue:
In the compute we use `company` instead of `company_id`.

closes odoo/odoo#140062

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-27 17:29:55 +00:00
Rodolpho Lima 8e75dfca3b [FIX] website: set URL when picking from drop-down menu
Steps:
- In website, click on a link to edit it
- Type "/" in the LinkTools URL input field
- Pick a URL among the suggested ones

The chosen URL was supposed to be applied to the link, but it is not.
The same applies for the LinkDialog (create a link with the "/link"
command).

Reason:
It might be a little confusing, but the `_onURLInput` method actually
means "update UI according to the URL" (more specifically, display/hide
the "Open In New Window" and "Autoconvert To Relative Link" buttons).
The `__onURLInput` (two underscores) method, on the other hand, is the
actual handler for input events in the URL field. In this case, picking
a URL from a drop-down menu needs the same treatment as inputting text,
that is, the `state.url` property must be set to the new value.

task-3552700

closes odoo/odoo#140061

Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-10-27 17:29:54 +00:00
Valentin Chevalier a3c6afb2a9 [IMP] payment(_*): make express checkout work again
Following 7e012dd, the express checkout flow stopped working.
This commit makes the express checkout flow works again.

task-3526289

closes odoo/odoo#139854

closes odoo/odoo#140085

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-27 16:09:41 +00:00
Valentin Chevalier 47b20dc6ad [IMP] payment: add the currency on the status page
Part-of: odoo/odoo#140085
2023-10-27 16:09:41 +00:00
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