~unifield-team/unifield-wm/us-671-homere

« back to all changes in this revision

Viewing changes to analytic_distribution/account_commitment_view.xml

[MERGE] commitment lp:~unifield-team/unifield-wm/UF_675_commitments

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" hide_delete_button="1">
 
12
                    <group col="6" colspan="4">
 
13
                        <field name="journal_id"/>
 
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
                    <group colspan="6">
 
25
                        <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context" colspan="2"/>
 
26
                        <field name="analytic_distribution_line_count" nolabel="1" colspan="1"/>
 
27
                        <label string="" colspan="4"/>
 
28
                    </group>
 
29
                    <notebook colspan="4">
 
30
                        <page string="Commitment voucher lines">
 
31
                            <field name="line_ids" nolabel="1" colspan="4" attrs="{'readonly': ['|', ('state', '=', 'done'), ('type', '=', 'external')]}"/>
 
32
                        </page>
 
33
                    </notebook>
 
34
                    <group col="6" colspan="4">
 
35
                        <button name="button_compute" string="Compute total" icon="gtk-execute" colspan="2"/>
 
36
                        <button name="commitment_open" string="Validate" icon="terp-camera_test" states="draft" colspan="2"/>
 
37
                        <button name="commitment_validate" string="Done" icon="terp-gtk-go-back-rtl" states="open" colspan="2" attrs="{'readonly': [('type', '=', 'external')]}"/>
 
38
                    </group>
 
39
                    <field name="state"/>
 
40
                    <field name="total"/>
 
41
                </form>
 
42
            </field>
 
43
        </record>
 
44
 
 
45
        <record model="ir.ui.view" id="account_commitment_tree">
 
46
            <field name="name">account.commitment.tree</field>
 
47
            <field name="model">account.commitment</field>
 
48
            <field name="type">tree</field>
 
49
            <field name="arch" type="xml">
 
50
                <tree string="Commitment Voucher" colors="red:state == 'cancel';blue:state=='draft';black:state == 'black'" hide_delete_button="1">
 
51
                    <field name="date"/>
 
52
                    <field name="name"/>
 
53
                    <field name="partner_id"/>
 
54
                    <field name="currency_id"/>
 
55
                    <field name="total" digits="(16,2)"/>
 
56
                    <field name="type"/>
 
57
                    <field name="state"/>
 
58
                    <button name="commitment_open" string="Validate" icon="terp-camera_test" states="draft"/>
 
59
                </tree>
 
60
            </field>
 
61
        </record>
 
62
 
 
63
    <!-- Commitment Lines -->
 
64
        <record model="ir.ui.view" id="account_commitment_line_tree">
 
65
            <field name="name">account.commitment.line.tree</field>
 
66
            <field name="model">account.commitment.line</field>
 
67
            <field name="type">tree</field>
 
68
            <field name="arch" type="xml">
 
69
                <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')">
 
70
                    <field name="account_id" domain="[('type', '!=', 'view')]"/>
 
71
                    <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" context="context"/>
 
72
                    <field name="analytic_distribution_state"/>
 
73
                    <field name="have_analytic_distribution_from_header"/>
 
74
                    <field name="initial_amount"/>
 
75
                    <field name="amount"/>
 
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"/>
 
93
                        <filter icon="terp-camera_test" string="Validated" domain="[('state','=','open')]" help="Commitment Voucher in Validated state"/>
 
94
                        <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" help="Commitment Voucher in Done state"/>
 
95
                        <newline/>
 
96
                        <field name="currency_id" select="1"/>
 
97
                        <field name="date" select='1'/>
 
98
                        <field name="partner_id" select='1'/>
 
99
                    </group>
 
100
                    <newline/>
 
101
                </search>
 
102
            </field>
 
103
        </record>
 
104
 
 
105
    <!-- Actions -->
 
106
        <record model="ir.actions.act_window" id="action_account_commitment_tree">
 
107
            <field name="res_model">account.commitment</field>
 
108
            <field name="view_type">form</field>
 
109
            <field name="view_mode">tree,form</field>
 
110
            <field name="view_id" ref="account_commitment_tree"/>
 
111
            <field name="search_view_id" ref="account_commitment_search"/>
 
112
        </record>
 
113
 
 
114
        <record model="ir.actions.act_window" id="action_engagement_line_tree">
 
115
            <field name="res_model">account.analytic.line</field>
 
116
            <field name="view_type">form</field>
 
117
            <field name="view_mode">tree,form</field>
 
118
            <field name="context">{'search_default_engagements': 1}</field>
 
119
        </record>
 
120
 
 
121
    <!-- Menu -->
 
122
        <menuitem id="menu_commitment" name="Commitments" parent="account.menu_finance" sequence="5"/>
 
123
        <menuitem name="Commitment Voucher" action="action_account_commitment_tree" id="menu_commitment_entries" parent="menu_commitment" sequence="1"/>
 
124
        <menuitem name="Engagement Lines" action="action_engagement_line_tree" id="menu_engagement_lines" parent="menu_commitment" sequence="2"/>
 
125
 
 
126
    </data>
 
127
</openerp>