[REF] web, base, website_sale_loyalty: remove unnecessary flags on action

action act_window can have a "flags" field which contains tweaking parameter for the views.
A little inventory:
- ation_buttons: if true displays on List and Kanban the buttons that trigger action
  in the control-panel bottom left area. It is true by default in JS.
- withControlPanel: whether to display the ControlPanel as a whole. True by default.
- search_view: not used or dealt with.
- mode ("readonly"|"edit") whether to initiate a form view in that mode.
  (used and practical -- but will be outdated when the edit mode by default is implemented)

This commit removes the occurences of those flags keys that are useless

closes odoo/odoo#94078

Related: odoo/enterprise#28620
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Lucas Perais (lpe)
2022-06-22 14:28:43 +02:00
parent 0532a00d94
commit 2cafc7be88
10 changed files with 3 additions and 27 deletions
@@ -124,12 +124,6 @@ var DataImport = AbstractAction.extend({
});
this.do_action(_.extend(action, {
target: 'new',
flags: {
search_view: true,
display_title: true,
pager: true,
list: {selectable: false}
}
}));
},
},
@@ -461,11 +461,6 @@ var BoardView = FormView.extend({
_extractParamsFromAction(action) {
action.target = "inline";
action.flags = action.flags || {};
Object.assign(action.flags, {
hasActionMenus: false,
hasSearchView: false,
headless: true,
});
return this._super.apply(this, arguments);
},
});
@@ -9,6 +9,5 @@ export function editModelDebug(env, title, model, id) {
views: [[false, "form"]],
view_mode: "form",
target: "new",
flags: { action_buttons: true, headless: true },
});
}
@@ -154,8 +154,6 @@ odoo.define('web.ActionMenus', function (require) {
});
result.context = new Context(result.context || {}, activeIdsContext)
.set_eval_context(context);
result.flags = result.flags || {};
result.flags.new_window = true;
this.trigger('do-action', {
action: result,
options: {
@@ -7356,7 +7356,6 @@ QUnit.module('Views', {
type: 'ir.actions.act_window',
views: [[false, 'list']],
target: 'current',
flags: {'search_view': true, 'action_buttons': true},
}
};
@@ -921,11 +921,6 @@ QUnit.module('Views', {
res_model: 'foo',
type: 'ir.actions.act_window',
views: [[false, 'graph'], [false, 'kanban']],
flags: {
graph: {
additionalMeasures: ['product_id'],
}
},
});
assert.containsOnce(target, '.o_control_panel .o_graph_measures_list',
@@ -10063,9 +10063,7 @@ QUnit.module('Views', {
type: 'ir.actions.act_window',
views: [[3, 'list']],
search_view_id: [9, 'search'],
flags: {
context: { group_by: ['int_field'] },
},
context: { group_by: ['int_field'] },
},
};
@@ -90,7 +90,6 @@ class SaleCouponShare(models.TransientModel):
'view_mode': 'form',
'res_model': 'coupon.share',
'target': 'new',
'flags': {'form': {'action_buttons': True}},
'context': {
'form_view_initial_mode': 'edit',
'default_program_id': program and program.id or coupon.program_id.id,
@@ -765,7 +765,6 @@ class IrTranslation(models.Model):
'view_mode': 'tree',
'view_id': self.env.ref('base.view_translation_dialog_tree').id,
'target': 'current',
'flags': {'search_view': True, 'action_buttons': True},
'domain': domain,
'context': {},
}
+2 -2
View File
@@ -731,7 +731,7 @@ class Partner(models.Model):
'view_mode': 'form',
'res_id': self.commercial_partner_id.id,
'target': 'current',
'flags': {'form': {'action_buttons': True}}}
}
def open_parent(self):
""" Utility method used to add an "Open Parent" button in partner views """
@@ -743,7 +743,7 @@ class Partner(models.Model):
'views': [(address_form_id, 'form')],
'res_id': self.parent_id.id,
'target': 'new',
'flags': {'form': {'action_buttons': True}}}
}
def _get_contact_name(self, partner, name):
return "%s, %s" % (partner.commercial_company_name or partner.sudo().parent_id.name, name)