Merge lp:~openerp-community/openerp-web/stefan-therp_lp883445 into lp:openerp-web

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merge reported by: Fabien Meghazi (OpenERP)
Merged at revision: not available
Proposed branch: lp:~openerp-community/openerp-web/stefan-therp_lp883445
Merge into: lp:openerp-web
Diff against target: 45 lines (+16/-1)
2 files modified
addons/web/static/src/js/view_form.js (+5/-1)
addons/web/static/src/xml/base.xml (+11/-0)
To merge this branch: bzr merge lp:~openerp-community/openerp-web/stefan-therp_lp883445
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Approve
Stefan Rijnhart (Opener) (community) Needs Resubmitting
Fabien Meghazi (OpenERP) Pending
Review via email: mp+80737@code.launchpad.net

Description of the change

This branch honours the 'string' attribute of a form view's 'group' tag. The presence of a non-empty string attribute triggers the rendering of the group in a bordered frame, labelled with the contents of the string attribute. This way, the behaviour of the new web client is equal to that of the GTK client and the old web client.

To post a comment you must log in.
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

In keeping with the naming conventions for the form view, I think the widget should be called `WidgetGroup` rather than `WidgetGroupFrame` (and of course fieldset's default style is not exactly sexy but that's a different issue, not one for this functional improvement).

Apart from that, looks OK to me, though I'll let fme look over it (as he's the go-to guy for form views).

review: Needs Fixing
1396. By Stefan Rijnhart (Opener)

[FIX] Changed widget name to WidgetGroup as per convention

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Xavier,

Thanks for the review! I updated the widget's name on your suggestion.

Cheers,
Stefan.

review: Needs Resubmitting
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) :
review: Approve

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_form.js'
2--- addons/web/static/src/js/view_form.js 2011-11-10 09:32:21 +0000
3+++ addons/web/static/src/js/view_form.js 2011-11-10 10:13:25 +0000
4@@ -950,6 +950,10 @@
5 }
6 });
7
8+openerp.web.form.WidgetGroup = openerp.web.form.WidgetFrame.extend({
9+ template: 'WidgetGroup',
10+}),
11+
12 openerp.web.form.WidgetNotebookPage = openerp.web.form.WidgetFrame.extend({
13 template: 'WidgetNotebookPage',
14 init: function(view, node, notebook, index) {
15@@ -3051,7 +3055,7 @@
16 */
17 openerp.web.form.widgets = new openerp.web.Registry({
18 'frame' : 'openerp.web.form.WidgetFrame',
19- 'group' : 'openerp.web.form.WidgetFrame',
20+ 'group' : 'openerp.web.form.WidgetGroup',
21 'notebook' : 'openerp.web.form.WidgetNotebook',
22 'notebookpage' : 'openerp.web.form.WidgetNotebookPage',
23 'separator' : 'openerp.web.form.WidgetSeparator',
24
25=== modified file 'addons/web/static/src/xml/base.xml'
26--- addons/web/static/src/xml/base.xml 2011-11-09 12:09:34 +0000
27+++ addons/web/static/src/xml/base.xml 2011-11-10 10:13:25 +0000
28@@ -729,6 +729,17 @@
29 </tr>
30 </table>
31 </t>
32+<t t-name="WidgetGroup">
33+ <t t-if="widget.string">
34+ <fieldset>
35+ <legend><t t-esc="widget.string"/></legend>
36+ <t t-call="WidgetFrame"/>
37+ </fieldset>
38+ </t>
39+ <t t-if="!widget.string">
40+ <t t-call="WidgetFrame"/>
41+ </t>
42+</t>
43 <t t-name="WidgetNotebook">
44 <ul>
45 <li t-foreach="widget.pages" t-as="page">