~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to analytic_distribution/account_commitment_view.xml

  • Committer: Olivier DOSSMANN
  • Date: 2013-05-31 14:22:09 UTC
  • mto: This revision was merged to the branch mainline in revision 1687.
  • Revision ID: od@tempo-consulting.fr-20130531142209-sbcwvzuema11guzz
UF-1991 [FIX] Problem with wizard on "msg" field. Change it to "name".

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<openerp>
 
3
    <data>
 
4
 
 
5
    <!-- Commitment -->
 
6
        <record model="ir.ui.view" id="account_commitment_form">
 
7
            <field name="name">account.commitment.form</field>
 
8
            <field name="model">account.commitment</field>
 
9
            <field name="type">form</field>
 
10
            <field name="arch" type="xml">
 
11
                <form string="Commitment Voucher" hide_duplicate_button="1">
 
12
                    <group col="6" colspan="4">
 
13
                        <field name="journal_id" domain="[('is_current_instance','=',True)]"/>
 
14
                        <field name="partner_id" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" attrs="{'readonly': ['|', ('type', '!=', 'manual'), ('state', '!=', 'draft')]}"/>
 
15
                        <newline/>
 
16
                        <field name="name"/>
 
17
                        <newline/>
 
18
                        <field name="date" on_change="onchange_date(date, period_id)"/>
 
19
                        <field name="period_id"/>
 
20
                        <newline/>
 
21
                        <field name="currency_id" attrs="{'readonly': ['|', ('type', '!=', 'manual'), ('state', '!=', 'draft')]}"/>
 
22
                        <field name="type"/>
 
23
                    </group>
 
24
                    <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="2" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}"/>
 
25
                    <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="2" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}"/>
 
26
                    <field name="analytic_distribution_id" invisible="1"/>
 
27
                    <notebook colspan="4">
 
28
                        <page string="Commitment voucher lines">
 
29
                            <field name="line_ids" nolabel="1" colspan="4" attrs="{'readonly': ['|', ('state', '=', 'done'), ('type', '=', 'external')]}"/>
 
30
                        </page>
 
31
                    </notebook>
 
32
                    <field name="notes" colspan="4"/>
 
33
                    <group col="6" colspan="4">
 
34
                        <button name="button_compute" string="Compute total" icon="gtk-execute" colspan="2"/>
 
35
                        <button name="commitment_open" string="Validate" icon="terp-camera_test" states="draft" colspan="2"/>
 
36
                        <button name="commitment_validate" string="Done" icon="terp-gtk-go-back-rtl" states="open" colspan="2" attrs="{'readonly': [('type', '=', 'external')]}"/>
 
37
                    </group>
 
38
                    <field name="state"/>
 
39
                    <field name="total"/>
 
40
                </form>
 
41
            </field>
 
42
        </record>
 
43
 
 
44
        <record model="ir.ui.view" id="account_commitment_tree">
 
45
            <field name="name">account.commitment.tree</field>
 
46
            <field name="model">account.commitment</field>
 
47
            <field name="type">tree</field>
 
48
            <field name="arch" type="xml">
 
49
                <tree string="Commitment Voucher" colors="blue:state == 'draft';grey:state == 'done';black:state == 'open'">
 
50
                    <field name="date"/>
 
51
                    <field name="name"/>
 
52
                    <field name="partner_id"/>
 
53
                    <field name="currency_id"/>
 
54
                    <field name="total" digits="(16,2)"/>
 
55
                    <field name="type"/>
 
56
                    <field name="state"/>
 
57
                    <button name="commitment_open" string="Validate" icon="terp-camera_test" states="draft"/>
 
58
                </tree>
 
59
            </field>
 
60
        </record>
 
61
 
 
62
    <!-- Commitment Lines -->
 
63
        <record model="ir.ui.view" id="account_commitment_line_tree">
 
64
            <field name="name">account.commitment.line.tree</field>
 
65
            <field name="model">account.commitment.line</field>
 
66
            <field name="type">tree</field>
 
67
            <field name="arch" type="xml">
 
68
                <tree string="Commitment Voucher Lines" editable="top" colors="blue:analytic_distribution_state in ('valid');red:analytic_distribution_state in ('invalid');black:analytic_distribution_state in ('none')">
 
69
                    <field name="account_id" domain="[('type', '!=', 'view'), ('user_type.code', '=', 'expense')]"/>
 
70
                    <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context"/>
 
71
                    <field name="analytic_distribution_state"/>
 
