Daily updates from Odoo
Navigate
Branch
Monday, January 21, 2019
13 changes
New functionality added to Odoo
This change adds a new test command that makes it easier for teams to run only the Odoo tests they need, helping reduce feedback time during development. It also includes cleanup and reliability fixes across several test areas, improving maintainability without directly changing day-to-day business workflows.
Original PR description
## Test subcommand Adds a test subcommand through py.test (with ~all py.test options forwarded directly): - flexible testing specification, the subcommand can take Odoo modules, directories and/or…
## Test subcommand Adds a test subcommand through py.test (with ~all py.test options forwarded directly): - flexible testing specification, the subcommand can take Odoo modules, directories and/or files as positional parameters and will apply [py.test's discovery conventions](http://pytest.org/latest/goodpractises.html#test-discovery) to fetch Python test cases, "data" test cases will be extracted from a module's `__openerp__.py` if that matches other filters - _only runs selected tests_, if requesting the testing of `product` all its dependencies (and auto_install dependents) are installed (with demo data) but only the tests of `product` are run - with no positional parameters, just starts looking for tests in the current working directory - automatically creates and deletes a temporary db if none is provided, if one is provided does not delete it (but creates it if it's missing) which can allow reusing dbs - uses an inited (but not specifically configured) Odoo logger and a pytest in default display mode (line per test file, captures stdout/stderr) - recap at the end of testing with display of failed test stack traces & captured stderr/stdout - provided marks to ignore categories of tests, only current mark is `http` so `odoo.py test -m 'not http'` will not start an http server and won't run any HTTP test - existing "unittest" tests mostly work as-is (unless they were mucking with the registry or even runtest protocol), alternatively can write lighter "pytest" tests - fixtures make for pretty clean setup/teardown & composition - slightly to greatly faster tests depending on the selected module(s) - future improvements via existing addons (e.g. [pep8](https://pypi.python.org/pypi/pytest-pep8), [coverage](https://pypi.python.org/pypi/pytest-cover)) or more formal results reporting (e.g. [junitxml result logs](http://pytest.org/latest/usage.html#creating-junitxml-format-files)) or new addons for e.g. better JS or tour integration e.g. `odoo.py test mail account` (will run all non-skipped tests in the mail and account addons), `odoo.py test addons/product/tests/test_pricelist.py` (will just run the two test cases in test_pricelist.py), `odoo.py test --pdb -k test_20_pricelist_uom` (will only run that test case, should drop into pdb if the test fails) ## `--test-enable` - most of the registry-installation functions moved to methods of Registry - Registry.load_modules changed to a coroutine and testing part moved outside of it to RegistryManager.new, which external runner does _not_ use see 3219863 - "on-install" testing uses same test discovery subcommand does with custom test reporter - reporting not identical to old reporting but pretty close (and improvement in some ways) - replaced old assertion_reporter (which just counted) by normal assertion errors in XML and YAML - all failed tests summarised/printed at the end of installation, no need to go hunt in the log - remains compatible with runbot (I think, went into runbot source to see how that worked) ## other changes - some tests were implicitly skipped (weren't imported by test package), changed to explicit skipping - various imports improved, some of them may not be necessary after all. May be useful if we eventually try to make just calling `py.test` directly possible - moved and removed imports so pytest and unittest2 are only imported when actually trying to _run_ tests - removed `--test-file` behaviour, superseded by `odoo.py test <testfile>` /cc @odony @antonylesuisse @tde-banana-odoo
Enhancements to existing features
This update renames employee leave management to the more internationally understood “Time Off” and introduces a new dashboard with a calendar and request summary. Employees get a clearer, more intuitive view of their time off balances and requests, while related messages and usability are improved.
Original PR description
Description of the issue/feature this PR addresses: We need to use an international word to define holidays and leaves. Employees needs a good dashboard and leaves summary Desired behavior after PR is merged: We have Time Off (no more leaves). Each user has a intuitive dashboard for his Time Off. The dashboard has a calendar and a summary of all time off and time off request. Some intro messages are more clear and give correct information. id=1916871 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Users can now notify an entire chat channel from the chatter without adding that channel as a follower. This makes broad notifications faster and keeps follower lists cleaner, while also improving how mention suggestions display names.
Original PR description
task_id: 1859802 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Payroll records, contracts, and salary structures are now better separated by company and country, helping prevent users from viewing or using payroll data that belongs elsewhere. Salary rule accounting settings can now differ by company, reducing the risk of incorrect payroll accounting when multiple companies share the same payroll setup.
Original PR description
Purpose ======= Currently the payroll doesn't manage the multi company Specification ============= 1/ Add ir.rules on hr.contract and hr.payslip to prevent users to access a record in another company. 2/ Add ir.rules on hr.payroll.structure to prevent users to access a record for another country. 3/ Remove company_id fields on models that doesn't require it, as hr.salary.rule.category. 4/ Make the accounting fields on the salary rules company dependent. 5/ Specify the country on the salary structures on the l10n_**_hr_payroll modules. 6/ Add demo data and modify the salary package tour. 7/ Make the car_atn and company_car_total_depreciated_costs fields compute_sudo=True, as one car can be assigned on several contract, for different companies Closes #26866 Closes #25231 Closes #24683 Closes #23814
Payroll records and salary structures are now better separated by company and country, helping users see only the records relevant to their organization. Demo data and the salary package walkthrough were updated so multi-company payroll scenarios are easier to test and understand.
The document request screen now shows an upload icon instead of a download icon, making the intended action clearer. A tooltip appears when hovering over the icon, helping users understand they can upload a file.
Original PR description
Description of the issue/feature this PR addresses: - Added file upload icon and 'upload file' tooltip on hover of the icon while requesting documents to upload - Task : https://www.odoo.com/web#id=1917559&action=327&model=project.task&view_type=form&menu_id=4720 - Pad: https://pad.odoo.com/p/r.49a5ef42586a960c7719b1c450710f0b Current behavior before PR: - There was an icon of **download**, and there isn't any tool tip on hover of the icon. Desired behavior after PR is merged: - Icon will be of file **upload** instead of file download and there will a tool tip on hover of the icon.
Resolved issues and error corrections
This fix restores image-related tools that stopped working after a prior editor update. Website teams can again upload SEO images, choose page backgrounds, select blog covers, and use gallery images reliably.
Original PR description
* web_editor, website_blog Following the new editor's merge at https://github.com/odoo/odoo/pull/29775, the media dialog was refactored but the code which used it outside of the editor was not adapted at all. Also, the selected image was not saved correctly anymore, making the media dialog useless outside the editor in the current implementation. - Adapted SEO image uploading and body image background choice which were not working anymore - Adapted blog cover choice and gallery snippet which were strangely still working even though there were sending wrong parameters during media dialog initialization
This fix restores website editor-related dialogs and controls that were crashing after a recent editor update. Website users can again use media, image editing, and customization tools reliably outside the main editor.
Original PR description
* web_editor Following the new editor's merge at https://github.com/odoo/odoo/pull/29775, the editor dialog and the switches crashed on their use in website. This is because the merge split some xml files without adapting xml dependencies... this commit only takes care of code which depended on '/web_editor/static/src/xml/editor.xml'.
Payroll salary rule accounting can now be managed separately across companies. This prevents one company's accounts from appearing in or overwriting another company's payroll setup, reducing the risk of incorrect payslip accounting.
Original PR description
…nies Before this commit - Install a **l10n_xx_hr_payroll** which includes information of the rules (it always install in the main company: **Company A** in this use case). - Configure the accounting…
…nies Before this commit - Install a **l10n_xx_hr_payroll** which includes information of the rules (it always install in the main company: **Company A** in this use case). - Configure the accounting for the rules - Create **Company B** - Use the same salary rules for both companies, as **l10n_xx_hr_payroll** modules are not multicompany. Behavior: - **Company A** accounts are shown in **Company B** salary rules. - If the accounts are changed in **Company B** rules, it also overrides **Company A** accounts, (which causes major confusions, and great mistakes if a payslip is run). - A salary rule with **Company A** set on `company_id` can still be **seen** through Company B. which causes that it can be mistakenly _ran by a user in Company B_, with the _accounting of Company A_. After this commit: Salary rules accounting can be used with multi-company **OPW** 1847799 Fixes #23814 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Payslips must now have a company assigned before they can be used. This prevents payroll reports from missing the company header, helping ensure printed payslips look complete and professional.
Original PR description
Description of the issue/feature this PR addresses:
Task: https://www.odoo.com/web?#id=51511&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720
Pad: https://pad.odoo.com/p/r.0a748c43b32ca19dd0d886cab5df7ba2
Current behavior before PR:
- Printing pay slips when they don't have a company id set doesn't print the header on the report
Desired behavior after PR is merged:
- If set the company_id field required
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThe website editor color picker now correctly loads the opacity value from an existing color. This prevents users from seeing or applying the wrong transparency when editing content colors.
Original PR description
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775, the colorpicker was not properly initializing the opacity component of the given color anymore.
Fixed a layout issue where stat button content in the Enterprise web interface could spill outside the button after a Bootstrap update. This keeps buttons visually tidy and easier to read without changing business functionality.
Original PR description
Stats button on enterprise have the icon (30% of width) the label (70% of width) and 6px margin on the left of the icon. Thus this does not fit exactly and the content is put outside of the button. This did not happen when `white-space:nowrap` was set in button on bootstrap, but this has been removed in bootstrap 4.2.0 ( https://github.com/twbs/bootstrap/commit/24bdadf9d32 ) which is applied in Odoo as of odoo/odoo@63e52e6acf opw-1931085
This fixes a problem where media selection stopped working in Odoo Studio report building blocks after an editor update. Users can again insert or manage media in reports from Studio as expected.
Original PR description
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775, the media dialog was refactored but the code which used it outside of the editor was not adapted at all. Enterprise part of https://github.com/odoo/odoo/pull/30416