[IMP] web: allow to override the number of buttonbox buttons
See odoo/odoo#31546 closes odoo/odoo#31698 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
This commit is contained in:
committed by
Martin Geubelle
parent
776cab07d0
commit
5aa00c3362
@@ -279,7 +279,7 @@ var FormRenderer = BasicRenderer.extend({
|
||||
var visible_buttons = buttons_partition[1];
|
||||
|
||||
// Get the unfolded buttons according to window size
|
||||
var nb_buttons = [2, 4, 6, 7][config.device.size_class];
|
||||
var nb_buttons = this._renderButtonBoxNbButtons();
|
||||
var unfolded_buttons = visible_buttons.slice(0, nb_buttons).concat(invisible_buttons);
|
||||
|
||||
// Get the folded buttons
|
||||
@@ -318,6 +318,13 @@ var FormRenderer = BasicRenderer.extend({
|
||||
this._registerModifiers(node, this.state, $result);
|
||||
return $result;
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
* @returns {integer}
|
||||
*/
|
||||
_renderButtonBoxNbButtons: function () {
|
||||
return [2, 4, 6, 7][config.device.size_class];
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
* @param {Object} node
|
||||
|
||||
Reference in New Issue
Block a user