Thursday, April 16, 2020
4 changes · master
Enhancements to existing features
Studio now shows the full set of available widget options when users edit boolean fields in list views. This makes it easier for users to choose the right display style without missing valid choices in the sidebar.
Original PR description
before: when user open listview in studio mode and select boolean field to change widget of field sidebar doesn't display all boolean widget list after: display all boolean widget list so user can change field's widget Task Id: 2230540
This update improves the internal test setup used for accounting reports, making it easier to validate changes reliably. It helps reduce the risk of future reporting issues by strengthening the way accounting features are tested, with no expected direct impact on day-to-day users.
Original PR description
-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update adds a safer, more modern way for developers to customize web interface components, especially as Odoo moves to newer front-end technology. It also updates parts of the web and mail apps to use this approach, improving maintainability without changing normal user workflows.
Original PR description
Define a base class --- ```js odoo.define('web.test.A', function (require) { const makePatchable = require('web.class_patcher'); class A { constructor() { console.log('A'); this.x = ['A']; } do() {…
Define a base class
---
```js
odoo.define('web.test.A', function (require) {
const makePatchable = require('web.class_patcher');
class A {
constructor() {
console.log('A');
this.x = ['A'];
}
do() {
console.log('A.do', this.x);
}
}
return makePatchable(A); // return a "patchable" version of the class
});
```
OOP inheritance
---
```js
odoo.define('web.test.B', function (require) {
const makePatchable = require('web.class_patcher');
const A = require('web.test.A');
class B extends A {
constructor() {
super(...arguments);
console.log('B');
this.x.push('B');
}
do() {
super.do();
console.log('B.do');
}
}
return makePatchable(B);
});
```
Patch
---
```js
odoo.define('web.test.A.patch_1', function (require) {
const A = require('web.test.A');
A.patch('p1', T => class extends T {
constructor() {
super(...arguments);
console.log('A<1>');
this.x.push('A<1>');
}
do() {
super.do();
console.log('A<1>.do');
}
});
});
```
Use
---
```js
odoo.define('web.test.live', function (require) {
const A = require('web.test.A');
const B = require('web.test.B');
const o = new B(); // will log: "A A<1> B"
o.do();
// will log:
// A.do A A<1> B <-- this is the order of constructor calls
// A<1>.do
// B.do
// We can also unpatch
A.unpatch('p1');
});
```Website users can now use the Alt-H keyboard shortcut to open the app switcher from the frontend. This makes navigation faster and more consistent with the rest of Odoo.
Original PR description
Now that the keyboard navigation mixin is available in frontend, we can have the alt-H shortcut be available in frontend as well. task-2126915 linked to odoo/odoo#46953