Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

I want to customise invalid fields warning.

I want that user should close the warning instead of automatically disappearing warnings. The reason is suppose there are multiple fields that are required and user clicks on save and got invalid field warning but it disappears after 4-5 second. So user can't see the required fields properly and he have to again click on the save button and check what are those required fields.

I have tried to customise the below default method but it doesn't work for me:-

/web/static/src/js/views/basic/basic_controller.js


_notifyInvalidFields: function (invalidFields) {
    var record = this.model.get(this.handle, {raw: true});
    var fields = record.fields;
    var warnings = invalidFields.map(function (fieldName) {
        var fieldStr = fields[fieldName].string;
        return _.str.sprintf('
  • %s
  • '
    , _.escape(fieldStr)); }); warnings.unshift('
      '
    ); warnings.push(''); this.do_warn(_t("Invalid fields:"), warnings.join('')); },
    Do anyone have any idea how to change this thing or any other method is used to show this warning?


    Awatar
    Odrzuć
    Powiązane posty Odpowiedzi Widoki Czynność
    1
    cze 22
    2113
    1
    maj 24
    3147
    1
    kwi 24
    26750
    1
    lis 22
    2601
    2
    lip 22
    3296