~openerp-dev/openerp-web/6.1-web-custo-tfr

« back to all changes in this revision

Viewing changes to addons/web/static/src/js/view_form.js

[MERGE] fix scroll up

Show diffs side-by-side

added added

removed removed

Lines of Context:
526
526
                f = self.fields[f];
527
527
                if (!f.is_valid()) {
528
528
                    form_invalid = true;
529
 
                    f.update_dom(true);
530
529
                    if (!first_invalid_field) {
531
530
                        first_invalid_field = f;
532
531
                    }
536
535
                    // on 'edit' : save non readonly modified fields
537
536
                    values[f.name] = f.get_value();
538
537
                }
 
538
                f.update_dom(true);
539
539
            }
540
540
            if (form_invalid) {
541
541
                first_invalid_field.focus();
747
747
                            field_to_set,
748
748
                            self.fields[field_to_set].get_value(),
749
749
                            all_users,
750
 
                            false,
 
750
                            true,
751
751
                            condition || false
752
752
                    ]).then(function () { d.close(); });
753
753
                }}
799
799
 
800
800
        this._super(parent, $section.attr('id'));
801
801
        this.view = form_view;
 
802
        this.attachment_title = function (name) {
 
803
            return _.str.sprintf(_t("Delete the attachment %s"), name);
 
804
        };
802
805
    },
803
806
    do_update: function() {
804
807
        if (!this.view.datarecord.id) {
2705
2708
openerp.web.form.One2ManyDataSet = openerp.web.BufferedDataSet.extend({
2706
2709
    get_context: function() {
2707
2710
        this.context = this.o2m.build_context([this.o2m.name]);
2708
 
        return this.context;
 
2711
        return this._super.apply(this, arguments);
2709
2712
    }
2710
2713
});
2711
2714
 
2818
2821
        this.o2m.view.do_save().then(function () {
2819
2822
            _super(name, id, callback);
2820
2823
        });
 
2824
    },
 
2825
    reload_record: function (record) {
 
2826
        // Evict record.id from cache to ensure it will be reloaded correctly
 
2827
        this.dataset.evict_from_cache(record.get('id'));
 
2828
 
 
2829
        return this._super(record);
2821
2830
    }
2822
2831
});
2823
2832
openerp.web.form.One2ManyList = openerp.web.ListView.List.extend({