72
                    <field name="have_analytic_distribution_from_header"/>
 
73
                    <field name="first" invisible="1"/>
 
74
                    <field name="initial_amount" on_change="onchange_initial_amount(first, initial_amount)"/>
 
75
                    <field name="amount" attrs="{'readonly': [('first', '=', True)]}"/>
 
76
                </tree>
 
77
            </field>
 
78
        </record>
 
79
 
 
80
    <!-- Commitment Search view -->
 
81
        <record id="account_commitment_search" model="ir.ui.view">
 
82
            <field name="name">Commitment Voucher</field>
 
83
            <field name="model">account.commitment</field>
 
84
            <field name="type">search</field>
 
85
            <field name="arch" type="xml">
 
86
                <search string="Search Commitment Voucher">
 
87
                    <group col='6' colspan='4'>
 
88
                        <filter icon="terp-tools" string="Manual" domain="[('type','=','manual')]" help="Manual Commitment Voucher"/>
 
89
                        <filter icon="gtk-quit" string="External" domain="[('type','=','external')]" help="External Commitment Voucher"/>
 
90
                        <filter icon="terp-partner" string="ESC" domain="[('type','=','esc')]" help="ESC Commitment Voucher"/>
 
91
                        <separator orientation="vertical"/>
 
92
                        <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Commitment Voucher in Draft state" name="draft"/>
 
93
                        <filter icon="terp-camera_test" string="Validated" domain="[('state','=','open')]" help="Commitment Voucher in Validated state" name="validated"/>
 
94
                        <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" help="Commitment Voucher in Done state" name="done"/>
 
95
                        <filter icon="terp-emblem-important" string="Except Done" domain="[('state','!=','done')]" help="Commitment Voucher not in Done state" name="exceptdone"/>
 
96
                        <newline/>
 
97
                        <field name="currency_id" select="1"/>
 
98
                        <field name="date" select='1'/>
 
99
                        <field name="partner_id" select='1'/>
 
100
                    </group>
 
101
                    <newline/>
 
102
                </search>
 
103
            </field>
 
104
        </record>
 
105
 
 
106
    <!-- Commitment Voucher Actions -->
 
107
        <record model="ir.actions.act_window" id="action_account_commitment_tree">
 
108
            <field name="res_model">account.commitment</field>
 
109
            <field name="view_type">form</field>
 
110
            <field name="view_mode">tree,form</field>
 
111
            <field name="view_id" ref="account_commitment_tree"/>
 
112
            <field name="search_view_id" ref="account_commitment_search"/>
 
113
            <field name="context">{'search_default_exceptdone': 1}</field>
 
114
        </record>
 
115
 
 
116
        <record model="ir.actions.act_window" id="action_engagement_line_tree">
 
117
            <field name="res_model">account.analytic.line</field>
 
118
            <field name="view_type">form</field>
 
119
            <field name="view_mode">tree,form</field>
 
120
            <field name="context">{'search_default_engagements': 1, 'display_fp': True}</field>
 
121
        </record>
 
122
 
 
123
        <record id="action_commitment_voucher_engagement_lines_search" model="ir.actions.server">
 
124
            <field name="name">Analytic Lines (FP)</field>
 
125
            <field name="model_id" ref="model_account_commitment"/>
 
126
            <field name="state">code</field>
 
127
            <field name="code">action = obj.get_engagement_lines(context=context)</field>
 
128
        </record>
 
129
 
 
130
        <record id="ir_open_commitment_engagement_lines_search" model="ir.values">
 
131
            <field name="key2">client_action_multi</field>
 
132
            <field name="model">account.commitment</field>
 
133
            <field name="name">Analytic Lines (FP)</field>
 
134
            <field eval="'ir.actions.server,%d'%action_commitment_voucher_engagement_lines_search" name="value"/>
 
135
            <field eval="True" name="object"/>
 
136
        </record>
 
137
 
 
138
    <!-- Menu -->
 
139
        <menuitem id="menu_commitment" name="Commitments" parent="account.menu_finance" sequence="4"/>
 
140
        <menuitem name="Commitment Voucher" action="action_account_commitment_tree" id="menu_commitment_entries" parent="menu_commitment" sequence="1"/>
 
141
        <menuitem name="Commitment Lines" action="action_engagement_line_tree" id="menu_engagement_lines" parent="menu_commitment" sequence="2"/>
 
142
 
 
143
    </data>
 
144
</openerp>