Merge lp:~openerp-dev/openobject-client-web/trunk-bug-714557-vda into lp:openobject-client-web/trunk

Proposed by Vaibhav Darji
Status: Merged
Approved by: Xavier (Open ERP)
Approved revision: 4596
Merged at revision: 4617
Proposed branch: lp:~openerp-dev/openobject-client-web/trunk-bug-714557-vda
Merge into: lp:openobject-client-web/trunk
Diff against target: 26 lines (+8/-4)
1 file modified
addons/openerp/widgets/listgrid.py (+8/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/trunk-bug-714557-vda
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Needs Fixing
Review via email: mp+50701@code.launchpad.net

Description of the change

When o2m found in inline editor overwrite edit_inline property.
So make them editable in popup.

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

Broken: if I apply the patch on 6.0, go into project > project > task, make the tasks list editable inline and click to edit a task I get a CherryPy error, no error normally.

In GTK client, edition of line is still inline it's just that the widget for a multiline relation is the count (like "( 0 )") as when the line is not editable inline, and editing that cell does not do anything (ideally it would be readonly). Can't we do the same thing, instead of trying to display a list within a list?

review: Needs Fixing
4596. By vda(OpenERP) <email address hidden>

[FIX] if Hidden fields are in inline editors then Add Hidden fields only if editors is found.

Revision history for this message
Vaibhav Darji (vaibhav-openerp) wrote :

Committed for:if Hidden fields are in inline editors then Add Hidden fields only if editors is found.

Revision history for this message
Vaibhav Darji (vaibhav-openerp) wrote :

> Broken: if I apply the patch on 6.0, go into project > project > task, make
> the tasks list editable inline and click to edit a task I get a CherryPy
> error, no error normally.
I have checked this issue and solved it.
>
> In GTK client, edition of line is still inline it's just that the widget for a
> multiline relation is the count (like "( 0 )") as when the line is not
> editable inline, and editing that cell does not do anything (ideally it would
> be readonly). Can't we do the same thing, instead of trying to display a list
> within a list?
I think,this is efficient solution for it.otherwise we need to do changes in o2m-widget.and In the list we display count of ids for o2m currently too.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

OK, project > project > task are not broken anymore but it still does not work right:

* Go into long term planning > plannings, with no planning
* [New] planning
* Enter a name
* Click on Time Encoding tab
* Click Planning Lines [New]
* In Qty UoM enter PCE and tab (for completion)
* Click Tasks [New]

In background you can see it creates a planning line, but it does not create a task.

review: Needs Fixing
Revision history for this message
Vaibhav Darji (vaibhav-openerp) wrote :

> OK, project > project > task are not broken anymore but it still does not work
> right:
>
> * Go into long term planning > plannings, with no planning
> * [New] planning
> * Enter a name
> * Click on Time Encoding tab
> * Click Planning Lines [New]
> * In Qty UoM enter PCE and tab (for completion)
> * Click Tasks [New]
>
> In background you can see it creates a planning line, but it does not create a
> task.

The bug you are describing is: https://bugs.launchpad.net/openobject-client-web/+bug/733089 which is separate issue than this one.
so this is not due to my change of code.

Thanks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/widgets/listgrid.py'
2--- addons/openerp/widgets/listgrid.py 2011-02-15 09:04:57 +0000
3+++ addons/openerp/widgets/listgrid.py 2011-03-09 12:43:13 +0000
4@@ -224,14 +224,18 @@
5 if not isinstance(fa, int):
6 fa['prefix'] = '_terp_listfields' + ((self.name != '_terp_list' or '') and '/' + self.name)
7 fa['inline'] = True
8-
9+ if fa.get('type') == 'one2many':
10+ self.edit_inline = False
11+ self.editors = {}
12+ break
13 Widget = get_widget(fa.get('type', 'char')) or get_widget('char')
14 self.editors[f] = Widget(**fa)
15
16 # generate hidden fields
17- for f, fa in self.hiddens:
18- fa['prefix'] = '_terp_listfields' + ((self.name != '_terp_list' or '') and '/' + self.name)
19- self.editors[f] = form.Hidden(**fa)
20+ if self.editors:
21+ for f, fa in self.hiddens:
22+ fa['prefix'] = '_terp_listfields' + ((self.name != '_terp_list' or '') and '/' + self.name)
23+ self.editors[f] = form.Hidden(**fa)
24
25 # limit the data
26 if self.pageable and len(self.data) > self.limit and self.limit != -1: