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.

49 lines
1.7 KiB

6 years ago
  1. /**********************************************************************************
  2. *
  3. * Copyright (C) 2018 MuK IT GmbH
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Affero General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. **********************************************************************************/
  19. odoo.define('muk_web_security.list_controller', function (require) {
  20. "use strict";
  21. var ajax = require('web.ajax');
  22. var core = require('web.core');
  23. var utils = require('web.utils');
  24. var ListRenderer = require('web.ListRenderer');
  25. var QWeb = core.qweb;
  26. var _t = core._t;
  27. ListRenderer.include({
  28. _setDecorationClasses: function (record, $tr) {
  29. this._super.apply(this, arguments);
  30. if(record.data.permission_write !== undefined && record.data.permission_write &&
  31. record.data.locked !== undefined && record.data.locked && !record.data.editor &&
  32. record.data.locked instanceof Object) {
  33. $tr.addClass("locked");
  34. } else {
  35. $tr.removeClass("locked");
  36. }
  37. if(record.data.permission_unlink !== undefined && !record.data.permission_unlink) {
  38. $tr.addClass("no_unlink");
  39. } else {
  40. $tr.removeClass("no_unlink");
  41. }
  42. },
  43. });
  44. });