Daily updates from Odoo
Monday, July 12, 2021
11 changes · master
Enhancements to existing features
Empty lists for assets, deferred revenue, and deferred expenses now show clearer guidance when there are no records to display. Deferred expenses also now include sample entries, making the experience more consistent with deferred revenue and easier for users to understand.
Original PR description
Reword the default message for when a tree view is empty for assets, deferred revenue, and deferred expense as well as their respective models. Also, enable the samples on deferred expenses, to make it consistent with deferred revenue. Task id #2592816
The subscription screen now hides the generate invoice action when the selected payment method would lead to an error, such as manual payment or sending after a successful payment. This prevents users from starting an invoice flow that cannot complete and reduces avoidable support issues.
Original PR description
This PR prevents users from getting an error after clicking on 'generate invoice' button. The button is hidden if the payment method is either manual or send after succesful payment. task-2535878
The marketing automation test suite was updated to align with recent shared testing tool changes in the broader Odoo platform. This is an internal quality improvement that helps ensure future mail and template behavior changes are validated consistently.
Original PR description
Various test tools have been updated in community. This commit updates enterprise code accordingly. Task ID-2377974 Community PR odoo/odoo# 61467 Enterprise PR odoo/enterprise# 14633 Upgrade PR odoo/upgrade# 1907
Resolved issues and error corrections
This fix ensures planning-related toast notifications appear as intended. It helps users receive clear feedback when working with planning schedules, reducing confusion during day-to-day scheduling tasks.
Original PR description
Task-ID: 2557809
Code cleanup and technical improvements
Several Odoo apps were adjusted to work with a reorganized internal service layer for in-app purchases and messaging. This helps keep invoice extraction, expense extraction, payments, signatures, mobile mail, and social notifications compatible with the updated platform foundations without introducing major visible changes for users.
Miscellaneous changes
Without demo data Enterprise part of odoo/odoo#73534 Forward-Port-Of: odoo/enterprise#19591
Original PR description
Without demo data Enterprise part of odoo/odoo#73534 Forward-Port-Of: odoo/enterprise#19591
Forward-Port-Of: odoo/enterprise#19439
Original PR description
Forward-Port-Of: odoo/enterprise#19439
Allow the pos user to use a certified blackbox for his point of sale or restaurant. task-id: 1986405 Forward-Port-Of: odoo/enterprise#18989 Forward-Port-Of: odoo/enterprise#14938
Original PR description
Allow the pos user to use a certified blackbox for his point of sale or restaurant. task-id: 1986405 Forward-Port-Of: odoo/enterprise#18989 Forward-Port-Of: odoo/enterprise#14938
[IMP] sale_amazon: mandate the tracking reference Amazon now required a tracking reference based on the carrier. We decided to force the tracking before the end of the validation because it is impossible to update it afterwards. To do so, we make sure that the Delivery module is installed, since we need the field carrier_tracking_ref. We chose to hook after the request to the carrier is made, so we can know what the reference is, if a carrier respond with one. Doc PR: https://github.c
Original PR description
[IMP] sale_amazon: mandate the tracking reference Amazon now required a tracking reference based on the carrier. We decided to force the tracking before the end of the validation because it is impossible to update it afterwards. To do so, we make sure that the Delivery module is installed, since we need the field carrier_tracking_ref. We chose to hook after the request to the carrier is made, so we can know what the reference is, if a carrier respond with one. Doc PR: https://github.com/odoo/documentation/pull/1059 Community PR: https://github.com/odoo/odoo/pull/72931 Enterprise PR: https://github.com/odoo/enterprise/pull/19065 task-2573260 Forward-Port-Of: odoo/enterprise#19526 Forward-Port-Of: odoo/enterprise#19065
The Subscriptions tree view shows the field `invoice_count` it is a computed field counting invoices related with subscriptions This PR is changing the way to get all them using read_group in order to get all the result using only one faster query with all ids: SELECT min("account_move_line".id) AS id, count("account_move_line".id) AS "subscription_id_count" , COUNT(DISTINCT "account_move_line"."move_id") AS "move_id", "account_move_line"."subscription_id"
Original PR description
The Subscriptions tree view shows the field `invoice_count` it is a computed field counting invoices related with subscriptions This PR is changing the way to get all them using read_group in order…
The Subscriptions tree view shows the field `invoice_count` it is a computed field
counting invoices related with subscriptions
This PR is changing the way to get all them using read_group in order to
get all the result using only one faster query with all ids:
SELECT min("account_move_line".id) AS id,
count("account_move_line".id) AS "subscription_id_count" ,
COUNT(DISTINCT "account_move_line"."move_id") AS "move_id",
"account_move_line"."subscription_id" as "subscription_id"
FROM "account_move_line"
LEFT JOIN "sale_subscription" AS "account_move_line__subscription_id"
ON ("account_move_line"."subscription_id" = "account_move_line__subscription_id"."id")
WHERE ("account_move_line"."subscription_id" in (...))
GROUP BY "account_move_line"."subscription_id","account_move_line__subscription_id"."id"
ORDER BY "account_move_line__subscription_id"."id"
It is showing the following line profile result using 1000 records
in real database:
Total time: 4.20824 s
Line # Hits Time Per Hit % Time Line Contents
==============================================================
250 def _compute_invoice_count(self):
251 1 123.0 123.0 0.0 can_read = self.env['account.move'].check_access_rights('read', raise_exception=False)
252 1 1.0 1.0 0.0 if not can_read:
253 self.update({'invoice_count': 0})
254 return
255 2 750501.0 375250.5 17.8 res = self.env['account.move.line'].read_group(
256 1 216.0 216.0 0.0 [('subscription_id', 'in', self.ids)], ['move_id:count_distinct'], ['subscription_id'], lazy=False)
257 1 165.0 165.0 0.0 invoice_count_dict = {r['subscription_id'][0]: r['move_id'] for r in res}
258 1001 3721.0 3.7 0.1 for subscription in self:
259 1000 3453515.0 3453.5 82.1 subscription.invoice_count = invoice_count_dict.get(subscription.id, 0)
Instead of running too much queries with only one id like original way:
SELECT count(1)
FROM "account_move"
WHERE "account_move"."id" in (SELECT "account_move_line"."move_id"
FROM "account_move_line"
WHERE "account_move_line"."subscription_id" = ID1
ORDER BY "account_move_line"."id")
SELECT count(1)
FROM "account_move"
WHERE "account_move"."id" in (SELECT "account_move_line"."move_id"
FROM "account_move_line"
WHERE "account_move_line"."subscription_id" = ID2
ORDER BY "account_move_line"."id")
... (other N times running these kind of queries for each ID)
It was showing the following line profile result using 1000 records
in real database:
Total time: 404.346 s
Line # Hits Time Per Hit % Time Line Contents
==============================================================
250 def _compute_invoice_count(self):
251 1 23.0 23.0 0.0 Invoice = self.env['account.move']
252 1 102.0 102.0 0.0 can_read = Invoice.check_access_rights('read', raise_exception=False)
253 1001 4651.0 4.6 0.0 for subscription in self:
254 1000 404340821.0 404340.8 100.0 subscription.invoice_count = can_read and Invoice.search_count([('invoice_line_ids.subscription_id', '=', subscription.id)]) or 0
It means, speed-up 100x faster
Forward-Port-Of: odoo/enterprise#19511- Go to Accounting Dashboard - Click on "RECONCILE X ITEMS" button of Bank journal - Look for a line with "Bank Fees" label and click on it - Select Manual Operations tab - There should be a button named "LINE WITH BANK FEES" - Click on the Cog icon (not on the text label) A ValueError is triggered: "ValueError: Expected singleton: account.reconcile.model()" When clicking on the button, "reconcile-model-id" is retrieved from data attributes of the button. But when clicking on the cog
Original PR description
- Go to Accounting Dashboard - Click on "RECONCILE X ITEMS" button of Bank journal - Look for a line with "Bank Fees" label and click on it - Select Manual Operations tab - There should be a button named "LINE WITH BANK FEES" - Click on the Cog icon (not on the text label) A ValueError is triggered: "ValueError: Expected singleton: account.reconcile.model()" When clicking on the button, "reconcile-model-id" is retrieved from data attributes of the button. But when clicking on the cog icon, the target is not the button element but a child. opw-2507717 Forward-Port-Of: odoo/enterprise#19574