Cannot set Limit Option for O2M field

Bug #1310486 reported by Hardik Shah
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

I have a from view with a O2M field. I could not set the limit field to limit the number of rows displayed at a time on the Form view.

I suggest the following patch will allow setting a attribute list_options as attribute of O2M field in XML.

--- /opt/dev/OpenERP/openerp-7.0-20131211-002426/openerp/addons/web/static/src/js/view_form.js
+++ /opt/dev/OpenERP/openerp-7.0/openerp/addons/web/static/src/js/view_form.js
@@ -3520,6 +3520,11 @@
         var self = this;

         var modes = this.node.attrs.mode;
+ try {
+ var list_options = JSON.parse(this.node.attrs.list_options);
+ } catch(e) {
+ var list_options = {};
+ }
         modes = !!modes ? modes.split(",") : ["tree"];
         var views = [];
         _.each(modes, function(mode) {
@@ -3542,6 +3547,7 @@
                     import_enabled: false,
                     deletable: true
                 });
+ _.extend(view.options, list_options || {});
                 if (self.get("effective_readonly")) {
                     _.extend(view.options, {
                         deletable: null,

Version: 7.0-20131211-002426

Revision history for this message
Hardik Shah (hardik-vjti) wrote :

Attaching the Patch file

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.