~unifield-team/unifield-web/us-2156

« back to all changes in this revision

Viewing changes to addons/openerp/widgets/_views.py

  • Committer: jf
  • Date: 2016-10-25 09:51:48 UTC
  • mfrom: (4807.4.1 unifield-web)
  • Revision ID: jfb@tempo-consulting.fr-20161025095148-ksuumgr4w7ndjs47
US-1647 [FIX] List view: keep approximation when user switches from tree to form view

lp:~fabien-morin/unifield-web/fm-us-1647

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
    def __call__(self, screen):
94
94
        fields = screen.view['fields']
95
95
        screen.search_domain = convert_date_format_in_domain(screen.search_domain, fields, screen.context)
96
 
 
97
96
        if screen.group_by_ctx or screen.context.get('group_by') or screen.context.get('group_by_no_leaf'):
98
97
            widget = listgroup.ListGroup(screen.name or '_terp_list',
99
98
                                        model=screen.model,
106
105
                                        selectable=screen.selectable,
107
106
                                        offset=screen.offset, limit=screen.limit,
108
107
                                        count=screen.count, nolinks=screen.link,
109
 
                                        group_by_ctx=screen.group_by_ctx)
 
108
                                        group_by_ctx=screen.group_by_ctx,
 
109
                                        approximation=screen.approximation)
110
110
        else:
111
111
            widget = listgrid.List(screen.name or '_terp_list',
112
112
                                    model=screen.model,
121
121
                                    count=screen.count, nolinks=screen.link,
122
122
                                    m2m=screen.m2m, o2m=screen.o2m,
123
123
                                    default_data=screen.default_value,
124
 
                                    force_readonly=screen.force_readonly)
 
124
                                    force_readonly=screen.force_readonly,
 
125
                                    approximation=screen.approximation)
125
126
 
126
127
        screen.ids = widget.ids
127
128
        screen.limit = widget.limit
128
129
        screen.count = widget.count
129
 
 
 
130
        screen.approximation = widget.approximation or False
130
131
        return widget
131
132
 
132
133