attrs on delivery address
[odoo/odoo.git] / addons / mrp_repair / mrp_repair_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4     
5     <record id="view_repair_order_form" model="ir.ui.view">
6             <field name="name">mrp.repair.form</field>
7             <field name="model">mrp.repair</field>
8             <field name="type">form</field>
9             <field name="arch" type="xml">
10                 <form string="Repairs order">
11                     <group col="6" colspan="4">
12                         <field name="name"/>
13                         <field name="product_id" select="1"  on_change="onchange_product_id(product_id)"/>
14                         <field name="deliver_bool"/>
15                         <newline/>
16                         <field name="prodlot_id" select="2" on_change="onchange_lot_id(prodlot_id,product_id)"/>
17                         <field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
18                         <field name="repaired"/>
19                         <newline/>
20                         <field name="partner_id" select="2" on_change="onchange_partner_id(partner_id,address_id)"/>
21                         <field name="address_id"  attrs="{'readonly':[('deliver_bool','=', False)]}"/>
22                         <field name="invoiced"/>
23                     </group>
24                     <notebook colspan="4">
25                         <page string="Operations">
26                             <field name="guarantee_limit" />
27                             <newline/>
28                             <field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
29                                 <form string="Operations"> 
30                                     <notebook>
31                                         <page string="Repair Line">                                                                      
32                                                     <field name="name" colspan="4"/>                                                 
33                                                     <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" colspan="4"/>                                            
34                                                     <field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
35                                                     <field name="product_uom" string="UoM"/>
36                                                     <field name="price_unit"/>     
37                                                     <field name="price_subtotal"/>                                                  
38                                                     <field name="location_id"/>
39                                                     <field name="location_dest_id"/>
40                                             <newline/>
41                                             <field name="type"  on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
42                                             <group colspan="2">
43                                                 <field name="to_invoice"/>
44                                                     <field name="invoiced"/>  
45                                             </group>
46                                             <newline/>
47                                             <field colspan="4" name="tax_id" domain="[('parent_id','=',False)]"/>
48                                             <separator colspan="4" string="States"/>
49                                             <field name="state"/>
50                                                                                 </page>
51                                         <page string="History" groups="base.group_extended">
52                                             <field colspan="4" name="move_id" />
53                                             <field colspan="4" name="invoice_line_id"/>
54                                         </page>
55                                                          
56                                      </notebook>
57                                 </form>
58                                 <tree string="Operations" editable="bottom">
59                                     <field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
60                                     <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
61                                     <field name='name'/>
62                                     <field name="location_id"/>
63                                     <field name="location_dest_id"/>
64                                     <field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
65                                     <field name="product_uom" string="UoM"/>
66                                     <field name="price_unit"/>
67                                     <field name="to_invoice"/>
68                                     <field name="price_subtotal"/>
69                                 </tree>
70                             </field>
71                             <newline/>
72                             <group col="7" colspan="4">
73                                 <field name="amount_untaxed" sum="Untaxed amount"/>
74                                 <field name="amount_tax"/>
75                                 <field name="amount_total" sum="Total amount"/>
76                                 <button name="button_dummy" states="draft" string="Compute" type="object"/>
77                             </group>
78                             <newline/>
79                             <group col="13" colspan="4">
80                                 <field name="state" select="2"/>
81                                 <button name="repair_confirm" states="draft" string="Confirm Repair"/>
82                                 <button name="repair_ready" states="confirmed" string="Start Repair"/>
83                                 <button name="action_repair_start" states="ready" string="Start Repair"/>
84                                 <button name="action_repair_end" states="under_repair" string="End Repair"/>
85                                 <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
86                                 <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
87                                 <button name="action_invoice_create" states="2binvoiced" string="Make Invoice"/>
88                                                                 <button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action"/>
89                                 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
90                                 <button name="cancel" states="draft" string="Cancel Repair"/>                                
91                                 <button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action"/>
92                             </group>
93                         </page>
94                         <page string="Invoicing">
95                             <field name="invoice_method" colspan="4" />
96                             <field name="pricelist_id" context="product_id=product_id" attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
97                             <field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
98                             <!--<field name="invoice_id"/>-->
99                             <field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
100                                 <form string="Fees">
101                                     <notebook>
102                                         <page string="Fees Line"> 
103                                             <field name='name'/>  
104                                                     <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)" colspan="4"/>
105                                                     <field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
106                                                     <field name="product_uom" string="UoM" /> 
107                                                     <field name="price_unit"/>  
108                                                     <field name="price_subtotal"/>  
109                                             <newline/>
110                                             <group colspan="2">                                                
111                                                 <field name="to_invoice"/>
112                                                     <field name="invoiced"/>  
113                                             </group>
114                                             <newline/>
115                                             <field colspan="4" name="tax_id" domain="[('parent_id','=',False)]"/>
116                                          </page>
117                                                                                  <page string="History" groups="base.group_extended">                                            
118                                             <field colspan="4" name="invoice_line_id" />                                            
119                                         </page>     
120                                       </notebook>                     
121                                 </form>
122                                 <tree string="Fees" editable="bottom">
123                                     <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
124                                     <field name='name'/>
125                                     <field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
126                                     <field name="product_uom" string="UoM"/>
127                                     <field name="price_unit"/>
128                                     <field name="to_invoice"/>
129                                     <field name="price_subtotal"/>
130                                 </tree>
131                             </field>
132                         </page>
133                         <page string="Quality">
134                             <separator colspan="4" string="Internal Notes"/>
135                             <field colspan="4" name="internal_notes" nolabel="1"/>
136                             <separator colspan="4" string="Quotation Notes"/>
137                             <field colspan="4" name="quotation_notes" nolabel="1"/>
138                         </page>
139                         <page string="Extra Info" groups="base.group_extended">                            
140                             <field name="invoice_id"/>
141                             <field name="picking_id"/>
142                             <field name="location_id"/>
143                             <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
144                         </page>
145                     </notebook>
146                 </form>
147             </field>
148         </record>
149         
150         <record id="view_repair_order_tree" model="ir.ui.view">
151             <field name="name">mrp.repair.tree</field>
152             <field name="model">mrp.repair</field>
153             <field name="type">tree</field>
154             <field name="arch" type="xml">
155                 <tree string="Repairs order">
156                         <field name="name" select="1" />
157                         <field name="product_id" select="1" />
158                         <field name="prodlot_id" select="2"/>
159                         <field name="partner_id" select="2"/>
160                         <field name="address_id"/>
161                             <field name="location_id"/>
162                             <field name="state" select="2"/>
163                             <field name="move_id"/>
164                             <field name="location_dest_id"/>
165                             <field name="guarantee_limit"/>
166                 </tree>
167             </field>
168         </record>
169         
170         <record id="action_repair_order_form" model="ir.actions.act_window">
171             <field name="name">New Repair</field>
172             <field name="type">ir.actions.act_window</field>
173             <field name="res_model">mrp.repair</field>
174             <field name="view_type">form</field>
175             <field name="view_mode">form,tree</field>
176         </record>
177         
178          <record id="action_repair_order_tree" model="ir.actions.act_window">
179             <field name="name">Repair Orders</field>
180             <field name="type">ir.actions.act_window</field>
181             <field name="res_model">mrp.repair</field>
182             <field name="view_type">form</field>
183             <field name="view_mode">tree,form</field>
184         </record>
185         
186          <record id="action_repair_quotation_tree" model="ir.actions.act_window">
187             <field name="name">Repairs in quotation</field>
188             <field name="type">ir.actions.act_window</field>
189             <field name="res_model">mrp.repair</field>
190             <field name="view_type">form</field>
191             <field name="view_mode">tree,form</field>
192             <field name="domain">[('state','=','draft')]</field>
193         </record>
194         
195         <record id="action_repair_progress_tree" model="ir.actions.act_window">
196             <field name="name">Repairs in progress</field>
197             <field name="type">ir.actions.act_window</field>
198             <field name="res_model">mrp.repair</field>
199             <field name="view_type">form</field>
200             <field name="view_mode">tree,form</field>
201             <field name="domain">[('state','=','confirmed')]</field>
202         </record>
203         
204         <record id="action_repair_2binvoiced_tree" model="ir.actions.act_window">
205             <field name="name">Repairs to be invoiced</field>
206             <field name="type">ir.actions.act_window</field>
207             <field name="res_model">mrp.repair</field>
208             <field name="view_type">form</field>
209             <field name="view_mode">tree,form</field>
210             <field name="domain">[('state','=','2binvoiced')]</field>
211         </record>
212         
213         <menuitem action="action_repair_order_tree" id="menu_repair_order" parent="mrp.menu_mrp_root" name="Repairs"/>
214         
215         <menuitem action="action_repair_quotation_tree" id="menu_repair_quotation" parent="menu_repair_order"/>
216         
217         <menuitem action="action_repair_progress_tree" id="menu_repair_progress" parent="menu_repair_order"/>
218         
219         <menuitem action="action_repair_2binvoiced_tree" id="menu_repair_2binvoiced" parent="menu_repair_order"/>
220         
221         <menuitem action="action_repair_order_form" id="menu_repair_form" parent="menu_repair_order" sequence = "50"/>
222         
223         
224     </data>
225 </openerp>