3
0
Fork 0

[IMP] web_refresher: Remove refresh button from x2Many fields.

13.0
sergio-teruel 2022-09-26 18:44:01 +02:00
parent 07d30a79f4
commit e105d01361
5 changed files with 3 additions and 44 deletions

View File

@ -60,6 +60,7 @@ Contributors
* João Marques
* Alexandre D. Díaz
* Sergio Teruel
Maintainers
~~~~~~~~~~~

View File

@ -3,3 +3,4 @@
* João Marques
* Alexandre D. Díaz
* Sergio Teruel

View File

@ -405,6 +405,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>João Marques</li>
<li>Alexandre D. Díaz</li>
<li>Sergio Teruel</li>
</ul>
</li>
</ul>

View File

@ -7,7 +7,6 @@ odoo.define("refresher.Refresher", function(require) {
const AbstractController = require("web.AbstractController");
const BasicController = require("web.BasicController");
const ControlPanelRenderer = require("web.ControlPanelRenderer");
const FieldX2Many = require("web.relational_fields").FieldX2Many;
const Refresher = Widget.extend({
template: "web_refresher.Button",
@ -64,44 +63,6 @@ odoo.define("refresher.Refresher", function(require) {
},
});
FieldX2Many.include({
/**
* @override
*/
_renderControlPanel: function() {
if (!this.view) {
return this._super.apply(this, arguments);
}
this.refresher = new Refresher(this);
this.refresher.on("pager_refresh", this, () => {
if (this.pager) {
this.pager.trigger("pager_changed", {
current_min: this.value.offset + 1,
limit: this.value.limit,
size: this.value.count,
});
}
});
return this._super
.apply(this, arguments)
.then(() => {
return this.refresher.appendTo($("<div>"));
})
.then(() => {
this._controlPanel.updateContents(
{
cp_content: {
$refresher: this.refresher.$el,
},
},
{
clear: false,
}
);
});
},
});
ControlPanelRenderer.include({
/**
* @override

View File

@ -19,9 +19,4 @@
</t>
</t>
<t t-extend="X2ManyControlPanel">
<t t-jquery=".o_x2m_control_panel nav.o_cp_pager" t-operation="before">
<nav class="oe_cp_refresher" />
</t>
</t>
</template>