Daily updates from Odoo
Tuesday, August 26, 2025
13 changes
3 changes
Enhancements to existing features
Odoo removed an internal database checkpoint used while fetching OCR results for extracted documents. This should reduce performance slowdowns when many OCR updates are processed at once, with minimal impact on everyday document handling.
Original PR description
Very similar to commit 7f7ff8d, see full explanation in that commit message. This savepoint was also initiated in a loop which could cause performances issues when too many of them are active at the same time. This one is much less critical and can be removed without much trouble. It was only allowing to recover from a serialization failure, in the case where a user was concurrently editing a document while it was being updated by the OCR. Forward-Port-Of: odoo/enterprise#93000
This update adds automated checks for point of sale IoT device setup and core device behavior, including Six payment terminal flows. It helps reduce the risk of future changes breaking connected hardware or payment terminal integrations.
Original PR description
*: pos_iot, pos_iot_six In this commit: ------------------ - Loaded data for `iot.box`, `iot.device`, and `iot.channel` to test the complete IoT flow from setup to core device functionalities. - Added payment method records and validated the payment terminal integration using Six. task- 4945645 Related PR: https://github.com/odoo/odoo/pull/220801 Forward-Port-Of: odoo/enterprise#91117
The follow-up process now checks related accounting records in a clearer and safer way. This reduces the risk of internal query confusion and helps keep customer follow-up calculations reliable.
Original PR description
Refactored the SQL construction for checking the existence of related account.move records for res.partner entries. The account.move query is now built separately and referenced explicitly, making the code more readable and reducing the chance of ambiguity in field resolution. Using `SQL.identifier(query.table, "id")` ensures that the correct table is referenced in each condition, which is particularly important when dealing with multiple joins or subqueries. Forward-Port-Of: odoo/enterprise#90304 Forward-Port-Of: odoo/enterprise#83770
3 changes
Enhancements to existing features
This update makes SMS message generation easier to customize for add-on modules. It lets modules provide extra context when rendering SMS bodies, reducing workaround code and improving maintainability without changing the standard user experience.
Original PR description
In add-ons may need to pass additional context to body render function, both `_render_field`, and `_render_template` support this but the `sms.composer` didn't implement a proper way to pass additional context to them. overwrite `_prepare_body_values` for just passing `add_context` to render functions is not a good practice. In this PR I add a `_get_body_additional_context` to it, so any module can overwrite that function to pass additional context to render functions. Forward-Port-Of: odoo/odoo#208355
This change speeds up internal accounting localization tests by temporarily adding database indexes while test data is being removed. It reduces test run time significantly on both local and shared test environments, helping developers validate changes faster without affecting customer-facing functionality.
Original PR description
During the second half of `test_all_l10n`, we keep deleting `account.account` records (hundreds to low thousand every iteration). This deletion turns out to account (heh) for about 15% of the test's…
During the second half of `test_all_l10n`, we keep deleting `account.account` records (hundreds to low thousand every iteration). This deletion turns out to account (heh) for about 15% of the test's run time running locally (5mn out of 30). And per the explain, this is largely from executing `ON DELETE` constraints: since accounts are rarely deleted, the forward-only M2Os (used to go from a record to an account) are not generally indexes, which causes a full scan of the non-account table on deletion of accounts, which... can be quite slow if the non-account table is large, e.g. sample `EXPLAIN ANALYZE` for one of the `DELETE FROM account_account`:
Trigger for constraint account_fiscal_position_account_account_src_id_fkey on account_account: time=30.040 calls=1000
Trigger for constraint account_fiscal_position_account_account_dest_id_fkey on account_account: time=20.977 calls=1000
Trigger for constraint account_account_tax_default_rel_account_id_fkey on account_account: time=16.423 calls=1000
Trigger for constraint account_account_res_company_rel_account_account_id_fkey on account_account: time=18.848 calls=1000
Trigger for constraint account_account_account_tag_account_account_id_fkey on account_account: time=12.396 calls=1000
Trigger for constraint account_journal_default_account_id_fkey on account_account: time=207.759 calls=1000
Trigger for constraint account_journal_suspense_account_id_fkey on account_account: time=131.019 calls=1000
Trigger for constraint account_journal_non_deductible_account_id_fkey on account_account: time=126.656 calls=1000
Trigger for constraint account_journal_profit_account_id_fkey on account_account: time=128.753 calls=1000
Trigger for constraint account_journal_loss_account_id_fkey on account_account: time=125.281 calls=1000
Trigger for constraint res_company_transfer_account_id_fkey on account_account: time=85.604 calls=1000
Trigger for constraint res_company_default_cash_difference_income_account_id_fkey on account_account: time=75.154 calls=1000
Trigger for constraint res_company_default_cash_difference_expense_account_id_fkey on account_account: time=73.173 calls=1000
Trigger for constraint res_company_account_journal_suspense_account_id_fkey on account_account: time=73.336 calls=1000
Trigger for constraint res_company_account_journal_early_pay_discount_gain_accoun_fkey on account_account: time=73.741 calls=1000
Trigger for constraint res_company_account_journal_early_pay_discount_loss_accoun_fkey on account_account: time=73.402 calls=1000
Trigger for constraint res_company_income_currency_exchange_account_id_fkey on account_account: time=74.586 calls=1000
Trigger for constraint res_company_expense_currency_exchange_account_id_fkey on account_account: time=74.678 calls=1000
Trigger for constraint res_company_account_default_pos_receivable_account_id_fkey on account_account: time=77.105 calls=1000
Trigger for constraint res_company_expense_accrual_account_id_fkey on account_account: time=77.000 calls=1000
Trigger for constraint res_company_revenue_accrual_account_id_fkey on account_account: time=76.399 calls=1000
Trigger for constraint res_company_account_cash_basis_base_account_id_fkey on account_account: time=77.996 calls=1000
Trigger for constraint res_company_account_discount_income_allocation_id_fkey on account_account: time=77.799 calls=1000
Trigger for constraint res_company_account_discount_expense_allocation_id_fkey on account_account: time=78.145 calls=1000
Trigger for constraint res_company_income_account_id_fkey on account_account: time=79.625 calls=1000
Trigger for constraint res_company_expense_account_id_fkey on account_account: time=79.421 calls=1000
Trigger for constraint account_tax_group_tax_payable_account_id_fkey on account_account: time=103.659 calls=1000
Trigger for constraint account_tax_group_tax_receivable_account_id_fkey on account_account: time=75.211 calls=1000
Trigger for constraint account_tax_group_advance_tax_payment_account_id_fkey on account_account: time=72.384 calls=1000
Trigger for constraint account_tax_cash_basis_transition_account_id_fkey on account_account: time=954.139 calls=1000
Trigger for constraint account_tax_repartition_line_account_id_fkey on account_account: time=1445.578 calls=1000
Trigger for constraint account_reconcile_model_line_account_id_fkey on account_account: time=71.619 calls=1000
Trigger for constraint account_move_line_account_id_fkey on account_account: time=140.720 calls=1000
Trigger for constraint account_payment_outstanding_account_id_fkey on account_account: time=17.682 calls=1000
Trigger for constraint account_payment_destination_account_id_fkey on account_account: time=6.791 calls=1000
Trigger for constraint account_payment_method_line_payment_account_id_fkey on account_account: time=75.530 calls=1000
Trigger for constraint account_analytic_line_general_account_id_fkey on account_account: time=81.989 calls=1000
Trigger for constraint account_automatic_entry_wizard_destination_account_id_fkey on account_account: time=8.967 calls=1000
Trigger for constraint account_payment_register_writeoff_account_id_fkey on account_account: time=9.166 calls=1000
Trigger for constraint account_accrued_orders_wizard_account_id_fkey on account_account: time=7.863 calls=1000
Trigger for constraint account_account_account_merge_wizard_re_account_account_id_fkey on account_account: time=7.338 calls=1000
Trigger for constraint account_merge_wizard_line_account_id_fkey on account_account: time=7.706 calls=1000
Trigger for constraint res_company_deferred_expense_account_id_fkey on account_account: time=126.271 calls=1000
Trigger for constraint res_company_deferred_revenue_account_id_fkey on account_account: time=98.607 calls=1000
Trigger for constraint account_account_account_auto_reconcile__account_account_id_fkey on account_account: time=8.921 calls=1000
Trigger for constraint account_reconcile_wizard_account_id_fkey on account_account: time=8.330 calls=1000
Trigger for constraint account_model_rel_account_account_id_fkey on account_account: time=27.264 calls=1000
Trigger for constraint account_transfer_model_line_account_id_fkey on account_account: time=39.033 calls=1000
Trigger for constraint account_fiscal_position_avatax_invoice_account_id_fkey on account_account: time=83.360 calls=1000
Trigger for constraint account_fiscal_position_avatax_refund_account_id_fkey on account_account: time=60.023 calls=1000
Trigger for constraint account_account_account_import_summary__account_account_id_fkey on account_account: time=8.251 calls=1000
Trigger for constraint res_company_account_revaluation_expense_provision_account__fkey on account_account: time=107.339 calls=1000
Trigger for constraint res_company_account_revaluation_income_provision_account_i_fkey on account_account: time=100.037 calls=1000
Trigger for constraint account_account_exclude_res_currency_pr_account_account_id_fkey on account_account: time=9.025 calls=1000
Trigger for constraint account_report_budget_item_account_id_fkey on account_account: time=7.600 calls=1000
Trigger for constraint account_payment_withholding_line_account_id_fkey on account_account: time=7.814 calls=1000
Trigger for constraint res_company_withholding_tax_base_account_id_fkey on account_account: time=116.893 calls=1000
Trigger for constraint account_payment_register_withholding_outstanding_account_i_fkey on account_account: time=8.580 calls=1000
Trigger for constraint account_payment_register_withholding_line_account_id_fkey on account_account: time=8.799 calls=1000
Trigger for constraint res_company_l10n_ee_rounding_difference_loss_account_id_fkey on account_account: time=115.461 calls=1000
Trigger for constraint res_company_l10n_ee_rounding_difference_profit_account_id_fkey on account_account: time=114.827 calls=1000
Trigger for constraint account_journal_l10n_tr_default_sales_return_account_id_fkey on account_account: time=305.506 calls=1000
Trigger for constraint res_company_account_production_wip_account_id_fkey on account_account: time=125.388 calls=1000
Trigger for constraint res_company_account_production_wip_overhead_account_id_fkey on account_account: time=117.769 calls=1000
Trigger for constraint stock_location_valuation_in_account_id_fkey on account_account: time=104.378 calls=1000
Trigger for constraint stock_location_valuation_out_account_id_fkey on account_account: time=67.309 calls=1000
Trigger for constraint stock_valuation_layer_revaluation_account_id_fkey on account_account: time=8.817 calls=1000
Trigger for constraint res_company_l10n_fr_rounding_difference_loss_account_id_fkey on account_account: time=127.732 calls=1000
Trigger for constraint res_company_l10n_fr_rounding_difference_profit_account_id_fkey on account_account: time=124.773 calls=1000
Trigger for constraint res_company_l10n_in_withholding_account_id_fkey on account_account: time=124.847 calls=1000
Trigger for constraint res_company_l10n_nl_rounding_difference_loss_account_id_fkey on account_account: time=131.094 calls=1000
Trigger for constraint res_company_l10n_nl_rounding_difference_profit_account_id_fkey on account_account: time=132.013 calls=1000
Trigger for constraint mrp_workcenter_expense_account_id_fkey on account_account: time=14.578 calls=1000
Trigger for constraint mrp_account_wip_accounting_line_account_id_fkey on account_account: time=8.530 calls=1000
Trigger for constraint account_payment_force_outstanding_account_id_fkey on account_account: time=11.336 calls=1000
Trigger for constraint pos_payment_method_outstanding_account_id_fkey on account_account: time=11.554 calls=1000
Trigger for constraint pos_payment_method_receivable_account_id_fkey on account_account: time=6.654 calls=1000
Trigger for constraint pos_close_session_wizard_account_id_fkey on account_account: time=7.825 calls=1000
Trigger for constraint res_company_downpayment_account_id_fkey on account_account: time=137.312 calls=1000
Trigger for constraint res_company_l10n_bd_corporate_tax_liability_fkey on account_account: time=143.026 calls=1000
Trigger for constraint res_company_l10n_bd_corporate_tax_expense_fkey on account_account: time=141.801 calls=1000
Trigger for constraint account_move_l10n_de_datev_main_account_id_fkey on account_account: time=3874.682 calls=1000
Trigger for constraint stock_landed_cost_lines_account_id_fkey on account_account: time=14.898 calls=1000
Trigger for constraint account_account_account_asset_rel_account_account_id_fkey on account_account: time=9.640 calls=1000
Trigger for constraint account_asset_account_asset_id_fkey on account_account: time=11.687 calls=1000
Trigger for constraint account_asset_account_depreciation_id_fkey on account_account: time=6.551 calls=1000
Trigger for constraint account_asset_account_depreciation_expense_id_fkey on account_account: time=6.300 calls=1000
Trigger for constraint res_company_gain_account_id_fkey on account_account: time=210.699 calls=1000
Trigger for constraint res_company_loss_account_id_fkey on account_account: time=180.965 calls=1000
Trigger for constraint asset_modify_account_asset_id_fkey on account_account: time=10.665 calls=1000
Trigger for constraint asset_modify_account_asset_counterpart_id_fkey on account_account: time=5.466 calls=1000
Trigger for constraint asset_modify_account_depreciation_id_fkey on account_account: time=5.353 calls=1000
Trigger for constraint asset_modify_account_depreciation_expense_id_fkey on account_account: time=5.438 calls=1000
Trigger for constraint res_company_l10n_ae_tax_report_liabilities_account_fkey on account_account: time=176.808 calls=1000
Trigger for constraint res_company_l10n_ae_tax_report_expenses_account_fkey on account_account: time=172.302 calls=1000
Trigger for constraint res_company_l10n_ae_tax_report_asset_account_fkey on account_account: time=170.480 calls=1000
Trigger for constraint res_company_l10n_ar_tax_base_account_id_fkey on account_account: time=171.774 calls=1000
Trigger for constraint soda_account_mapping_account_id_fkey on account_account: time=9.239 calls=1000
Trigger for constraint res_company_l10n_ec_tax_base_sale_account_id_fkey on account_account: time=176.779 calls=1000
Trigger for constraint res_company_l10n_ec_tax_base_purchase_account_id_fkey on account_account: time=175.159 calls=1000
Trigger for constraint account_loan_long_term_account_id_fkey on account_account: time=13.823 calls=1000
Trigger for constraint account_loan_short_term_account_id_fkey on account_account: time=7.044 calls=1000
Trigger for constraint account_loan_expense_account_id_fkey on account_account: time=5.934 calls=1000
Trigger for constraint res_company_l10n_cl_factoring_counterpart_account_id_fkey on account_account: time=193.722 calls=1000
Trigger for constraint res_company_exemption_doctor_master_account_id_fkey on account_account: time=201.309 calls=1000
Trigger for constraint res_company_exemption_bachelor_account_id_fkey on account_account: time=200.476 calls=1000
Trigger for constraint res_company_exemption_bachelor_capping_account_id_fkey on account_account: time=200.465 calls=1000
Trigger for constraint res_company_partner_id_fkey on res_company: time=0.208 calls=10
Trigger for constraint res_company_currency_id_fkey on res_company: time=0.018 calls=10
Trigger for constraint res_company_paperformat_id_fkey on res_company: time=0.014 calls=10
Trigger for constraint res_company_create_uid_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_write_uid_fkey on res_company: time=0.009 calls=10
Trigger for constraint res_company_resource_calendar_id_fkey on res_company: time=0.023 calls=10
Trigger for constraint res_company_transfer_account_id_fkey on res_company: time=0.002 calls=9
Trigger for constraint res_company_default_cash_difference_income_account_id_fkey on res_company: time=0.055 calls=10
Trigger for constraint res_company_default_cash_difference_expense_account_id_fkey on res_company: time=0.030 calls=10
Trigger for constraint res_company_account_journal_suspense_account_id_fkey on res_company: time=0.002 calls=8
Trigger for constraint res_company_account_journal_early_pay_discount_gain_accoun_fkey on res_company: time=0.002 calls=7
Trigger for constraint res_company_account_journal_early_pay_discount_loss_accoun_fkey on res_company: time=0.001 calls=4
Trigger for constraint res_company_income_currency_exchange_account_id_fkey on res_company: time=0.029 calls=10
Trigger for constraint res_company_expense_currency_exchange_account_id_fkey on res_company: time=0.001 calls=5
Trigger for constraint res_company_batch_payment_sequence_id_fkey on res_company: time=0.016 calls=10
Trigger for constraint res_company_account_default_pos_receivable_account_id_fkey on res_company: time=0.001 calls=2
Trigger for constraint res_company_account_fiscal_country_id_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_income_account_id_fkey on res_company: time=0.002 calls=6
Trigger for constraint res_company_expense_account_id_fkey on res_company: time=0.001 calls=3
Trigger for constraint res_company_deferred_expense_account_id_fkey on res_company: time=0.000 calls=1
Trigger for constraint res_company_nomenclature_id_fkey on res_company: time=0.012 calls=10
Trigger for constraint res_company_internal_transit_location_id_fkey on res_company: time=0.014 calls=10
Trigger for constraint res_company_stock_mail_confirmation_template_id_fkey on res_company: time=0.013 calls=10
Trigger for constraint res_company_documents_fleet_folder_fkey on res_company: time=0.016 calls=10
Trigger for constraint res_company_documents_hr_folder_fkey on res_company: time=0.010 calls=10
Trigger for constraint res_company_documents_employee_folder_id_fkey on res_company: time=0.011 calls=10
Trigger for constraint res_company_documents_project_folder_id_fkey on res_company: time=0.009 calls=10
Trigger for constraint res_company_stock_sms_confirmation_template_id_fkey on res_company: time=0.012 calls=10
Trigger for constraint res_company_recruitment_folder_id_fkey on res_company: time=0.010 calls=10
Trigger for constraint res_company_project_time_mode_id_fkey on res_company: time=0.019 calls=10
Trigger for constraint res_company_timesheet_encode_uom_id_fkey on res_company: time=0.011 calls=10
Trigger for constraint res_company_internal_project_id_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_leave_timesheet_task_id_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_rental_loc_id_fkey on res_company: time=0.011 calls=10
Trigger for constraint res_company_l10n_ch_delegate_country_id_fkey on res_company: time=0.013 calls=10
Trigger for constraint res_company_l10n_eg_annual_leave_type_id_fkey on res_company: time=0.014 calls=10
Accumulated across the entire test:
account_account_account_asset_rel_account_account_id_fkey: 367.89
account_account_account_auto_reconcile__account_account_id_fkey: 369.314
account_account_account_import_summary__account_account_id_fkey: 308.894
account_account_account_merge_wizard_re_account_account_id_fkey: 258.345
account_account_account_tag_account_account_id_fkey: 437.58
account_account_exclude_res_currency_pr_account_account_id_fkey: 364.079
account_account_res_company_rel_account_account_id_fkey: 676.195
account_account_tax_default_rel_account_id_fkey: 616.155
account_accrued_orders_wizard_account_id_fkey: 281.117
account_analytic_line_general_account_id_fkey: 2920.52
account_asset_account_asset_id_fkey: 435.021
account_asset_account_depreciation_expense_id_fkey: 225.966
account_asset_account_depreciation_id_fkey: 243.045
account_automatic_entry_wizard_destination_account_id_fkey: 333.281
account_fiscal_position_account_account_dest_id_fkey: 764.004
account_fiscal_position_account_account_src_id_fkey: 1127.7
account_fiscal_position_avatax_invoice_account_id_fkey: 2903.72
account_fiscal_position_avatax_refund_account_id_fkey: 2243.92
account_journal_default_account_id_fkey: 8123.53
account_journal_l10n_tr_default_sales_return_account_id_fkey: 13035
account_journal_loss_account_id_fkey: 4810.37
account_journal_non_deductible_account_id_fkey: 5057.85
account_journal_profit_account_id_fkey: 5063.26
account_journal_suspense_account_id_fkey: 5492.64
account_loan_expense_account_id_fkey: 222.776
account_loan_long_term_account_id_fkey: 553.955
account_loan_short_term_account_id_fkey: 259.905
account_merge_wizard_line_account_id_fkey: 265.135
account_model_rel_account_account_id_fkey: 927.993
account_move_l10n_de_datev_main_account_id_fkey: 122923
account_move_line_account_id_fkey: 4000.68
account_payment_destination_account_id_fkey: 265.653
account_payment_force_outstanding_account_id_fkey: 459.209
account_payment_method_line_payment_account_id_fkey: 2660.46
account_payment_outstanding_account_id_fkey: 575.21
account_payment_register_withholding_line_account_id_fkey: 319.363
account_payment_register_withholding_outstanding_account_i_fkey: 383.508
account_payment_register_writeoff_account_id_fkey: 341.615
account_payment_withholding_line_account_id_fkey: 286.658
account_reconcile_model_line_account_id_fkey: 2608.16
account_reconcile_wizard_account_id_fkey: 309.389
account_report_budget_item_account_id_fkey: 300.099
account_tax_cash_basis_transition_account_id_fkey: 31329.6
account_tax_group_advance_tax_payment_account_id_fkey: 2629.35
account_tax_group_tax_payable_account_id_fkey: 3554.27
account_tax_group_tax_receivable_account_id_fkey: 2772.1
account_tax_repartition_line_account_id_fkey: 47923.3
account_transfer_model_line_account_id_fkey: 1309.84
asset_modify_account_asset_counterpart_id_fkey: 207.683
asset_modify_account_asset_id_fkey: 454.126
asset_modify_account_depreciation_expense_id_fkey: 189.258
asset_modify_account_depreciation_id_fkey: 192.029
mrp_account_wip_accounting_line_account_id_fkey: 305.605
mrp_workcenter_expense_account_id_fkey: 565.317
pos_close_session_wizard_account_id_fkey: 285.536
pos_payment_method_outstanding_account_id_fkey: 432.131
pos_payment_method_receivable_account_id_fkey: 249.401
res_company_account_cash_basis_base_account_id_fkey: 5195.51
res_company_account_default_pos_receivable_account_id_fkey: 5357.29
res_company_account_discount_expense_allocation_id_fkey: 5113.98
res_company_account_discount_income_allocation_id_fkey: 5151.48
res_company_account_fiscal_country_id_fkey: 1
res_company_account_journal_early_pay_discount_gain_accoun_fkey: 5640.61
res_company_account_journal_early_pay_discount_loss_accoun_fkey: 5489.35
res_company_account_journal_suspense_account_id_fkey: 5811.88
res_company_account_production_wip_account_id_fkey: 8351.27
res_company_account_production_wip_overhead_account_id_fkey: 7914.54
res_company_account_revaluation_expense_provision_account__fkey: 8858.1
res_company_account_revaluation_income_provision_account_i_fkey: 8169.02
res_company_batch_payment_sequence_id_fkey: 0.995
res_company_create_uid_fkey: 2.96
res_company_currency_id_fkey: 1.081
res_company_default_cash_difference_expense_account_id_fkey: 6060.06
res_company_default_cash_difference_income_account_id_fkey: 6404.5
res_company_deferred_expense_account_id_fkey: 10447.3
res_company_deferred_revenue_account_id_fkey: 8923.24
res_company_documents_employee_folder_id_fkey: 0.875
res_company_documents_fleet_folder_fkey: 1.374
res_company_documents_hr_folder_fkey: 0.829
res_company_documents_project_folder_id_fkey: 0.779
res_company_downpayment_account_id_fkey: 8009.08
res_company_exemption_bachelor_account_id_fkey: 10964.3
res_company_exemption_bachelor_capping_account_id_fkey: 10860.6
res_company_exemption_doctor_master_account_id_fkey: 11117
res_company_expense_account_id_fkey: 5124.13
res_company_expense_accrual_account_id_fkey: 5246.67
res_company_expense_currency_exchange_account_id_fkey: 5352.77
res_company_external_report_layout_id_fkey: 0.308
res_company_gain_account_id_fkey: 14196.4
res_company_income_account_id_fkey: 5136.8
res_company_income_currency_exchange_account_id_fkey: 5441.56
res_company_internal_project_id_fkey: 1.151
res_company_internal_transit_location_id_fkey: 1.019
res_company_l10n_ae_tax_report_asset_account_fkey: 10908.2
res_company_l10n_ae_tax_report_expenses_account_fkey: 11365.8
res_company_l10n_ae_tax_report_liabilities_account_fkey: 11898.4
res_company_l10n_ar_tax_base_account_id_fkey: 10648.4
res_company_l10n_bd_corporate_tax_expense_fkey: 8098.52
res_company_l10n_bd_corporate_tax_liability_fkey: 8176.24
res_company_l10n_ch_delegate_country_id_fkey: 0.864
res_company_l10n_cl_factoring_counterpart_account_id_fkey: 10872.3
res_company_l10n_ec_tax_base_purchase_account_id_fkey: 10358.2
res_company_l10n_ec_tax_base_sale_account_id_fkey: 10547
res_company_l10n_ee_rounding_difference_loss_account_id_fkey: 8158.92
res_company_l10n_ee_rounding_difference_profit_account_id_fkey: 7896.55
res_company_l10n_eg_annual_leave_type_id_fkey: 0.887
res_company_l10n_fr_rounding_difference_loss_account_id_fkey: 8227.23
res_company_l10n_fr_rounding_difference_profit_account_id_fkey: 7965.89
res_company_l10n_in_withholding_account_id_fkey: 7820.82
res_company_l10n_nl_rounding_difference_loss_account_id_fkey: 7982.45
res_company_l10n_nl_rounding_difference_profit_account_id_fkey: 7874.47
res_company_leave_timesheet_task_id_fkey: 1.153
res_company_loss_account_id_fkey: 12688.6
res_company_nomenclature_id_fkey: 0.828
res_company_paperformat_id_fkey: 0.941
res_company_partner_id_fkey: 5.739
res_company_project_time_mode_id_fkey: 1.273
res_company_recruitment_folder_id_fkey: 0.816
res_company_rental_loc_id_fkey: 0.851
res_company_resource_calendar_id_fkey: 1.515
res_company_revenue_accrual_account_id_fkey: 5175.54
res_company_stock_mail_confirmation_template_id_fkey: 0.9
res_company_stock_sms_confirmation_template_id_fkey: 0.861
res_company_timesheet_encode_uom_id_fkey: 0.78
res_company_transfer_account_id_fkey: 7072.12
res_company_withholding_tax_base_account_id_fkey: 8502.05
res_company_write_uid_fkey: 0.743
soda_account_mapping_account_id_fkey: 398.04
stock_landed_cost_lines_account_id_fkey: 658.493
stock_location_valuation_in_account_id_fkey: 3940.27
stock_location_valuation_out_account_id_fkey: 2818.23
stock_valuation_layer_revaluation_account_id_fkey: 340.648
for a total of 661283ms = 11mn[^0].
This commit adds temporary indexes for every m2o field to account which is not already indexed[^1][^2] after all the l10n modules are installed, those indexes are then deleted at the end of the test to avoid polluting the database for the split tests.
This removes most of the cost of deleting accounts (not going to bother with the detail, the entire thing comes out at under a second), at a very minor cost (a few seconds) to create the indices though an increased overall load (due to having to update indexes).
Saves around 5mn on an unloaded 30mn build, and because it avoids a significant amount of parallelized seq scans it saves even more when running on a loaded runbot where parallel postgres workers are CPU starved (10~15mn out of 50~55).
Note: patched `load_file` because `l10n_tr` enables `tr_TR`, and then the tx subsystem complains about pretty much every module being installed because few to none of them have a tr_TR po file.
Backport of #217690
[^0]: `EXPLAIN ANALYZE`-ing everything slows down the test by a factor
of 2x, which is why this takes 11mn instead of the original 5, and
the test itself takes 1h instead of the original 30mn
[^1]: Kinda, currently it just checks if the field is `index` on the
Odoo side, so it's going to miss things like manual partial
indexes, or compound index (though in that case we should only
take in account cases where the account field is the first one),
etc...
[^2]: The specific missing indexes could have been enumerated and
created specifically but it doesn't seem worth the hassle, the
gain from trimming down the list would only be a fraction of a
second from creating a few less indexes, with the risk of missing
new missing indexes. A blacklist might make sense to avoid
creating indexes for constraints with extremely low costs (either
empty tables or already indexed) e.g. constraints with under 250ms
total runtime[^3].
[^3]: Note that the numbers above are full dumps of the trigger times,
a fair number of triggers in the dumps are *not* on accounts but
are due to ancillary deletions or deletion cascades. Pretty much
every trigger below triple digit (ms) runtime is a non-account
trigger, and this PR is not creating indexes for any of those.
Forward-Port-Of: odoo/odoo#224075This update adds automated checks to ensure barcode lookup correctly retrieves product information and creates products across point of sale, inventory barcode, and website flows. It helps reduce the risk of errors when users add products by scanning or entering barcodes.
Original PR description
*: pos_barcodelookup, stock_barcode_barcodelookup, website_product_barcodelookup In this commit: ------------------- - Added tests for barcodelookup to check whether the data fetched and set properly. - Added tests in respective modules to check the flow and creation of the products using barcodelookup. task - 3920661 Forward-Port-Of: odoo/enterprise#92689 Forward-Port-Of: odoo/enterprise#69120
4 changes
Enhancements to existing features
The salary contract page was updated to use a newer internal web approach instead of older browser code. This helps keep the HR salary contract experience maintainable and aligned with current platform standards without changing core business workflows.
Original PR description
wip
The OCR document processing flow no longer creates extra database checkpoints while fetching results. This reduces overhead when many documents are processed at once, improving performance with minimal user-facing change.
Original PR description
Very similar to commit 7f7ff8d, see full explanation in that commit message. This savepoint was also initiated in a loop which could cause performances issues when too many of them are active at the same time. This one is much less critical and can be removed without much trouble. It was only allowing to recover from a serialization failure, in the case where a user was concurrently editing a document while it was being updated by the OCR. Forward-Port-Of: odoo/enterprise#93000
Hong Kong payroll will no longer automatically include a 200 HKD internet allowance. This avoids applying an arbitrary allowance that is not considered common practice, helping payroll defaults better match typical business needs.
Original PR description
Removes the default 200 HKD of internet allowance, as it is not a common practice in any way to give it, and the 200 is arbitrary and is also not common practice of any kind. task-5010960
Enterprise payroll and localization reporting tests were updated to follow the new default tax rounding behavior. This helps ensure Odoo's business calculations stay consistent across community and enterprise versions without requiring extra configuration.
Original PR description
**Purpose**: --- - Align enterprise tests with the community change setting 'Round per Tax Group' (round_globally) as the default tax rounding method. **Changes**: --- - Removed explicit round_globally configuration in tests (now default). - Updated “Round per Line” test cases to run under the global rounding setting. - Adjusted expected results to match the new computation behavior. community pr- https://github.com/odoo/odoo/pull/221027 task-4971648
3 changes
Enhancements to existing features
SMS message generation can now receive extra contextual information from add-on modules. This makes it easier for businesses to customize automated SMS content without relying on fragile workarounds.
Original PR description
In add-ons may need to pass additional context to body render function, both `_render_field`, and `_render_template` support this but the `sms.composer` didn't implement a proper way to pass additional context to them. overwrite `_prepare_body_values` for just passing `add_context` to render functions is not a good practice. In this PR I add a `_get_body_additional_context` to it, so any module can overwrite that function to pass additional context to render functions.
This change speeds up an internal accounting localization test by adding temporary database indexes while test accounts are being deleted. It reduces build and validation time, helping developers and CI systems provide feedback faster without changing customer-facing accounting behavior.
Original PR description
During the second half of `test_all_l10n`, we keep deleting `account.account` records (hundreds to low thousand every iteration). This deletion turns out to account (heh) for about 15% of the test's…
During the second half of `test_all_l10n`, we keep deleting `account.account` records (hundreds to low thousand every iteration). This deletion turns out to account (heh) for about 15% of the test's run time running locally (5mn out of 30). And per the explain, this is largely from executing `ON DELETE` constraints: since accounts are rarely deleted, the forward-only M2Os (used to go from a record to an account) are not generally indexes, which causes a full scan of the non-account table on deletion of accounts, which... can be quite slow if the non-account table is large, e.g. sample `EXPLAIN ANALYZE` for one of the `DELETE FROM account_account`:
Trigger for constraint account_fiscal_position_account_account_src_id_fkey on account_account: time=30.040 calls=1000
Trigger for constraint account_fiscal_position_account_account_dest_id_fkey on account_account: time=20.977 calls=1000
Trigger for constraint account_account_tax_default_rel_account_id_fkey on account_account: time=16.423 calls=1000
Trigger for constraint account_account_res_company_rel_account_account_id_fkey on account_account: time=18.848 calls=1000
Trigger for constraint account_account_account_tag_account_account_id_fkey on account_account: time=12.396 calls=1000
Trigger for constraint account_journal_default_account_id_fkey on account_account: time=207.759 calls=1000
Trigger for constraint account_journal_suspense_account_id_fkey on account_account: time=131.019 calls=1000
Trigger for constraint account_journal_non_deductible_account_id_fkey on account_account: time=126.656 calls=1000
Trigger for constraint account_journal_profit_account_id_fkey on account_account: time=128.753 calls=1000
Trigger for constraint account_journal_loss_account_id_fkey on account_account: time=125.281 calls=1000
Trigger for constraint res_company_transfer_account_id_fkey on account_account: time=85.604 calls=1000
Trigger for constraint res_company_default_cash_difference_income_account_id_fkey on account_account: time=75.154 calls=1000
Trigger for constraint res_company_default_cash_difference_expense_account_id_fkey on account_account: time=73.173 calls=1000
Trigger for constraint res_company_account_journal_suspense_account_id_fkey on account_account: time=73.336 calls=1000
Trigger for constraint res_company_account_journal_early_pay_discount_gain_accoun_fkey on account_account: time=73.741 calls=1000
Trigger for constraint res_company_account_journal_early_pay_discount_loss_accoun_fkey on account_account: time=73.402 calls=1000
Trigger for constraint res_company_income_currency_exchange_account_id_fkey on account_account: time=74.586 calls=1000
Trigger for constraint res_company_expense_currency_exchange_account_id_fkey on account_account: time=74.678 calls=1000
Trigger for constraint res_company_account_default_pos_receivable_account_id_fkey on account_account: time=77.105 calls=1000
Trigger for constraint res_company_expense_accrual_account_id_fkey on account_account: time=77.000 calls=1000
Trigger for constraint res_company_revenue_accrual_account_id_fkey on account_account: time=76.399 calls=1000
Trigger for constraint res_company_account_cash_basis_base_account_id_fkey on account_account: time=77.996 calls=1000
Trigger for constraint res_company_account_discount_income_allocation_id_fkey on account_account: time=77.799 calls=1000
Trigger for constraint res_company_account_discount_expense_allocation_id_fkey on account_account: time=78.145 calls=1000
Trigger for constraint res_company_income_account_id_fkey on account_account: time=79.625 calls=1000
Trigger for constraint res_company_expense_account_id_fkey on account_account: time=79.421 calls=1000
Trigger for constraint account_tax_group_tax_payable_account_id_fkey on account_account: time=103.659 calls=1000
Trigger for constraint account_tax_group_tax_receivable_account_id_fkey on account_account: time=75.211 calls=1000
Trigger for constraint account_tax_group_advance_tax_payment_account_id_fkey on account_account: time=72.384 calls=1000
Trigger for constraint account_tax_cash_basis_transition_account_id_fkey on account_account: time=954.139 calls=1000
Trigger for constraint account_tax_repartition_line_account_id_fkey on account_account: time=1445.578 calls=1000
Trigger for constraint account_reconcile_model_line_account_id_fkey on account_account: time=71.619 calls=1000
Trigger for constraint account_move_line_account_id_fkey on account_account: time=140.720 calls=1000
Trigger for constraint account_payment_outstanding_account_id_fkey on account_account: time=17.682 calls=1000
Trigger for constraint account_payment_destination_account_id_fkey on account_account: time=6.791 calls=1000
Trigger for constraint account_payment_method_line_payment_account_id_fkey on account_account: time=75.530 calls=1000
Trigger for constraint account_analytic_line_general_account_id_fkey on account_account: time=81.989 calls=1000
Trigger for constraint account_automatic_entry_wizard_destination_account_id_fkey on account_account: time=8.967 calls=1000
Trigger for constraint account_payment_register_writeoff_account_id_fkey on account_account: time=9.166 calls=1000
Trigger for constraint account_accrued_orders_wizard_account_id_fkey on account_account: time=7.863 calls=1000
Trigger for constraint account_account_account_merge_wizard_re_account_account_id_fkey on account_account: time=7.338 calls=1000
Trigger for constraint account_merge_wizard_line_account_id_fkey on account_account: time=7.706 calls=1000
Trigger for constraint res_company_deferred_expense_account_id_fkey on account_account: time=126.271 calls=1000
Trigger for constraint res_company_deferred_revenue_account_id_fkey on account_account: time=98.607 calls=1000
Trigger for constraint account_account_account_auto_reconcile__account_account_id_fkey on account_account: time=8.921 calls=1000
Trigger for constraint account_reconcile_wizard_account_id_fkey on account_account: time=8.330 calls=1000
Trigger for constraint account_model_rel_account_account_id_fkey on account_account: time=27.264 calls=1000
Trigger for constraint account_transfer_model_line_account_id_fkey on account_account: time=39.033 calls=1000
Trigger for constraint account_fiscal_position_avatax_invoice_account_id_fkey on account_account: time=83.360 calls=1000
Trigger for constraint account_fiscal_position_avatax_refund_account_id_fkey on account_account: time=60.023 calls=1000
Trigger for constraint account_account_account_import_summary__account_account_id_fkey on account_account: time=8.251 calls=1000
Trigger for constraint res_company_account_revaluation_expense_provision_account__fkey on account_account: time=107.339 calls=1000
Trigger for constraint res_company_account_revaluation_income_provision_account_i_fkey on account_account: time=100.037 calls=1000
Trigger for constraint account_account_exclude_res_currency_pr_account_account_id_fkey on account_account: time=9.025 calls=1000
Trigger for constraint account_report_budget_item_account_id_fkey on account_account: time=7.600 calls=1000
Trigger for constraint account_payment_withholding_line_account_id_fkey on account_account: time=7.814 calls=1000
Trigger for constraint res_company_withholding_tax_base_account_id_fkey on account_account: time=116.893 calls=1000
Trigger for constraint account_payment_register_withholding_outstanding_account_i_fkey on account_account: time=8.580 calls=1000
Trigger for constraint account_payment_register_withholding_line_account_id_fkey on account_account: time=8.799 calls=1000
Trigger for constraint res_company_l10n_ee_rounding_difference_loss_account_id_fkey on account_account: time=115.461 calls=1000
Trigger for constraint res_company_l10n_ee_rounding_difference_profit_account_id_fkey on account_account: time=114.827 calls=1000
Trigger for constraint account_journal_l10n_tr_default_sales_return_account_id_fkey on account_account: time=305.506 calls=1000
Trigger for constraint res_company_account_production_wip_account_id_fkey on account_account: time=125.388 calls=1000
Trigger for constraint res_company_account_production_wip_overhead_account_id_fkey on account_account: time=117.769 calls=1000
Trigger for constraint stock_location_valuation_in_account_id_fkey on account_account: time=104.378 calls=1000
Trigger for constraint stock_location_valuation_out_account_id_fkey on account_account: time=67.309 calls=1000
Trigger for constraint stock_valuation_layer_revaluation_account_id_fkey on account_account: time=8.817 calls=1000
Trigger for constraint res_company_l10n_fr_rounding_difference_loss_account_id_fkey on account_account: time=127.732 calls=1000
Trigger for constraint res_company_l10n_fr_rounding_difference_profit_account_id_fkey on account_account: time=124.773 calls=1000
Trigger for constraint res_company_l10n_in_withholding_account_id_fkey on account_account: time=124.847 calls=1000
Trigger for constraint res_company_l10n_nl_rounding_difference_loss_account_id_fkey on account_account: time=131.094 calls=1000
Trigger for constraint res_company_l10n_nl_rounding_difference_profit_account_id_fkey on account_account: time=132.013 calls=1000
Trigger for constraint mrp_workcenter_expense_account_id_fkey on account_account: time=14.578 calls=1000
Trigger for constraint mrp_account_wip_accounting_line_account_id_fkey on account_account: time=8.530 calls=1000
Trigger for constraint account_payment_force_outstanding_account_id_fkey on account_account: time=11.336 calls=1000
Trigger for constraint pos_payment_method_outstanding_account_id_fkey on account_account: time=11.554 calls=1000
Trigger for constraint pos_payment_method_receivable_account_id_fkey on account_account: time=6.654 calls=1000
Trigger for constraint pos_close_session_wizard_account_id_fkey on account_account: time=7.825 calls=1000
Trigger for constraint res_company_downpayment_account_id_fkey on account_account: time=137.312 calls=1000
Trigger for constraint res_company_l10n_bd_corporate_tax_liability_fkey on account_account: time=143.026 calls=1000
Trigger for constraint res_company_l10n_bd_corporate_tax_expense_fkey on account_account: time=141.801 calls=1000
Trigger for constraint account_move_l10n_de_datev_main_account_id_fkey on account_account: time=3874.682 calls=1000
Trigger for constraint stock_landed_cost_lines_account_id_fkey on account_account: time=14.898 calls=1000
Trigger for constraint account_account_account_asset_rel_account_account_id_fkey on account_account: time=9.640 calls=1000
Trigger for constraint account_asset_account_asset_id_fkey on account_account: time=11.687 calls=1000
Trigger for constraint account_asset_account_depreciation_id_fkey on account_account: time=6.551 calls=1000
Trigger for constraint account_asset_account_depreciation_expense_id_fkey on account_account: time=6.300 calls=1000
Trigger for constraint res_company_gain_account_id_fkey on account_account: time=210.699 calls=1000
Trigger for constraint res_company_loss_account_id_fkey on account_account: time=180.965 calls=1000
Trigger for constraint asset_modify_account_asset_id_fkey on account_account: time=10.665 calls=1000
Trigger for constraint asset_modify_account_asset_counterpart_id_fkey on account_account: time=5.466 calls=1000
Trigger for constraint asset_modify_account_depreciation_id_fkey on account_account: time=5.353 calls=1000
Trigger for constraint asset_modify_account_depreciation_expense_id_fkey on account_account: time=5.438 calls=1000
Trigger for constraint res_company_l10n_ae_tax_report_liabilities_account_fkey on account_account: time=176.808 calls=1000
Trigger for constraint res_company_l10n_ae_tax_report_expenses_account_fkey on account_account: time=172.302 calls=1000
Trigger for constraint res_company_l10n_ae_tax_report_asset_account_fkey on account_account: time=170.480 calls=1000
Trigger for constraint res_company_l10n_ar_tax_base_account_id_fkey on account_account: time=171.774 calls=1000
Trigger for constraint soda_account_mapping_account_id_fkey on account_account: time=9.239 calls=1000
Trigger for constraint res_company_l10n_ec_tax_base_sale_account_id_fkey on account_account: time=176.779 calls=1000
Trigger for constraint res_company_l10n_ec_tax_base_purchase_account_id_fkey on account_account: time=175.159 calls=1000
Trigger for constraint account_loan_long_term_account_id_fkey on account_account: time=13.823 calls=1000
Trigger for constraint account_loan_short_term_account_id_fkey on account_account: time=7.044 calls=1000
Trigger for constraint account_loan_expense_account_id_fkey on account_account: time=5.934 calls=1000
Trigger for constraint res_company_l10n_cl_factoring_counterpart_account_id_fkey on account_account: time=193.722 calls=1000
Trigger for constraint res_company_exemption_doctor_master_account_id_fkey on account_account: time=201.309 calls=1000
Trigger for constraint res_company_exemption_bachelor_account_id_fkey on account_account: time=200.476 calls=1000
Trigger for constraint res_company_exemption_bachelor_capping_account_id_fkey on account_account: time=200.465 calls=1000
Trigger for constraint res_company_partner_id_fkey on res_company: time=0.208 calls=10
Trigger for constraint res_company_currency_id_fkey on res_company: time=0.018 calls=10
Trigger for constraint res_company_paperformat_id_fkey on res_company: time=0.014 calls=10
Trigger for constraint res_company_create_uid_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_write_uid_fkey on res_company: time=0.009 calls=10
Trigger for constraint res_company_resource_calendar_id_fkey on res_company: time=0.023 calls=10
Trigger for constraint res_company_transfer_account_id_fkey on res_company: time=0.002 calls=9
Trigger for constraint res_company_default_cash_difference_income_account_id_fkey on res_company: time=0.055 calls=10
Trigger for constraint res_company_default_cash_difference_expense_account_id_fkey on res_company: time=0.030 calls=10
Trigger for constraint res_company_account_journal_suspense_account_id_fkey on res_company: time=0.002 calls=8
Trigger for constraint res_company_account_journal_early_pay_discount_gain_accoun_fkey on res_company: time=0.002 calls=7
Trigger for constraint res_company_account_journal_early_pay_discount_loss_accoun_fkey on res_company: time=0.001 calls=4
Trigger for constraint res_company_income_currency_exchange_account_id_fkey on res_company: time=0.029 calls=10
Trigger for constraint res_company_expense_currency_exchange_account_id_fkey on res_company: time=0.001 calls=5
Trigger for constraint res_company_batch_payment_sequence_id_fkey on res_company: time=0.016 calls=10
Trigger for constraint res_company_account_default_pos_receivable_account_id_fkey on res_company: time=0.001 calls=2
Trigger for constraint res_company_account_fiscal_country_id_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_income_account_id_fkey on res_company: time=0.002 calls=6
Trigger for constraint res_company_expense_account_id_fkey on res_company: time=0.001 calls=3
Trigger for constraint res_company_deferred_expense_account_id_fkey on res_company: time=0.000 calls=1
Trigger for constraint res_company_nomenclature_id_fkey on res_company: time=0.012 calls=10
Trigger for constraint res_company_internal_transit_location_id_fkey on res_company: time=0.014 calls=10
Trigger for constraint res_company_stock_mail_confirmation_template_id_fkey on res_company: time=0.013 calls=10
Trigger for constraint res_company_documents_fleet_folder_fkey on res_company: time=0.016 calls=10
Trigger for constraint res_company_documents_hr_folder_fkey on res_company: time=0.010 calls=10
Trigger for constraint res_company_documents_employee_folder_id_fkey on res_company: time=0.011 calls=10
Trigger for constraint res_company_documents_project_folder_id_fkey on res_company: time=0.009 calls=10
Trigger for constraint res_company_stock_sms_confirmation_template_id_fkey on res_company: time=0.012 calls=10
Trigger for constraint res_company_recruitment_folder_id_fkey on res_company: time=0.010 calls=10
Trigger for constraint res_company_project_time_mode_id_fkey on res_company: time=0.019 calls=10
Trigger for constraint res_company_timesheet_encode_uom_id_fkey on res_company: time=0.011 calls=10
Trigger for constraint res_company_internal_project_id_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_leave_timesheet_task_id_fkey on res_company: time=0.015 calls=10
Trigger for constraint res_company_rental_loc_id_fkey on res_company: time=0.011 calls=10
Trigger for constraint res_company_l10n_ch_delegate_country_id_fkey on res_company: time=0.013 calls=10
Trigger for constraint res_company_l10n_eg_annual_leave_type_id_fkey on res_company: time=0.014 calls=10
Accumulated across the entire test:
account_account_account_asset_rel_account_account_id_fkey: 367.89
account_account_account_auto_reconcile__account_account_id_fkey: 369.314
account_account_account_import_summary__account_account_id_fkey: 308.894
account_account_account_merge_wizard_re_account_account_id_fkey: 258.345
account_account_account_tag_account_account_id_fkey: 437.58
account_account_exclude_res_currency_pr_account_account_id_fkey: 364.079
account_account_res_company_rel_account_account_id_fkey: 676.195
account_account_tax_default_rel_account_id_fkey: 616.155
account_accrued_orders_wizard_account_id_fkey: 281.117
account_analytic_line_general_account_id_fkey: 2920.52
account_asset_account_asset_id_fkey: 435.021
account_asset_account_depreciation_expense_id_fkey: 225.966
account_asset_account_depreciation_id_fkey: 243.045
account_automatic_entry_wizard_destination_account_id_fkey: 333.281
account_fiscal_position_account_account_dest_id_fkey: 764.004
account_fiscal_position_account_account_src_id_fkey: 1127.7
account_fiscal_position_avatax_invoice_account_id_fkey: 2903.72
account_fiscal_position_avatax_refund_account_id_fkey: 2243.92
account_journal_default_account_id_fkey: 8123.53
account_journal_l10n_tr_default_sales_return_account_id_fkey: 13035
account_journal_loss_account_id_fkey: 4810.37
account_journal_non_deductible_account_id_fkey: 5057.85
account_journal_profit_account_id_fkey: 5063.26
account_journal_suspense_account_id_fkey: 5492.64
account_loan_expense_account_id_fkey: 222.776
account_loan_long_term_account_id_fkey: 553.955
account_loan_short_term_account_id_fkey: 259.905
account_merge_wizard_line_account_id_fkey: 265.135
account_model_rel_account_account_id_fkey: 927.993
account_move_l10n_de_datev_main_account_id_fkey: 122923
account_move_line_account_id_fkey: 4000.68
account_payment_destination_account_id_fkey: 265.653
account_payment_force_outstanding_account_id_fkey: 459.209
account_payment_method_line_payment_account_id_fkey: 2660.46
account_payment_outstanding_account_id_fkey: 575.21
account_payment_register_withholding_line_account_id_fkey: 319.363
account_payment_register_withholding_outstanding_account_i_fkey: 383.508
account_payment_register_writeoff_account_id_fkey: 341.615
account_payment_withholding_line_account_id_fkey: 286.658
account_reconcile_model_line_account_id_fkey: 2608.16
account_reconcile_wizard_account_id_fkey: 309.389
account_report_budget_item_account_id_fkey: 300.099
account_tax_cash_basis_transition_account_id_fkey: 31329.6
account_tax_group_advance_tax_payment_account_id_fkey: 2629.35
account_tax_group_tax_payable_account_id_fkey: 3554.27
account_tax_group_tax_receivable_account_id_fkey: 2772.1
account_tax_repartition_line_account_id_fkey: 47923.3
account_transfer_model_line_account_id_fkey: 1309.84
asset_modify_account_asset_counterpart_id_fkey: 207.683
asset_modify_account_asset_id_fkey: 454.126
asset_modify_account_depreciation_expense_id_fkey: 189.258
asset_modify_account_depreciation_id_fkey: 192.029
mrp_account_wip_accounting_line_account_id_fkey: 305.605
mrp_workcenter_expense_account_id_fkey: 565.317
pos_close_session_wizard_account_id_fkey: 285.536
pos_payment_method_outstanding_account_id_fkey: 432.131
pos_payment_method_receivable_account_id_fkey: 249.401
res_company_account_cash_basis_base_account_id_fkey: 5195.51
res_company_account_default_pos_receivable_account_id_fkey: 5357.29
res_company_account_discount_expense_allocation_id_fkey: 5113.98
res_company_account_discount_income_allocation_id_fkey: 5151.48
res_company_account_fiscal_country_id_fkey: 1
res_company_account_journal_early_pay_discount_gain_accoun_fkey: 5640.61
res_company_account_journal_early_pay_discount_loss_accoun_fkey: 5489.35
res_company_account_journal_suspense_account_id_fkey: 5811.88
res_company_account_production_wip_account_id_fkey: 8351.27
res_company_account_production_wip_overhead_account_id_fkey: 7914.54
res_company_account_revaluation_expense_provision_account__fkey: 8858.1
res_company_account_revaluation_income_provision_account_i_fkey: 8169.02
res_company_batch_payment_sequence_id_fkey: 0.995
res_company_create_uid_fkey: 2.96
res_company_currency_id_fkey: 1.081
res_company_default_cash_difference_expense_account_id_fkey: 6060.06
res_company_default_cash_difference_income_account_id_fkey: 6404.5
res_company_deferred_expense_account_id_fkey: 10447.3
res_company_deferred_revenue_account_id_fkey: 8923.24
res_company_documents_employee_folder_id_fkey: 0.875
res_company_documents_fleet_folder_fkey: 1.374
res_company_documents_hr_folder_fkey: 0.829
res_company_documents_project_folder_id_fkey: 0.779
res_company_downpayment_account_id_fkey: 8009.08
res_company_exemption_bachelor_account_id_fkey: 10964.3
res_company_exemption_bachelor_capping_account_id_fkey: 10860.6
res_company_exemption_doctor_master_account_id_fkey: 11117
res_company_expense_account_id_fkey: 5124.13
res_company_expense_accrual_account_id_fkey: 5246.67
res_company_expense_currency_exchange_account_id_fkey: 5352.77
res_company_external_report_layout_id_fkey: 0.308
res_company_gain_account_id_fkey: 14196.4
res_company_income_account_id_fkey: 5136.8
res_company_income_currency_exchange_account_id_fkey: 5441.56
res_company_internal_project_id_fkey: 1.151
res_company_internal_transit_location_id_fkey: 1.019
res_company_l10n_ae_tax_report_asset_account_fkey: 10908.2
res_company_l10n_ae_tax_report_expenses_account_fkey: 11365.8
res_company_l10n_ae_tax_report_liabilities_account_fkey: 11898.4
res_company_l10n_ar_tax_base_account_id_fkey: 10648.4
res_company_l10n_bd_corporate_tax_expense_fkey: 8098.52
res_company_l10n_bd_corporate_tax_liability_fkey: 8176.24
res_company_l10n_ch_delegate_country_id_fkey: 0.864
res_company_l10n_cl_factoring_counterpart_account_id_fkey: 10872.3
res_company_l10n_ec_tax_base_purchase_account_id_fkey: 10358.2
res_company_l10n_ec_tax_base_sale_account_id_fkey: 10547
res_company_l10n_ee_rounding_difference_loss_account_id_fkey: 8158.92
res_company_l10n_ee_rounding_difference_profit_account_id_fkey: 7896.55
res_company_l10n_eg_annual_leave_type_id_fkey: 0.887
res_company_l10n_fr_rounding_difference_loss_account_id_fkey: 8227.23
res_company_l10n_fr_rounding_difference_profit_account_id_fkey: 7965.89
res_company_l10n_in_withholding_account_id_fkey: 7820.82
res_company_l10n_nl_rounding_difference_loss_account_id_fkey: 7982.45
res_company_l10n_nl_rounding_difference_profit_account_id_fkey: 7874.47
res_company_leave_timesheet_task_id_fkey: 1.153
res_company_loss_account_id_fkey: 12688.6
res_company_nomenclature_id_fkey: 0.828
res_company_paperformat_id_fkey: 0.941
res_company_partner_id_fkey: 5.739
res_company_project_time_mode_id_fkey: 1.273
res_company_recruitment_folder_id_fkey: 0.816
res_company_rental_loc_id_fkey: 0.851
res_company_resource_calendar_id_fkey: 1.515
res_company_revenue_accrual_account_id_fkey: 5175.54
res_company_stock_mail_confirmation_template_id_fkey: 0.9
res_company_stock_sms_confirmation_template_id_fkey: 0.861
res_company_timesheet_encode_uom_id_fkey: 0.78
res_company_transfer_account_id_fkey: 7072.12
res_company_withholding_tax_base_account_id_fkey: 8502.05
res_company_write_uid_fkey: 0.743
soda_account_mapping_account_id_fkey: 398.04
stock_landed_cost_lines_account_id_fkey: 658.493
stock_location_valuation_in_account_id_fkey: 3940.27
stock_location_valuation_out_account_id_fkey: 2818.23
stock_valuation_layer_revaluation_account_id_fkey: 340.648
for a total of 661283ms = 11mn[^0].
This commit adds temporary indexes for every m2o field to account which is not already indexed[^1][^2] after all the l10n modules are installed, those indexes are then deleted at the end of the test to avoid polluting the database for the split tests.
This removes most of the cost of deleting accounts (not going to bother with the detail, the entire thing comes out at under a second), at a very minor cost (a few seconds) to create the indices though an increased overall load (due to having to update indexes).
Saves around 5mn on an unloaded 30mn build, and because it avoids a significant amount of parallelized seq scans it saves even more when running on a loaded runbot where parallel postgres workers are CPU starved (10~15mn out of 50~55).
Note: patched `load_file` because `l10n_tr` enables `tr_TR`, and then the tx subsystem complains about pretty much every module being installed because few to none of them have a tr_TR po file.
Backport of #217690
[^0]: `EXPLAIN ANALYZE`-ing everything slows down the test by a factor
of 2x, which is why this takes 11mn instead of the original 5, and
the test itself takes 1h instead of the original 30mn
[^1]: Kinda, currently it just checks if the field is `index` on the
Odoo side, so it's going to miss things like manual partial
indexes, or compound index (though in that case we should only
take in account cases where the account field is the first one),
etc...
[^2]: The specific missing indexes could have been enumerated and
created specifically but it doesn't seem worth the hassle, the
gain from trimming down the list would only be a fraction of a
second from creating a few less indexes, with the risk of missing
new missing indexes. A blacklist might make sense to avoid
creating indexes for constraints with extremely low costs (either
empty tables or already indexed) e.g. constraints with under 250ms
total runtime[^3].
[^3]: Note that the numbers above are full dumps of the trigger times,
a fair number of triggers in the dumps are *not* on accounts but
are due to ancillary deletions or deletion cascades. Pretty much
every trigger below triple digit (ms) runtime is a non-account
trigger, and this PR is not creating indexes for any of those.This update expands automated checks for several onboarding tours so issues are caught earlier during validation. It also speeds up tour execution and removes a duplicate sales test, helping keep release checks efficient without changing day-to-day user behavior.
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