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

« back to all changes in this revision

Viewing changes to analytic_distribution/account_commitment_view.xml

UF-385 [ADD] Added consumption_calculation module

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="red:analytic_distribution_state == 'invalid'">
69
 
                    <field name="account_id" domain="[('restricted_area', '=', 'commitment_lines')]"/>
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
 
        <record id="import_commitment_wizard_view" model="ir.ui.view">
107
 
            <field name="name">Import Intl Commitments</field>
108
 
            <field name="model">import.commitment.wizard</field>
109
 
            <field name="type">form</field>
110
 
            <field name="arch" type="xml">
111
 
                <form string="Import Intl Commitments">
112
 
                    <label string="Select a .CSV file to import." align="0.0" colspan="3"/>
113
 
                    <field name="import_file"/>
114
 
                    <separator colspan="4"/>
115
 
                    <group colspan="4" col="6">
116
 
                        <button special="cancel" string="Cancel" icon="gtk-cancel"/>
117
 
                        <button name="import_csv_commitment_lines" string="Import" type="object" icon="gtk-ok"/>
118
 
                    </group>
119
 
                </form>
120
 
            </field>
121
 
        </record>
122
 
 
123
 
    <!-- Commitment Voucher Actions -->
124
 
        <record model="ir.actions.act_window" id="action_account_commitment_tree">
125
 
            <field name="res_model">account.commitment</field>
126
 
            <field name="view_type">form</field>
127
 
            <field name="view_mode">tree,form</field>
128
 
            <field name="view_id" ref="account_commitment_tree"/>
129
 
            <field name="search_view_id" ref="account_commitment_search"/>
130
 
            <field name="context">{'search_default_exceptdone': 1, 'target_filename_prefix': 'Commitment Vouchers'}</field>
131
 
        </record>
132
 
 
133
 
        <record model="ir.actions.act_window" id="action_engagement_line_tree">
134
 
            <field name="res_model">account.analytic.line</field>
135
 
            <field name="view_type">form</field>
136
 
            <field name="view_mode">tree,form</field>
137
 
            <field name="domain">[('account_id.category', '=', 'FUNDING')]</field>
138
 
            <field name="context">{'search_default_engagements': 1, 'display_fp': True, 'target_filename_prefix': 'Commitment Lines'}</field>
139
 
        </record>
140
 
 
141
 
        <record id="action_commitment_voucher_engagement_lines_search" model="ir.actions.server">
142
 
            <field name="name">Analytic Lines (FP)</field>
143
 
            <field name="model_id" ref="model_account_commitment"/>
144
 
            <field name="state">code</field>
145
 
            <field name="code">action = obj.get_engagement_lines(context=context)</field>
146
 
        </record>
147
 
 
148
 
        <record id="ir_open_commitment_engagement_lines_search" model="ir.values">
149
 
            <field name="key2">client_action_multi</field>
150
 
            <field name="model">account.commitment</field>
151
 
            <field name="name">Analytic Lines (FP)</field>
152
 
            <field eval="'ir.actions.server,%d'%action_commitment_voucher_engagement_lines_search" name="value"/>
153
 
            <field eval="True" name="object"/>
154
 
        </record>
155
 
 
156
 
        <record id="action_import_commitment_wizard" model="ir.actions.act_window">
157
 
            <field name="name">Import Intl Commitments</field>
158
 
            <field name="type">ir.actions.act_window</field>
159
 
            <field name="res_model">import.commitment.wizard</field>
160
 
            <field name="view_type">form</field>
161
 
            <field name="view_mode">form</field>
162
 
            <field name="view_id" ref="import_commitment_wizard_view"/>
163
 
            <field name="target">new</field>
164
 
        </record>
165
 
 
166
 
    <!-- Menu -->
167
 
        <menuitem id="menu_commitment" name="Commitments" parent="account.menu_finance" sequence="4"/>
168
 
        <menuitem name="Commitment Voucher" action="action_account_commitment_tree" id="menu_commitment_entries" parent="menu_commitment" sequence="1"/>
169
 
        <menuitem name="Commitment Lines" action="action_engagement_line_tree" id="menu_engagement_lines" parent="menu_commitment" sequence="2"/>
170
 
        <menuitem name="Import Intl Commitments" action="action_import_commitment_wizard" id="menu_import_commitment" parent="menu_commitment" sequence="3"/>
171
 
 
172
 
    </data>
173
 
</openerp>