You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
916 B

  1. /* Copyright 2013 Therp BV (<http://therp.nl>).
  2. * Copyright 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
  3. * Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
  4. * Copyright 2017 Sodexis <dev@sodexis.com>
  5. * Copyright 2018 Camptocamp SA
  6. * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
  7. odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require) {
  8. var ListRenderer = require('web.ListRenderer');
  9. ListRenderer.include({
  10. _renderBodyCell: function (record, node, colIndex, options) {
  11. if (!node.attrs.widget && this.state.fields[node.attrs.name].type === 'many2one') {
  12. // no explicit widget provided on a many2one field,
  13. // force `many2one` widget
  14. node.attrs.widget = 'many2one';
  15. }
  16. return this._super(record, node, colIndex, options);
  17. }
  18. });
  19. });