Daily updates from Odoo
Navigate
Branch
Wednesday, March 6, 2019
12 changes
New functionality added to Odoo
Accounting settings now include a tax lock date that prevents changes to tax-related amounts and tax fields on journal entry lines before that date. This helps protect finalized tax reporting periods while still allowing non-tax details on older entries to be updated.
Original PR description
Purpose:
Journal entry can be changed the way we want while the lock date is before then entry date..
Entry : Draft -> Validated (or posted)
Specs:
add a date field in the accounting settings: tax lock date
implement a constraint ensuring that no one can modify the information related to tax on account.move.line prior to this lock date. That means the debit, credit, tax_ids, tax_line_id fields. Other fields can be modified. This also means we cannot create/delete an account.move.line with tax information prior to this lock date.
Task 1914762UK tax reports now include a Connect / Send option that lets users authenticate with HMRC and submit VAT return information directly from Odoo. The flow retrieves filing obligations, matches them to the report period where possible, and guides the user through submission in a wizard.
Original PR description
We add a button to the existing tax report "Connect / Send" to HMRC in order to send the tax information to the government. The first time you connect, you have to log in into the hmrc site first. For that, we needed a proxy on our site to recuperate its response (as they support only a fixed redirect uri). The proxy will check if a valid db uuid is given. The proxy itself generates a token and you get a token back from hmrc. Every 4 hours, the token needs to be refreshed. We use two endpoints of the API: retrieving the obligations (when and for which period vat returns (still) need to be filled in) and submitting the vat return itself. When you click the send button after a successfull login, a wizard is loaded where if possible the obligation is selected which conforms with the dates you chose in the report. There you can send it.
Enhancements to existing features
Recruiters can now mark jobs as favorites, see newly received applications directly from job cards, and open related applications more easily. The online job application form also collects the applicant's residence country, improving candidate information quality.
Original PR description
--------------------- hr_recruitment : --------------------- PURPOSE SUMMARY : Favorite jobs, New application count and modified views -------------------------------- - hr.job receives the favorite…
--------------------- hr_recruitment : --------------------- PURPOSE SUMMARY : Favorite jobs, New application count and modified views -------------------------------- - hr.job receives the favorite functionnality. - Now, a newly created hr.job is favorite by default. - hr.job kanban view displays favorite jobs by default. - hr.job receives a new field new_application_count that computes the number of applications which are new in the flow for that job (1st step of the recruitment flow). - hr.job kanban boxes now display the field described just above. - hr.job kanban boxes are now clickable and thus open related applications in a kanban view. - Views are modified according to the images given in the related task (see Task ID below). These changes are details such as modifying strings that are displayed or their position in the view, or again icons that are displayed. -> Note : Check related task to see decisions that have been made concerning these images. - Search on Email on hr.applicant has been separated so that it is clearer. --------------------------------- website_hr_recruitment : --------------------------------- PURPOSE SUMMARY : residence country on website job apply form -------------------------------- - add residence_country field on hr.applicant - adapt javascript tour to take into account this new field - modify hr.applicant form view to integrate this new field - modify website job apply form template to integrate this new field --------------------------- Task ID : 1896305 --------------------------- -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Accounting now includes a tax lock date that protects tax-related journal entry information before that date. This helps prevent changes to tax amounts or tax lines in locked periods while still allowing permitted non-tax edits after posting.
Original PR description
Description of the issue/feature this PR addresses: Journal entry can be changed the way we want while the lock date is before then entry date Current behavior before PR: One can only change draft entries Desired behavior after PR is merged: One can change all entries provided the date is after the lock date -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change restores the option to create time-off types that do not require validation, making simple leave flows easier to configure again. It also ensures the right HR or leave responsible person receives an activity notification when HR validation is involved.
Original PR description
Since https://github.com/odoo/odoo/commit/59956805424808beed82f1afa5c5e6996e34eb13#diff-ab6382882079a64a861bbba2741a1075 it was impossible to use the no_validation on hr_leave_type. This commit reintroduces this possibility and ensures the leave user gets an actvity for the leave This commit also add a field on hr_leave_type in order to know for whom we should create the activity when validation is by hr -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update aligns UK VAT tax tags and rates with the terminology used by HMRC tax return boxes. It helps businesses produce clearer VAT reports with corrected rates, missing lower-rate sales handling, and more accurate report mapping.
Original PR description
Description of the issue/feature this PR addresses: opw-1819495 For sending the tax return, It is better for the UK vat report to represent the taxes according to how the government calls the boxes. Current behavior before PR: Tags that don't correspond to the report. No one tag per grid for the report. Desired behavior after PR is merged: Corresponding tags. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The salary contract screens now use clearer wording for the default contract field, reducing confusion for HR users. An automated walkthrough was also corrected so the system reliably validates the related hiring flow.
Original PR description
--------------------------- hr_contract_salary : --------------------------------- PURPOSE SUMMARY : modify string, fix tour --------------------------------- - Modify displayed string of default_contract_id field as asked in task - Fix the hr_contract_salary tour so that the kanban box is effectively selected for clicking (see http://runbot.odoo.com/runbot/build/432307 for that error) ------------ Task ID : 1896305 ------------
Resolved issues and error corrections
Fixes an issue where the website editor could incorrectly detect focus when the selected item was already a media element. This helps prevent editing interruptions and supports more reliable editor behavior after internal Promise-related changes.
Original PR description
Issue detected with tests in the branch that replace deferred by native Promise. Need to add isMedia to detect if the target is already a media when focus the editor. 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
This update fixes issues that could cause the website editor's rich text tools to break when iframe loading is interrupted. It also removes a duplicate field registration, reducing the chance of inconsistent behavior in form fields.
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
Features or functions removed from Odoo
The Yahoo option for live currency exchange rates has been removed from Odoo. This matters because users will no longer be able to select Yahoo as a source for automatic currency rate updates and should use another available provider instead.
Original PR description
- Task : https://www.odoo.com/web#id=1863502&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 - Pad : https://pad.odoo.com/p/r.2a329bef7cc850a96a84c2eaa9d66595
Code cleanup and technical improvements
This update modernizes core web libraries used across Odoo, including jQuery and related testing and interface components. It improves long-term maintainability and error handling, reducing the risk of hidden interface issues while requiring broad validation because many screens and apps are affected.
Original PR description
The goal of this task is to update jQuery from version 1.11 to 3.x. Task-id : 1896658 As we are skipping 2 major versions, there are some breaking changes in the jquery library described here:…
The goal of this task is to update jQuery from version 1.11 to 3.x.
Task-id : 1896658
As we are skipping 2 major versions, there are some breaking changes in the jquery library described here: https://jquery.com/upgrade-guide/3.0/
Main changes are:
-------------------------
1. Update the libraries jQuery, jQueryUI, QUnit and select2 to their latest version.
The link to generate the build of jQueryUI with the used components: [jquery UI build](https://jqueryui.com/download/#!version=1.12.1&components=111110010101111110100010110000011010000000000000)
2. Use native promises ([a complete explanation about promises here](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch3.md)) everywhere possible:
In order to [be A+ compliant](https://promisesaplus.com/), the jq3 deferred uses `setTimeout(..., 0)`
for every then and catch, which takes between 4 and 10 ms by call.
This would be way too slow to use in Odoo.
To prevent this, we have used the native Promises everywhere possible.
Be it with jq deferred or native promises, all promises are now asynchronous,
this example will ALWAYS result in printing first "just after blabla" then "blabla"
because the `then` function will always be asynchronous (opposite to
what jquery used to do)
```javascript
function () {
Promise.resolve("blabla").then(console.log);
console.log("just after blabla");
}
// console:
// just after blabla
// blabla
```
3. On native promises, you should see the catch like a try/catch in
javascript, meaning that it will catch all errors including coding errors:
For this we have introduced the concept of `guardedCatch`, which will be executed
on promise rejection unless the promise is rejected because there is
a code error or runtime error (calls on undefined, etc).
4. Native Promises do not have `done`, `fail` and `always` methods nor does it have the `state` method
- `fail` can be replaced with `guardedCatch`
- `return $.when(x).done(function() ...)` can be replaced with
```javascript
var x = Promise.resolve(x); // we get the x promise in a local variable, without then
x.then(function() ...); // we add a new handler to x. This operation returns a new promise we don't care about
return x; // we return the x promise that will be completed without waiting for the then
```
- `$.when().done(function ...)` without the return can be replaced by `then(function ....)`, because if it is not returned, it doesn't matter what is chained or not `$.when().always(function() ...)` can be replaced with
```javascript
var always = function() ...
Promise.resolve().then(always).guardedCatch(always);
```
- It is not possible to inspect the state of a promise, except in debug tools of chrome and firefox. Any code that relies on `$.Deferred.state()` should be rewritten to use flags in `then` and `catch` handlers. Remember that it is not possible to execute the handlers in a synchronous manner, so when a promise is created, its `then` will never be called on the same execution stack. At best it will be called on the next microtask tick (before the next setTimeout).
5. We have introduced the concept of guardedCatch, to copy the behavior of the old fail:
The guarded catch will only execute the handler in parameter if the rejection reason is not an `Error`
```javascript
var failingPromise = Promise.reject({message:"I am the rejection reason"});
failingPromise.guardedCatch(function(reason) {console.log(reason);}); // is called, then returns a rejected promise
failingPromise.catch(function(reason) {console.log(reason);}); // is called
```
will write the reason "I am the rejection reason" to the console twice: once because the `guardedCatch` will execute (and return a rejected `Promise` with the same reason it was called), a second time because the `catch` will catch the rejected reason returned by the `guardedCatch`
```javascript
var promiseWithError = Promise.resolve().then(function() {
a.b = 0; // <-- the variable a does not exist, so a.b is an error
});
promiseWithError.guardedCatch(function(reason) {console.log(reason);}); // will not be called
promiseWithError.catch(function(reason) {console.log(reason);}); // will be called
```
contrary to how deferred used to work, here the catch will be called because it behaves like a `try... catch...` and will catch the coding error like if it was a business error. The `guardedCatch` however does not call the handler if the rejection reason is an error.
In all Odoo code, we never reject a promise with an error and always use objects to defined the rejected reason, so it is a good idea to use `guardedCatch` everywhere.
6. Native Promises can have only one parameter passed to a `then` function or a `catch` function:
`xxx.then(function(param1, param2) {...}); // param2 will never have a value`
- we can replace `$.when(prom1, prom2).then(function(result1, result2) { ... });` by
```javascript
Promise.all([prom1, prom2]).then(function(results) {
var result1 = results[0];
var result2 = results[1];
...
});
```
7. We are now using ES7 code in the unit tests (async await).
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>This update adapts multiple Odoo Enterprise modules to work with jQuery 3, a newer version of a core web technology used by the interface. It helps keep accounting, documents, delivery barcode, and related online services compatible and maintainable without introducing new business features.
Original PR description
This branch is the counterpart of odoo/odoo#28457. Task-id : 1896658 Co-authored-by: Aaron Bohy aab@odoo.com Co-authored-by: Christophe Matthieu chm@odoo.com Co-authored-by: Mathieu Duckerts-Antoine dam@odoo.com Co-authored-by: David Monjoie dmo@odoo.com Co-authored-by: Martin Geubelle mge@odoo.com Co-authored-by: svs-odoo svs@odoo.com Co-authored-by: Vincent Schippefilt vsc@odoo.com