Daily updates from Odoo
Thursday, June 27, 2019
3 changes · master
Enhancements to existing features
This update adds tests to confirm that company context is handled correctly across the website, company switcher, and HR reporting. It helps prevent users from seeing or acting on the wrong company data when working in multi-company environments.
Original PR description
test_website: Add multi-company test ============================= Purpose ------------ This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification…
test_website: Add multi-company test ============================= Purpose ------------ This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification ------------------- The website company should be automatically set in the context as 'allowed_company_ids'. That way, we can remove the switch company menu on the website, which doesn't make a lot of sense. This test enforce this behavior. web: Add QUnit tests for the SwitchCompanyMenu ========================================= Purpose ------------ This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification ------------------ Ensure the robustness of the switch company menu for multiple cases like: - Bar rendering - Switch to another company in mono/multi environment - Toggle another company in mono/multi environment - Remove a company in mono/multi environment The widget itself has been slighty modified to make it more testable: - Reading from session is now in the `willStart` function instead of `init` to allow mocking the session (in tests, `init` is executed before the mock is applied). - In the event handlers, don't use `bbq` to retrieve current allowed company ids. `bbq` is not easily nor cleanly patched. - When reading allowed company ids from session, cast ids from string to integer. They are everywhere casted except there. and some linting hr: Add multi company tests ====================== Purpose ------------- This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification ------------------ Check that a report printing for several records on different companies: - Works if the context is correctly set, i.e. both companies are in the allowed_company_ids - Doesn't work if the context is not correctly set
Users opening records from the Gantt view can once again remove those records directly from the dialog. This keeps deletion available where there is no alternative removal path, preventing unnecessary workflow interruptions.
Original PR description
This commit adapts the changes done in https://github.com/odoo/odoo/pull/28792 In the above PR, we hide the 'Remove' button in FormViewDialog by default. But for the gantt view, there's no other way to remove the record opened from this view, so we need to keep the button in this case. task-1886913
Resolved issues and error corrections
This update fixes a date-related issue in an accounting report test that could fail depending on the day it was run. It helps keep automated checks stable and reduces false alarms during development.
Original PR description
The date was set to year-06-26, any day before that in the same year would create a line for overdue amount, not counted in an assert below