Merge lp:~openerp-dev/openerp-web/6.1-opw-581235-cpa into lp:openerp-web/6.1

Proposed by Chirag Patel (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/6.1-opw-581235-cpa
Merge into: lp:openerp-web/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
addons/web/static/src/js/view_page.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/6.1-opw-581235-cpa
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+131854@code.launchpad.net

Description of the change

Hello,

Page view doesn't show o2m field when the field also has a o2m field but without values.

When displaying a form that has an one2many field with values which itself has an one2many field but without a value the whole first one2many field is made invisible. The form's first one2many field is displayed if the inner one2many field does have a value.

Demo: Add one o2m form inside res.partner.address.
1) Open any customer in page view.

Observed: res.partner.address doesn't show any field if inner o2m have no value.

Thanks.

To post a comment you must log in.

Unmerged revisions

2474. By Chirag Patel (OpenERP)

[FIX] Page view doesn't show o2m field when the field also has a o2m field but without values.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_page.js'
2--- addons/web/static/src/js/view_page.js 2012-05-16 08:26:16 +0000
3+++ addons/web/static/src/js/view_page.js 2012-10-29 10:46:30 +0000
4@@ -25,7 +25,7 @@
5 this.$form_header.find('button.oe_form_button_delete').click(this.on_button_delete);
6 },
7 do_show: function() {
8- if (this.dataset.index === null) {
9+ if (this.dataset.index === null && this.dataset.ids.length) {
10 this.dataset.index = this.previous_index || this.dataset.ids.length - 1;
11 }
12 this._super.apply(this, arguments);