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.
closesodoo/odoo#140140
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
1. Install l10n_pos_in
2. Make an order
3. Observer traceback in receipt screen
Similar problem in restaurant ( in bill screen )
closesodoo/odoo#140123
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
quantity_product_uom is a field on stock.move.line
For stock.move, we need to use product_uom_qty.
closesodoo/odoo#140121
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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.
closesodoo/odoo#140114
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
closesodoo/odoo#140106
X-original-commit: d5cf6c6ac7eb7674d6a9c18a23c37ec0861ba258
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
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
closesodoo/odoo#140103
X-original-commit: 2ab61bc841f0281c59e6b87700215b06acf07545
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
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.
closesodoo/odoo#140101
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#133056closesodoo/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>
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.
closesodoo/odoo#140094
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#139859
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
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
closesodoo/odoo#140060
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
closesodoo/odoo#140059
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Steps to reproduce:
- Create a new Maintenance Request
- Set an Equipment
Issue:
In the compute we use `company` instead of `company_id`.
closesodoo/odoo#140062
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#140061
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Following 7e012dd, the express checkout flow stopped working.
This commit makes the express checkout flow works again.
task-3526289
closesodoo/odoo#139854closesodoo/odoo#140085
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
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
closesodoo/odoo#139641closesodoo/odoo#140084
Related: odoo/enterprise#49551
Related: odoo/enterprise#49729
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
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.
closesodoo/odoo#140082
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#140075
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
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.
closesodoo/odoo#140072
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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/139501closesodoo/odoo#140064
Related: odoo/enterprise#49718
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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/closesodoo/odoo#140056
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#140055
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#140050
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
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.
closesodoo/odoo#140045
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
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
*: 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.
closesodoo/odoo#139694closesodoo/odoo#140044
Task-id: 3570253
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
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
closesodoo/odoo#140025
X-original-commit: 05f6e91cd9babd8d65e2526a17439a7d81c65fc9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
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
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
closesodoo/odoo#140011
X-original-commit: 1323829d3b5e134300f326f86c887f1cad6119f4
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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
closesodoo/odoo#135739
Related: odoo/enterprise#47501
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
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
closesodoo/odoo#139994
X-original-commit: cdd785981b2e7425cafbe4093ece6fdeae40c6ac
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>