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>
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
closesodoo/odoo#139986
X-original-commit: 7abeb13ae53962694ec7fb02de133fc3d7a82908
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
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
closesodoo/odoo#139965
X-original-commit: da0927574ed93a532bb59080c7662d9d178d98cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#139955
X-original-commit: b27279492fea98f2cd6bfba962bfd570e464d361
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
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
closesodoo/odoo#139953
X-original-commit: b02d7fe6c4eaee09066cf58d0e9bad91e3a3234d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
This commit adapts message tests to check pointer style on message author name
and author image.
closesodoo/odoo#139951
X-original-commit: 134b7cc1143faf9275683ae12c2b121ab03aed7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#139920
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#139915
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
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
`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.
closesodoo/odoo#139913
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
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
closesodoo/odoo#139896
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
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.
closesodoo/odoo#139818
Task-id: 3420400
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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.
closesodoo/odoo#139907
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
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.
closesodoo/odoo#139906
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#139903
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#139901
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>