~openerp-chinese-team/openerp-china/openerp-china

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
<?xml version="1.0" encoding="utf-8"?>
<!-- __author__ = jeff@openerp.cn  -->
<openerp>
  <data>
    <!-- some changes on account move form view -->
    <record id="view_move_form" model="ir.ui.view">
      <field name="name">oecn_account_print.move_form</field>
      <field name="model">account.move</field>
      <field name="type">form</field>
      <field name="inherit_id" ref="account.view_move_form"/>
      <field name="arch" type="xml">                                                      
        <data>                                                                            
          <!-- Account Move form Header part -->
          <xpath expr="/form/group" position="replace">                                                   
            <field name="name" string="Move Number" readonly="True"/>
            <field name="write_uid" attrs="{'invisible':[('state','=','draft')]}"/>
            <field name="date"/>
            <field name="period_id"/>
            <field name="proof"/>
            <field name="create_uid" />
            <field name="journal_id" invisible="1"/>
          </xpath>                                                                         
          <!-- Account Move form Item part -->
          <field name="line_id" position='replace'>                                        
            <field colspan="4" name="line_id" nolabel="1" widget="one2many_list" 
                   default_get="{'lines':line_id ,'journal':journal_id }">
              <form string="Account Move Line">
                <notebook colspan="4">
                  <page string="General informations">
                    <field name="name"/>
                    <newline/>
                    <field name="date"/>
                    <field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>                 
                    <field name="debit" />
                    <field name="credit" />
                    <field name="date_created"/>
                    <field name="ref"/>
                    <field name="state"/>
                  </page>
                  <page string="Partner informations">
                    <field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
                    <field name="invoice"/>
                    <field name="date_maturity"/>
                    <newline/>
                    <field name="reconcile_id"/>
                    <field name="reconcile_partial_id"/>
                  </page>
                  <page string="Stock Informations">
                    <field name="product_id"/>
                    <field name="quantity"/>
                    <field name= "product_uom_id"/>
                  </page>
                  <page string="Cash informations">
                    <field name="amount_currency"/>
                    <field name="currency_id"/>
                    <field name="statement_id"/>
                  </page>
                  <page string="Cost information">
                    <field colspan="6" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
                  </page>
                </notebook>
              </form>
              <!-- Tree for fast edit --> 
              <tree editable="top" string="Account Entry Line">
                <field name="name"/>
                <field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
                <field name="debit" sum="Total Debit"/>
                <field name="credit" sum="Total Credit"/>
                <field name="analytic_account_id"/>
              </tree>
            </field>
          </field>
        </data>
      </field>
    </record>
  </data>
</openerp>