Wednesday, December 14, 2022
50 changes · master
Enhancements to existing features
Timesheets now show the company next to an employee's name when the same user is linked to employees in multiple companies, reducing confusion. Portal users can also click related projects, tasks, and sales order lines when they have access, making it faster to reach the right records.
Original PR description
The purpose of this commit is to make generic improvements in timesheets. So in this commit following changes are made: -Currently, when employees in different companies are related to same user, the name of all those employees are same which can be confusing. So in timesheet, name of the company is displayed next to employee name when a user is related to multiple employees. -In timesheets portal, the project, task and SOL fields are made clickable (if user has access to the record) redirecting to the corresponding record in portal. task-2813765 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update makes manufacturing information easier to review by showing additional planning fields on bills of materials, including lead time and preparation days. It also improves list views by showing total bill of materials times when grouped and asking for confirmation before cancelling manufacturing orders from the list, helping teams avoid mistakes and plan work more clearly.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The Sales settings help text now points users to the correct Accounting tab on products for invoice email template settings. This reduces confusion for staff configuring product-related invoicing emails.
Original PR description
The tooltip for the setting module_product_email_template refers to a setting in the Sales tab of the product, but this has been moved to the Accounting tab in v15. Due to stable policy, this is fixed in master
Point of Sale settings now include a direct documentation link for configuring Adyen payment terminals. This makes it easier for users to find setup guidance alongside other supported terminal options.
Original PR description
add documentation link for adyen terminal in point of sale settings, similar to the other payment terminals related: https://github.com/odoo/enterprise/pull/34948 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update enables the stock barcode area to be included in automated code quality checks. It helps maintain consistency and reduce future maintenance issues without changing user-facing workflows.
Original PR description
Enterprise PR: [#33600](https://github.com/odoo/enterprise/pull/33600) task-3048127
The Discuss public page now shows a debug icon when debug mode is active. This makes it easier for users and support teams to confirm when the page is running in debug mode without needing extra checks.
Original PR description
**Current behavior before PR:** There is no debug icon in Discuss Public Page to show whether debug mode is on or not. **Desired behavior after PR is merged:** Added a debug icon which will be visible when debug mode is on. Task-2664824 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Odoo now keeps the interface blocked while certain actions redirect and reload the current page. This prevents users from thinking an operation is finished and trying to interact with the system while the reload is still in progress.
Original PR description
An act_url action in target "self" redirects the current window/tab to the given url. It always reloads the page, except when only the hash or query string changes. This commit blocks the ui when the…
An act_url action in target "self" redirects the current window/tab to the given url. It always reloads the page, except when only the hash or query string changes. This commit blocks the ui when the page reloads, because there's a lack of feedback and interacting with the ui is unnecessary anyway. For instance, module operations (install, remove and update) end with page reload. During the operation, the ui is already blocked because the operation takes time. After the operation and before the page is actually reloaded, the ui is unblocked. As the reload also takes time because of asset rebuilding, it makes false feeling for the user that operation completes and interface is ready for interaction. With this commit ui is blocked until the page is reloaded. Co-authored-by: Aaron Bohy <aab@odoo.com> Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Manufacturing teams can now see occupancy percentages directly in the work order planning view, making capacity easier to understand. The update also makes work orders easier to find and lets employees close the work-order employee popup more easily.
Polish companies can now use exchange rates from the National Bank of Poland as their default source. The system applies the prior day's rate to align with Polish regulatory requirements for transaction exchange rates.
Original PR description
- Add National Bank of Poland as currency rate provider and set it as default provider for PL companies. - Polish regulations require to use the rate from a day before the transaction is done. This is achieved by offsetting the rate date by one day. Task: 2928985
Point of Sale settings now include a direct documentation link for Worldline payment terminals, matching the guidance already available for other terminal providers. This makes it easier for users to find setup instructions when configuring Worldline payments.
Original PR description
add documentation link for worldline terminal in point of sale settings, similar to the other payment terminals. related: https://github.com/odoo/odoo/pull/107900
Invoice scan processing now checks supplier names more carefully before matching them to existing partners. This reduces incorrect matches when similar location or company words appear in supplier names, helping invoices link to the right vendor more reliably.
Original PR description
There are still some issues with the partner matching on the client side. For example, when a city or a country is mentioned in the supplier name, it can be wrongly match to another supplier from the same place. ex: 'Ikea Brussels' can be matched with 'City of Brussels'. To provide this from happening, and be more selective in the matches, several things have been done. - 2 new fields were added on account.move to store the layout_id & supplier name found by the OCR. (`extract_detected_layout` and `extract_partner_name`) - If no partner was found based on the VAT, we try to find one based on the layout (and the previously found by the OCR partner name). - When looking for a partner from an IBAN, we now verify that the name of the partner is also close enough. - To estimate if the words are close enough, we use the ratio method from the difflib library. task-3084906
Resolved issues and error corrections
Small fixes were made to internal web tooling scripts so they handle file paths and folder changes more safely. This reduces the chance of maintenance scripts failing unexpectedly when developers work on the web module.
Original PR description
A few small tweaks/fixes in the `web` tooling's scripts following advices from `shellcheck`. Ref: https://www.shellcheck.net/
Code cleanup and technical improvements
Miscellaneous changes
Some demo mass mailing are set currently set as being "in queue" in demo data. This means they are about to be send by the mailing cron. However we don't want demo data to send emails as * most of those emails are fake (e.g. targeting example.com); * real emails should not be sent (e.g. having by mistake a real email that will be spammed); * statistics resulting from those emails will not have any wow effect; * on SaaS this consumes email quota, and produces quite a big volume o
Original PR description
Some demo mass mailing are set currently set as being "in queue" in demo data. This means they are about to be send by the mailing cron. However we don't want demo data to send emails as * most of those emails are fake (e.g. targeting example.com); * real emails should not be sent (e.g. having by mistake a real email that will be spammed); * statistics resulting from those emails will not have any wow effect; * on SaaS this consumes email quota, and produces quite a big volume of unnecessary emails when people try the 16.0 version; It is better to either have demo data of mailings done with traces, or keep other mailings in draft. Otherwise the cron will send them. Flagging those mailings is difficult, as emails are sent asynchronously and not during install or update. Even if this may lessen wow effect of some kanban view, better move mailings currently "in queue" to "draft". Forward-Port-Of: odoo/odoo#107853
This update reorganizes point of sale and related localization/payment modules into Odoo's newer JavaScript module format. It is an internal preparation step that should reduce future merge conflicts and make upcoming modernization work easier, without intended changes to day-to-day POS behavior.
Original PR description
*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos, l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer, pos_epson_printer_restaurant, pos_hr, pos_loyalty, pos_mercury, pos_restaurant, pos_restaurant_adyen, pos_restaurant_stripe, pos_sale, pos_sale_product_configurator, pos_six, pos_stripe We are about to refactor most of the Javasript code base of the point of sale and related modules. In doing so, we will move a lot of files and modernize the entire code-base. In order to avoid diffcult rebases, their conversion to odoo-modules is done as a first step to avoid getting lots of conflicts on files that were unindented, which marks the entire file as being in conflict. Conflicts will occur during forward ports but they will be easier to manage as the changes will be much smaller in scope, and the author will have the context of the change that causes the conflict in mind when dealing with it.
Spreadsheet dashboard data is now prepared earlier when dashboards are loaded, helping keep dashboard behavior consistent with related enterprise changes. A shared empty spreadsheet structure was also centralized for reuse, reducing duplication and supporting maintainability.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: linked enterprise PR: https://github.com/odoo/enterprise/pull/34567 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Spreadsheet documents and templates are now prepared before the spreadsheet screen opens, so the interface receives ready-to-use data instead of handling backend storage details. This reduces complexity in the Documents spreadsheet flow and should make future improvements easier and less error-prone without changing the core user experience.
This change converts several Point of Sale related modules to a newer internal JavaScript module format ahead of a broader modernization effort. It is not intended to change business functionality, but it should make future updates easier to deliver and reduce conflicts during ongoing development.
Original PR description
*: l10n_de_pos_cert, l10n_de_pos_res_cert, pos_hr_mobile, pos_iot, pos_l10n_se, pos_restaurant_iot, pos_settle_due We are about to refactor most of the Javasript code base of the point of sale and related modules. In doing so, we will move a lot of files and modernize the entire code-base. In order to avoid diffcult rebases, their conversion to odoo-modules is done as a first step to avoid getting lots of conflicts on files that were unindented, which marks the entire file as being in conflict. Conflicts will occur during forward ports but they will be easier to manage as the changes will be much smaller in scope, and the author will have the context of the change that causes the conflict in mind when dealing with it.
Computing the recurrences of a task repeating every X months until a certain date generates too much dates Steps to reproduce: 1. Install Project 2. Go to Settings > Project > Tasks Management and enable Recurring Tasks 3. Open any project in the Project app and create a new task then edit it 4. Enable the Recurrent field of the task 5. In the Recurrence tab, edit: - Repeat Every: 6 Months - Until: End Date: one year from now 6. The recurrence message says there are 11 tasks but
Original PR description
Computing the recurrences of a task repeating every X months until a certain date generates too much dates Steps to reproduce: 1. Install Project 2. Go to Settings > Project > Tasks Management and…
Computing the recurrences of a task repeating every X months until a certain date generates too much dates Steps to reproduce: 1. Install Project 2. Go to Settings > Project > Tasks Management and enable Recurring Tasks 3. Open any project in the Project app and create a new task then edit it 4. Enable the Recurrent field of the task 5. In the Recurrence tab, edit: - Repeat Every: 6 Months - Until: End Date: one year from now 6. The recurrence message says there are 11 tasks but there should only be 2 Solution: Generate the recurrences until the `repeat_until` date is reached if the `repeat_type` is 'until', otherwise generate as much recurrences as the count Also relax the constraint on the `repeat_day` and `repeat_until` to not raise an error if `repeat_until` is the last day of the month Problem: The recurrence of a task with `repeat_unit` month and `repeat_interval` different than 1 with a `repeat_type` until creates too much tasks, exceeding the `repeat_until` opw-3076593 Forward-Port-Of: odoo/odoo#107836 Forward-Port-Of: odoo/odoo#106596
Steps to reproduce - Install Accounting - Create user and employee, "user_acc", with Accounting-Accounting and no Expense rights - Take the expense in "To Submit" state for the employee different than user_acc and create report - Save the report. Bug - We get the error that required field 'name' is not set and expense lines disappear. task - 3099142 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -
Original PR description
Steps to reproduce - Install Accounting - Create user and employee, "user_acc", with Accounting-Accounting and no Expense rights - Take the expense in "To Submit" state for the employee different than user_acc and create report - Save the report. Bug - We get the error that required field 'name' is not set and expense lines disappear. task - 3099142 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107848
opw-3040171 opw-3071238 Forward-Port-Of: odoo/odoo#107648
Original PR description
opw-3040171 opw-3071238 Forward-Port-Of: odoo/odoo#107648
A `ZeroDivisionError` traceback that occurs in `delivery/DeliveryCarrier:_get_packages_from_order` was caught by Sentry Because in this part of the function https://github.com/odoo/odoo/blob/c18064d717312287f5acba2fabeb77b2e1c01fb9/addons/delivery/models/delivery_carrier.py#L326-L335 if `total_weight === 0.0` then `total_full_packages` and `last_package_weight` will be null too. And that will cause a `ZeroDivisionError` because of `total / len([])` The traceback on Sentry: ![image]
Original PR description
A `ZeroDivisionError` traceback that occurs in `delivery/DeliveryCarrier:_get_packages_from_order` was caught by Sentry Because in this part of the function https://github.com/odoo/odoo/blob/c18064d717312287f5acba2fabeb77b2e1c01fb9/addons/delivery/models/delivery_carrier.py#L326-L335 if `total_weight === 0.0` then `total_full_packages` and `last_package_weight` will be null too. And that will cause a `ZeroDivisionError` because of `total / len([])` The traceback on Sentry:  opw-3086602 Forward-Port-Of: odoo/odoo#107389
This revision is related to odoo/enterprise#33088 The needs is the same: While using Studio, instead of removing the node from the view when the user is not part of the group, set the node as invisible. This is so the xpath expressions computed by Studio takes into account nodes which are removed from the view when the user is not part of the group required by the node. e.g. ```xml <form> <group> <field name="name"/> <field name="currency_id" groups="base.group_multi
Original PR description
This revision is related to odoo/enterprise#33088 The needs is the same: While using Studio, instead of removing the node from the view when the user is not part of the group, set the node as…
This revision is related to odoo/enterprise#33088
The needs is the same:
While using Studio,
instead of removing the node from the view
when the user is not part of the group,
set the node as invisible.
This is so the xpath expressions computed by Studio takes into account nodes which are removed from the view when the user is not part of the group required by the node.
e.g.
```xml
<form>
<group>
<field name="name"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="foo"/>
</group>
</form>
```
With the above view, if you want to add a new field after `<field name="foo"`/>
and the `currency_id` field node is removed from the view during the post-processing of the view
because the user doesn't have the group,
Studio computed the xpath expression with `field[2]`, and then the new field was mis-placed,
it was before the `foo` field instead of after.
The strategy is to let the nodes, as invisible,
for which the user doesn't have the groups
so the xpath expression is correctly computed
for the view as it is stored in the database/
before the post-processing step removing the nodes.
The above revision applies this strategy for
nodes other than `<field/>` and `<t/>`.
The `<field>` were not included because it was,
at that time, believed it wasn't necessary.
Even though the index was wrong as demonstrated
in the above example, it was then converted
with the expression `field[@name="foo"]`
instead of `field[2]`, and therefore it was
fine not to include the `field` nodes
in the strategy.
Also, fields were not included in the strategy
because for them, if the `groups` is set
in the Python model
e.g.
```py
currency_id = fields.Many2one(..., groups='base.group_multi_currency')
```
Attempting to read them while you don't have the group will lead to an AccessError exception.
And there was no way to display the field as invisible in the view without the web client to try to read its content.
Unfortunately, it isn't the case,
as demonstrated by the tours included in this revision, field nodes must be included in the views, as invisible, so Studio can compute correctly the xpath expression.
This revision therefore aims to apply the same strategy for `field` nodes, make them invisible instead of removing them from the view when the user is not part of the groups. The revision takes care to override the web client so it doesn't try to read the value of group-protected fields when the user doesn't have the group.
So the field, with the label and everything,
is included in the view, but its content/value is left empty, as the user cannot read the content.
Technically, there won't be many cases, because
users editing views using Studio are admins,
and in most-cases admins have access to these group-protected fields. Having a field group-protected to which the admins do not belong doesn't happen that often.
Co-authored-by: kebeclibre <lpe@odoo.com>
Forward-Port-Of: odoo/odoo#107429- On the settings view; - Open the CRM settings; - Click on "Update Probabilities" button; - Change the "consider leads created as of the" date; - Click on "Confirm" button; Before this commit, the fields on the settings related to the dialog were not updated. This occurs because, as the setting model is a transient model, the settings view should always perform an onchange to fetch the view, and it wasn't the case here. Now, we patch the basic model used on the settings view to remove
Original PR description
- On the settings view; - Open the CRM settings; - Click on "Update Probabilities" button; - Change the "consider leads created as of the" date; - Click on "Confirm" button; Before this commit, the fields on the settings related to the dialog were not updated. This occurs because, as the setting model is a transient model, the settings view should always perform an onchange to fetch the view, and it wasn't the case here. Now, we patch the basic model used on the settings view to remove the res_id, to consider the record always as new. This will always perform an onchange to fetch the data. Note that, this hack is the same as it was done before the owl migration. opw-3073124 Forward-Port-Of: odoo/odoo#107818
Before this commit the canceled lines would not filter out from checks for completeness of the statements and also the corrections in split wizard consider canceled lines as real values. One of the results of this is when the user import statements with some duplicate lines, the duplicates are canceled but the statement stays complete regardless of the missing lines. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odo
Original PR description
Before this commit the canceled lines would not filter out from checks for completeness of the statements and also the corrections in split wizard consider canceled lines as real values. One of the results of this is when the user import statements with some duplicate lines, the duplicates are canceled but the statement stays complete regardless of the missing lines. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#105708
The linked overtime record was not deleted when deleting a time off. Meaning that those hours were lost. task-3097259 Forward-Port-Of: odoo/odoo#107713
Original PR description
The linked overtime record was not deleted when deleting a time off. Meaning that those hours were lost. task-3097259 Forward-Port-Of: odoo/odoo#107713
Before [1], the bus was started lazily: either as a consequence of the addition of a channel to listen to or by manually calling the `startPolling` method. Before this commit, the websocket would have been started as soon as the bus service starts which degrades performances. This PR fixes the issue by re-introducing the same mechanism as before that is by starting the websocket either by calling manually the `start` method of the bus service or automatically when adding a channel. [1]:
Original PR description
Before [1], the bus was started lazily: either as a consequence of the addition of a channel to listen to or by manually calling the `startPolling` method. Before this commit, the websocket would have been started as soon as the bus service starts which degrades performances. This PR fixes the issue by re-introducing the same mechanism as before that is by starting the websocket either by calling manually the `start` method of the bus service or automatically when adding a channel. [1]: odoo#75510 Forward-Port-Of: odoo/odoo#107749
No view is available for the mobile form of change.password.wizard. The default behavior of the framework is to generate one using the backend model. This result on showing some hidden fields to the user, some of them (like in this case `Wizard Id`) is impossible to fill in. opw-3027797 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107857
Original PR description
No view is available for the mobile form of change.password.wizard. The default behavior of the framework is to generate one using the backend model. This result on showing some hidden fields to the user, some of them (like in this case `Wizard Id`) is impossible to fill in. opw-3027797 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107857
In some case, we want that chatter takes the all space available. Steps to reproduce: - Go to Email Marketing - Click on any record - Go to the Chat tab Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107919
Original PR description
In some case, we want that chatter takes the all space available. Steps to reproduce: - Go to Email Marketing - Click on any record - Go to the Chat tab Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107919
get_working_duration can't work on generated samples. task: 3098709 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107743
Original PR description
get_working_duration can't work on generated samples. task: 3098709 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107743
**Description of the issue/feature this PR addresses:** The `pos_config_main` record is being created during upgrades. Causing issues[^1] at no apparent added benefit. **Current behavior before PR:** If previously deleted by the customer, the `pos_config_main` record is added during upgrades. **Desired behavior after PR is merged:** `pos_config_main` won't be created during upgrades. [^1]: https://upgrade.odoo.com/web#active_id=421039&cids=1&id=421039&menu_id=107&model=upgrade.
Original PR description
**Description of the issue/feature this PR addresses:** The `pos_config_main` record is being created during upgrades. Causing issues[^1] at no apparent added benefit. **Current behavior before PR:** If previously deleted by the customer, the `pos_config_main` record is added during upgrades. **Desired behavior after PR is merged:** `pos_config_main` won't be created during upgrades. [^1]: https://upgrade.odoo.com/web#active_id=421039&cids=1&id=421039&menu_id=107&model=upgrade.request&view_type=form --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107858 Forward-Port-Of: odoo/odoo#107716
Now that some bugfixes have reduced (if not removed) unwanted recomputations of the cost (`purchase_price`) field on `sale.order.line` records, we can 'safely' allow manual modification of the field value, as the manual value won't be lost magically on record updates anymore. Revert the commit making the field readonly, and forward-port the two useful fixes from earlier versions. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odo
Original PR description
Now that some bugfixes have reduced (if not removed) unwanted recomputations of the cost (`purchase_price`) field on `sale.order.line` records, we can 'safely' allow manual modification of the field value, as the manual value won't be lost magically on record updates anymore. Revert the commit making the field readonly, and forward-port the two useful fixes from earlier versions. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107775
**Current behavior before PR:** Emoji data are all in English. Unable to use in other languages. **Desired behavior after PR is merged:** Emoji names and keywords are translatable for search and display purposes. Emoji category names are translateable for display. Task-3043336 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#104619
Original PR description
**Current behavior before PR:** Emoji data are all in English. Unable to use in other languages. **Desired behavior after PR is merged:** Emoji names and keywords are translatable for search and display purposes. Emoji category names are translateable for display. Task-3043336 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#104619
When it comes to closing POS sessions, both the frontend and the backend currently have some way to prevent the same operations from executing simultaneously because of repeated clicks. `closeSession` in the frontend has a `closeSessionClicked` boolean that prevents the operation from triggering multiple times at once. `close_session_from_ui` in the backend checks if the session state isn't already `closed`. A flaw in the current logic is that `update_closing_control_state_session`, which is
Original PR description
When it comes to closing POS sessions, both the frontend and the backend currently have some way to prevent the same operations from executing simultaneously because of repeated clicks.…
When it comes to closing POS sessions, both the frontend and the backend currently have some way to prevent the same operations from executing simultaneously because of repeated clicks. `closeSession` in the frontend has a `closeSessionClicked` boolean that prevents the operation from triggering multiple times at once. `close_session_from_ui` in the backend checks if the session state isn't already `closed`. A flaw in the current logic is that `update_closing_control_state_session`, which is called by the frontend before `close_session_from_ui`, doesn't check the session state before writing it to be `closing_control`. This means that if you time things in such a way that the `closeSession` logic in the frontend triggers again right after it finishes, it will call `update_closing_control_state_session` and `close_session_from_ui` again, which will happily close the session again, duplicating stock moves and account moves resulting from it. This fix has `update_closing_control_state_session` check if the session is already closed and raises a UserError if so. This prevents the duplicate closings and records from happening. There were two variants in the UI I observed when the issue occurred: the first is when the repeated execution of `update_closing_control_state_session` and `close_session_from_ui` successfully finished. In that case the session would be closed with duplicate stock moves and journal entries. In the second variant, from the repeated calls only `update_closing_control_state_session` executed but not `close_session_from_ui`. This could happen if the timing of the frontend was such that it redirected to the POS dashboard before it was able to call `close_session_from_ui`. In that case, the session would be in the `closing_control` state, which is visible in the POS dashboard . If the user then closed the session, it would be closed twice and the duplicate records would again be created. opw-2988701 Forward-Port-Of: odoo/odoo#107873
Odoo sh needs the update channel event to always come first. This PR ensures it will always be the case. Forward-Port-Of: odoo/odoo#107925
Original PR description
Odoo sh needs the update channel event to always come first. This PR ensures it will always be the case. Forward-Port-Of: odoo/odoo#107925
When clicking on a star from the (3|5)-stars widgets, the stars light up in yellow to reflect a rating. We weren't making a history step when this happened, meaning that an undo or a rollback of anything that happened just after clicking, would undo that rating change as well. task-3084709 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107655
Original PR description
When clicking on a star from the (3|5)-stars widgets, the stars light up in yellow to reflect a rating. We weren't making a history step when this happened, meaning that an undo or a rollback of anything that happened just after clicking, would undo that rating change as well. task-3084709 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107655
The table of content (TOC) has two mechanisms that interest us here: The first one is ScrollSpy (from Bootstrap) which allows (among other things) to bold the menu items according to the scroll. The second one is a mutation Observer which is implemented to regenerate the menu when the content of the TOC changes. This being said, when we edit the TOC and scroll at the same time, there is a race condition that makes ScrollSpy want to add a class to a menu item while this menu has just b
Original PR description
The table of content (TOC) has two mechanisms that interest us here: The first one is ScrollSpy (from Bootstrap) which allows (among other things) to bold the menu items according to the scroll. The…
The table of content (TOC) has two mechanisms that interest us here: The first one is ScrollSpy (from Bootstrap) which allows (among other things) to bold the menu items according to the scroll. The second one is a mutation Observer which is implemented to regenerate the menu when the content of the TOC changes. This being said, when we edit the TOC and scroll at the same time, there is a race condition that makes ScrollSpy want to add a class to a menu item while this menu has just been regenerated by the observer. The error is only visible since the migration from bootstrap 4 to bootstrap 5 because to add the class, bootstrap 4 did it with the JQuery `addClass()` function which does not cause an error if the element on which it is called does not exist. Now, bootstrap 5 does the same thing in pure JS with `classList.add()` which causes an error if the element on which it is called is not defined. This commit fixes this error by disabling the ScrollSpy when you regenerate the menu. Steps to reproduce the error: - drop a table of content block - drag a snippet around and go over the drop zones => traceback. It can appear directly or after some tries. While this bug was being fixed, another one was discovered: Since [this commit], when dropping several "table of content" blocks on the same page, it was impossible to save. This commit solves this problem. Steps to reproduce the resolved bug: - In edit mode, drop two TOC blocks - Click on Save => the UI is blocked [this commit]: https://github.com/odoo/odoo/commit/06b03ba5ef8375b1236f6ecb52ac468124e910ba task-2948895 opw-3047375 Forward-Port-Of: odoo/odoo#98977
This commit aims at: 1. Fixing a bug where the invoice would be uploaded in the wrong journal To reproduce: - Go to Customer invoices - Upload an invoice (with an embedded FacturX) - The journal is set to Vendor Bill 2. Letting the FacturX move type override the user-chosen move type Currently, if the user uploads a credit note in a customer invoice journal, the document is not created and set to the OCR. This is due to a restrictive check which has been removed. Therefore, when
Original PR description
This commit aims at: 1. Fixing a bug where the invoice would be uploaded in the wrong journal To reproduce: - Go to Customer invoices - Upload an invoice (with an embedded FacturX) - The journal is…
This commit aims at: 1. Fixing a bug where the invoice would be uploaded in the wrong journal To reproduce: - Go to Customer invoices - Upload an invoice (with an embedded FacturX) - The journal is set to Vendor Bill 2. Letting the FacturX move type override the user-chosen move type Currently, if the user uploads a credit note in a customer invoice journal, the document is not created and set to the OCR. This is due to a restrictive check which has been removed. Therefore, when the move type is defined in the FacturX XML, we will use it to override the user choice so that the document is always created within the right journal. 3. Harmonizing the invoice upload between the Accounting and the Documents apps and avoid code duplication Currently, the flow of uploading an invoice from the Accounting app and the Documents app is different. Indeed, if one uploads an invoice in the Document app and click on the "Create invoice", the document is sent directly to the OCR. Now, instead, we will pass this document to the same upload method of the Accounting (which will try to create the invoice from the FacturX XML if present). Therefore, the flow will now be the same from the two apps for better harmonization. 4. Adding a 4th button in the Documents app to create a Vendor refund Currently, there are 3 buttons to create a customer invoice, a credit note, a vendor bill, but no vendor refund. This is due to a duplicate xmlid which has now been fixed allowing the 4th button to be seen in the UI. 5. Adding a button "Switch into customer invoice/vendor bill" button in the account.move's form view Currently, the user has access to a "Switch into credit note/refund" but not the reverse button to go from a credit note/refund to an invoice/bill. This is now the case. Task id 2961932 Enterprise PR: https://github.com/odoo/enterprise/pull/32890 Forward-Port-Of: odoo/odoo#101280 Forward-Port-Of: odoo/odoo#99247
Steps to reproduce: - Create a price list with different currency and discount with "show price and discount to the customer" - On the website select this pricelist and register for the event. Issue: The price in the cart is shown in the main currency Solution: [website_event_sale] There is an initial issue which when it calls '_compute_price_reduce'. We compare, 'product.lst_price' (in product.currency) and 'product.price' (which has been converted to the pricelist.currency). In ord
Original PR description
Steps to reproduce: - Create a price list with different currency and discount with "show price and discount to the customer" - On the website select this pricelist and register for the event. Issue:…
Steps to reproduce: - Create a price list with different currency and discount with "show price and discount to the customer" - On the website select this pricelist and register for the event. Issue: The price in the cart is shown in the main currency Solution: [website_event_sale] There is an initial issue which when it calls '_compute_price_reduce'. We compare, 'product.lst_price' (in product.currency) and 'product.price' (which has been converted to the pricelist.currency). In order to compare apples with apples, a conversion is applied to have the 'product.lst_price' in the same currency. After that, we have kind of a coherent behaviour in the sense that 'ticket.price_reduce' is in the same currency as 'ticket.price'. Thereafter, a conversion is applied (if the pricelist.currency is different) to get the expected amount. The same reasoning is applied to [website_event_booth_sale]. Note: 'list_price' has been changed to 'lst_price' in Booth to have the same logic between Event and Booth opw-2766997 Forward-Port-Of: odoo/odoo#101375 Forward-Port-Of: odoo/odoo#85640
Start a server without a -d and with a --dbfilter that allows for multiple database. Make sure one of the database has the `base_import_module` addon installed. Create an empty module using scaffold and deploy it to the server, make sure to provide the `--db` argument to the deploy command. It zips the file and attempt to upload it but it fails for a 404 page not found error. The problem is that the controllers of base_import_module are only accessible when the client is connected to a dat
Original PR description
Start a server without a -d and with a --dbfilter that allows for multiple database. Make sure one of the database has the `base_import_module` addon installed. Create an empty module using scaffold…
Start a server without a -d and with a --dbfilter that allows for multiple database. Make sure one of the database has the `base_import_module` addon installed. Create an empty module using scaffold and deploy it to the server, make sure to provide the `--db` argument to the deploy command. It zips the file and attempt to upload it but it fails for a 404 page not found error. The problem is that the controllers of base_import_module are only accessible when the client is connected to a database. It must first connect to a database (to have a db in his session) and then access the controller. The /web/login route is an example of a rather cheap route to get that is both accessible without being connected to a database and that takes a `?db=` argument to connect to one. Using that route, we can ensure that we are connected to a database prior to uploading a module. Closes #104589 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107279 Forward-Port-Of: odoo/odoo#104642
currently in the kanban view of the apps, the install button is renamed to activate from https://github.com/odoo/odoo/commit/c70984f4031612d64872fcc12e89c35f03e7d2b2, but still in the form and action(in tree), button is still labelled as "Install", so unifying the label of button to "Activate" in tree, form and action. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107181
Original PR description
currently in the kanban view of the apps, the install button is renamed to activate from https://github.com/odoo/odoo/commit/c70984f4031612d64872fcc12e89c35f03e7d2b2, but still in the form and action(in tree), button is still labelled as "Install", so unifying the label of button to "Activate" in tree, form and action. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107181
Before this commit, there were two kind of related issues with the AutoComplete component, involving an "Enter" keydown. 1) Click in an empty Autocomplete input s.t. the (only) source has no option, then press "Enter" -> crash 2) Enter something in an Autocomplete input s.t. there are results in the dropdown, then update the input again s.t. the (only) source has no option, then press "Enter" -> crash This commit fixes those two issues by 1) Ensuring that we don't store in th
Original PR description
Before this commit, there were two kind of related issues with the AutoComplete component, involving an "Enter" keydown. 1) Click in an empty Autocomplete input s.t. the (only) source has no option, then press "Enter" -> crash 2) Enter something in an Autocomplete input s.t. there are results in the dropdown, then update the input again s.t. the (only) source has no option, then press "Enter" -> crash This commit fixes those two issues by 1) Ensuring that we don't store in the state an option index that's out of range with respect to the current available options 2) Reseting the options when reloading the sources. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107869
Steps to reproduce: - Go to Point of Sale app. - Create a new order with many items in it (until you need to scroll). - Go to Orders > Click on 'All active orders' and select 'Paid'. - Scroll through the items in the right. Issue: The total summary has a transparent background, so it will overlap with the items inside the order and make less clear to visualize the total. Solution: Added the `background: inherit` to the `summary` class in the pos.scss so we get the right backgro
Original PR description
Steps to reproduce: - Go to Point of Sale app. - Create a new order with many items in it (until you need to scroll). - Go to Orders > Click on 'All active orders' and select 'Paid'. - Scroll through the items in the right. Issue: The total summary has a transparent background, so it will overlap with the items inside the order and make less clear to visualize the total. Solution: Added the `background: inherit` to the `summary` class in the pos.scss so we get the right background that we need for this view. FW - port: master opw-3093131 Forward-Port-Of: odoo/odoo#107626
Currently `_compute_bulk_weight` and `_compute_weight` go through each picking in self and each stock_move_line in picking.move_line_ids to compute the pickings' weights. This can be slow when there are lots of move_lines by picking as the field cache will be filled by the move_lines records and `uom._compute_quantity` will be called once by move_line. This is especially true for pickings with SN-tracked products. For SN tracked products there will be one move_line by product_qty (so a pic
Original PR description
Currently `_compute_bulk_weight` and `_compute_weight` go through each picking in self and each stock_move_line in picking.move_line_ids to compute the pickings' weights. This can be slow when there…
Currently `_compute_bulk_weight` and `_compute_weight` go through each picking in self and each stock_move_line in picking.move_line_ids to compute the pickings' weights. This can be slow when there are lots of move_lines by picking as the field cache will be filled by the move_lines records and `uom._compute_quantity` will be called once by move_line. This is especially true for pickings with SN-tracked products. For SN tracked products there will be one move_line by product_qty (so a picking with 1 SN tracked product with a qty of 100 will have 100 move_lines). In this case doing a read_group yields the highest speedup. Adding an `orderby = 'qty_done asc'` in the read_groups prevents the default ordering by groupby fields. This default ordering may require to join on some other tables to retrieve the required columns. In this case, leaving the default orderby leads to a query with 4 Left Joins (on product_product, product_template, ir_translation and stock_quant_package). Since the ordering is not really useful here, we can "drop" it by setting a dummy one. The resulting `GROUP BY` query is 2-3 times faster that way. Following the same reasoning a search_count is done in `_compute_packages` before retrieving package.move_line_ids. When package.move_line_ids.result_package_id is empty doing a count is much faster as it avoids calling _in_cache_without for the package move_line_ids. The search_count overhead is negligeable in the other case so adding it leads to an overall speedup on average. #### speedup 15.2 customer DB with 19 300 stock_pickings, 913 000 stock_move_lines, 208 products (5 by SN, 155 by lot). stock_move_lines by picking (min, avg, max): 1, 48, 71832. distinct product_id by picking (min, avg, max): 1, 2, 138. Receipts (picking_type_id = 7) ListView search_read time increasing search_read limit. No stock_move_line with result_package_id != NULL for this picking type. | Limit | Before PR | After PR | |:-----:|:----------:|:---------:| | 5 | 140ms | 116ms | | 25 | 1.15s | 161ms | | 80 | 8.80s | 266ms | | 183 | 42.23s | 447ms | This benchmark comes from a 15.2 DB but the results should be close for a 14.0 DB. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#107892 Forward-Port-Of: odoo/odoo#107558
Steps to reproduce - enable dev mode - select any field in studio - click on more to edit the field Bug: Not possible to scroll in this view Fix: set overflow on that view's CSS opw-3018224 Forward-Port-Of: odoo/enterprise#34148
Original PR description
Steps to reproduce - enable dev mode - select any field in studio - click on more to edit the field Bug: Not possible to scroll in this view Fix: set overflow on that view's CSS opw-3018224 Forward-Port-Of: odoo/enterprise#34148
This commit adds some background color to the sidebar progress indication for the case when 0 hours have been planned. Prior to this fix, the text would have a transparent background resulting in overlapping text. Forward-Port-Of: odoo/enterprise#34329
Original PR description
This commit adds some background color to the sidebar progress indication for the case when 0 hours have been planned. Prior to this fix, the text would have a transparent background resulting in overlapping text. Forward-Port-Of: odoo/enterprise#34329
Bug === Since 99a8c96532f14afa7bf639290c421b599035d7bf , we used the argument `placeholder` which does not exist with the method `_placeholder_path` which doesn't exist as well... Removing this make social instagram work. Task-3099520 Forward-Port-Of: odoo/enterprise#34929
Original PR description
Bug === Since 99a8c96532f14afa7bf639290c421b599035d7bf , we used the argument `placeholder` which does not exist with the method `_placeholder_path` which doesn't exist as well... Removing this make social instagram work. Task-3099520 Forward-Port-Of: odoo/enterprise#34929
This PR aims at: 1. Harmonizing the invoice upload between the Accounting and the Documents apps and avoid code duplication Currently, the flow of uploading an invoice from the Accounting app and the Documents app is different. Indeed, if one uploads an invoice in the Document app and click on the "Create invoice", the document is sent directly to the OCR. Now, instead, we will pass this document to the same upload method of the Accounting (which will try to create the invoice from the
Original PR description
This PR aims at: 1. Harmonizing the invoice upload between the Accounting and the Documents apps and avoid code duplication Currently, the flow of uploading an invoice from the Accounting app and the…
This PR aims at: 1. Harmonizing the invoice upload between the Accounting and the Documents apps and avoid code duplication Currently, the flow of uploading an invoice from the Accounting app and the Documents app is different. Indeed, if one uploads an invoice in the Document app and click on the "Create invoice", the document is sent directly to the OCR. Now, instead, we will pass this document to the same upload method of the Accounting (which will try to create the invoice from the FacturX XML if present). Therefore, the flow will now be the same from the two apps for better harmonization. 2. Adding a 4th button in the Documents app to create a Vendor refund Currently, there are 3 buttons to create a customer invoice, a credit note, a vendor bill, but no vendor refund. This is due to a duplicate xmlid which has now been fixed allowing the 4th button to be seen in the UI. Task id 2961932 Community PR:https://github.com/odoo/odoo/pull/103427 Forward-Port-Of: odoo/enterprise#31846 Forward-Port-Of: odoo/enterprise#30879
Go to Contacts > switch to map view > search for "fox" s.t. there's only one record displayed > click on its pin > in the popup, click on "Open". Before this commit, there were 2 issues: 1) it opened the form view in readonly, whereas it should be editable like any other form views (this comes from the switch to "always-edit" form views) 2) in debug mode, it crashed because the FormController doesn't know the props "model". This commit removes the two faulty props from the
Original PR description
Go to Contacts > switch to map view > search for "fox" s.t. there's only one record displayed > click on its pin > in the popup, click on "Open". Before this commit, there were 2 issues:
1) it opened the form view in readonly, whereas it should be
editable like any other form views (this comes from the switch
to "always-edit" form views)
2) in debug mode, it crashed because the FormController doesn't
know the props "model".
This commit removes the two faulty props from the switchView request.
Forward-Port-Of: odoo/enterprise#34935…ton_section is clickable Have a kanban arch that defines its dropdown only with the class "o_kanban_manage_button_section". Enter studio, click on the dropdown ellipsis icon. Before this commit, there was a crash as the xpath of the dropdown was not set. After this commit, the dropdown is fully recognized as such. Forward-Port-Of: odoo/enterprise#34891
Original PR description
…ton_section is clickable Have a kanban arch that defines its dropdown only with the class "o_kanban_manage_button_section". Enter studio, click on the dropdown ellipsis icon. Before this commit, there was a crash as the xpath of the dropdown was not set. After this commit, the dropdown is fully recognized as such. Forward-Port-Of: odoo/enterprise#34891
This revision is related to odoo/enterprise#33088 The needs is the same: While using Studio, instead of removing the node from the view when the user is not part of the group, set the node as invisible. This is so the xpath expressions computed by Studio takes into account nodes which are removed from the view when the user is not part of the group required by the node. e.g. ```xml <form> <group> <field name="name"/> <field name="currency_id" groups="base.grou
Original PR description
This revision is related to odoo/enterprise#33088 The needs is the same: While using Studio, instead of removing the node from the view when the user is not part of the group, set the node as…
This revision is related to odoo/enterprise#33088
The needs is the same:
While using Studio,
instead of removing the node from the view
when the user is not part of the group,
set the node as invisible.
This is so the xpath expressions computed by Studio takes into account nodes which are removed from the view when the user is not part of the group required by the node.
e.g.
```xml
<form>
<group>
<field name="name"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="foo"/>
</group>
</form>
```
With the above view, if you want to add a new field after `<field name="foo"`/>
and the `currency_id` field node is removed from the view during the post-processing of the view
because the user doesn't have the group,
Studio computed the xpath expression with `field[2]`, and then the new field was mis-placed,
it was before the `foo` field instead of after.
The strategy is to let the nodes, as invisible,
for which the user doesn't have the groups
so the xpath expression is correctly computed
for the view as it is stored in the database/
before the post-processing step removing the nodes.
The above revision applies this strategy for
nodes other than `<field/>` and `<t/>`.
The `<field>` were not included because it was,
at that time, believed it wasn't necessary.
Even though the index was wrong as demonstrated
in the above example, it was then converted
with the expression `field[@name="foo"]`
instead of `field[2]`, and therefore it was
fine not to include the `field` nodes
in the strategy.
Also, fields were not included in the strategy
because for them, if the `groups` is set
in the Python model
e.g.
```py
currency_id = fields.Many2one(..., groups='base.group_multi_currency')
```
Attempting to read them while you don't have the group will lead to an AccessError exception.
And there was no way to display the field as invisible in the view without the web client to try to read its content.
Unfortunately, it isn't the case,
as demonstrated by the tours included in this revision, field nodes must be included in the views, as invisible, so Studio can compute correctly the xpath expression.
This revision therefore aims to apply the same strategy for `field` nodes, make them invisible instead of removing them from the view when the user is not part of the groups. The revision takes care to override the web client so it doesn't try to read the value of group-protected fields when the user doesn't have the group.
So the field, with the label and everything,
is included in the view, but its content/value is left empty, as the user cannot read the content.
Technically, there won't be many cases, because
users editing views using Studio are admins,
and in most-cases admins have access to these group-protected fields. Having a field group-protected to which the admins do not belong doesn't happen that often.
Co-authored-by: kebeclibre <lpe@odoo.com>
Forward-Port-Of: odoo/enterprise#34752