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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<openerp>
    <data>
    
        <record id="view_analytic_account_form" model="ir.ui.view">
            <field name="name">analytic.account.form</field>
            <field name="model">account.analytic.account</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
            <field name="arch" type="xml">
                <data>
                    <field name="parent_id" position="replace">
                        <field name="parent_id" on_change="on_change_parent(parent_id)" required="1"/>
                    </field>
                    <field name="code" position="replace">
                        <field name="code" select="1" required="1"/>
                        <field name="category" select="1" invisible="1"/>
                    </field>
	                <page string="Account Data" position="replace">
	                    <page string="Account Data">
	                        <field name="date_start"/>
	                        <field name="date" select="2"/>
	                    </page>
	                </page>
                    <page string="Account Data" position="after">
                        <page string="Cost Centers" attrs="{'invisible': [('category', '!=', 'FUNDING')]}">
                            <field name="cost_center_ids" nolabel="1" domain="[('type', '!=', 'view'), ('category', '=', 'OC')]">
                                <tree string="Cost Centers" >
                                    <field name="code"/>
                                    <field name="name"/>
                                </tree>
                            </field>
                        </page>
                        <page string="Accounts" attrs="{'invisible': [('category', '!=', 'FUNDING')]}">
                            <field name="account_ids" nolabel="1" domain="[('type', '!=', 'view'), ('user_type_code', '=', 'expense')]"/>
                        </page>
                    </page>
                </data>
            </field>
        </record>
        
        <record id="view_analytic_account_search" model="ir.ui.view">
            <field name="name">analytic.account.search</field>
            <field name="model">account.analytic.account</field>
            <field name="type">search</field>
            <field name="inherit_id" ref="account.view_account_analytic_account_search"/>
            <field name="arch" type="xml">
                <filter string="Pending" position="before">
                    <filter name="active" icon="terp-check" string="Active"
                            domain="[('date_start', '&lt;=', datetime.date.today().strftime('%%Y-%%m-%%d')),
                                     ('|'),
                                     ('date', '&gt;', datetime.date.today().strftime('%%Y-%%m-%%d')),
                                     ('date', '=', False)]"/>
                </filter>
            </field>
        </record>
        
        <record id="view_account_analytic_account_tree_inherit" model="ir.ui.view">
            <field name="name">account.analytic.account.tree.inherit</field>
            <field name="model">account.analytic.account</field>
            <field name="type">tree</field>
            <field name="field_parent">child_complete_ids</field>
            <field name="inherit_id" ref="account.view_account_analytic_account_tree"/>
            <field name="arch" type="xml">
                <tree string="Analytic account" position="replace">
                    <tree colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic account" toolbar="1" expand_button="1">
                        <field name="name"/>
                        <field name="code"/>
                        <field name="description"/>
                        <field name="type"/>
                        <field name="date_start"/>
                        <field name="date"/>
                        <button name="button_wiz_hard_posting" states="open" string="Hard Posting" type="object" icon="terp-camera_test" context="context"/>
                    </tree>
                </tree>
            </field>
        </record>
        
        <record id="action_account_analytic_account_form" model="ir.actions.act_window">
            <field name="name">Analytic Accounts</field>
            <field name="res_model">account.analytic.account</field>
            <field name="inherit_id" ref="account.action_account_analytic_account_form"/>
            <field name="search_view_id" ref="view_analytic_account_search"/>
            <field name="view_id" ref="view_account_analytic_account_tree_inherit"/>
            <field name="context">{'search_default_active': 1}</field>
        </record>
        
        <menuitem action="action_account_analytic_account_form"
                  id="account.account_analytic_def_account"
                  parent="account.menu_analytic_accounting"
                  groups="analytic.group_analytic_accounting"/>
        
            
    </data>
</openerp>