~unifield-team/unifield-web/us-155

« back to all changes in this revision

Viewing changes to addons/openerp/controllers/templates/fieldresetpref.mako

  • Committer: jf
  • Date: 2013-12-18 19:13:46 UTC
  • mfrom: (4688.1.10 web-457)
  • Revision ID: jfb@tempo-consulting.fr-20131218191346-az320og10g9bqj1r
UF-1987 [IMP] Change the logic of the "set default" (right click on field)
UTP-457 [FIX] function "set as default value" not working for users other than admin
lp:~unifield-team/unifield-web/utp-457

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%inherit file="/openerp/controllers/templates/base_dispatch.mako"/>
 
2
 
 
3
<%def name="header()">
 
4
    <title>${_("Field Preferences")}</title>
 
5
    <script type="text/javascript">
 
6
    jQuery(document).ready(function(){
 
7
        if(openobject.dom.get('click_ok').value)
 
8
            window.frameElement.close();
 
9
        });
 
10
    </script>
 
11
 
 
12
</%def>
 
13
 
 
14
<%def name="content()">
 
15
<form action="/openerp/fieldpref/reset_apply" method="post">
 
16
 
 
17
    <input id="_terp_model" name="_terp_model" value="${model}" type="hidden"/>
 
18
    <input id="_terp_model" name="_terp_field" value="${field}" type="hidden"/>
 
19
    <input id="click_ok" name="click_ok" value="${click_ok}" type="hidden"/>
 
20
 
 
21
    <table class="view" cellspacing="5" border="0" width="100%">
 
22
        <tr>
 
23
            <td>
 
24
                <table width="100%" class="titlebar">
 
25
                    <tr>
 
26
                        <td width="100%"><h1>${string} ${_("field: Reset Preferences")}</h1></td>
 
27
                    </tr>
 
28
                </table>
 
29
            </td>
 
30
        </tr>
 
31
        <tr>
 
32
            <td>
 
33
                <div class="box2">
 
34
                % if values:
 
35
                    <table border="0" width="100%" align="center">
 
36
                     <tr>
 
37
                        <th>&nbsp;</th>
 
38
                        <th>Value</th>
 
39
                        <th>Applicable for</th>
 
40
                        <th>Condition</th>
 
41
                     </tr>
 
42
                      % for v in values:
 
43
                        <tr>
 
44
                            <td><input type="checkbox" name="_terp_to_del/${v['id']}" value="${v['id']}" ${len(values)==1 and 'checked="checked"' or ''}></td>
 
45
                            <td align="center">${v['real_value']}</td>
 
46
                            <td align="center">${v['user_id'] and _('Only for you') or _('For all')}</td>
 
47
                            <td align="center">${v['key2'] or _("Always applicable!")}</td>
 
48
                        </tr>
 
49
                     % endfor
 
50
                    </table>
 
51
                % else:
 
52
                    ${_('No default value')}
 
53
                % endif
 
54
                </div>
 
55
                <div class="toolbar">
 
56
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
 
57
                        <tr>
 
58
                            <td width="100%">
 
59
                        </td>
 
60
                        <td>
 
61
                            <a class="button-a" href="javascript: void(0)" onclick="window.frameElement.close()">${_("Close")}</a>
 
62
                        </td>
 
63
                        <td>
 
64
                          % if values:
 
65
                            <button type="submit">${_("Delete selection")}</button>
 
66
                          % endif
 
67
                        </td>
 
68
                        </tr>
 
69
                    </table>
 
70
                </div>
 
71
 
 
72
            </td>
 
73
        </tr>
 
74
    </table>
 
75
</form>
 
76
</%def>