[IMP] mrp_repair: usability improvements
[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_tree" model="ir.ui.view">
6         <field name="name">mrp.repair.tree</field>
7         <field name="model">mrp.repair</field>
8         <field name="type">tree</field>
9         <field name="arch" type="xml">
10             <tree string="Repairs order" colors="gray:state in ('done','cancel');black:state not in ('done','cancel');blue:state=='draft'">
11                 <field name="name" select="1" />
12                 <field name="product_id" select="1" />
13                 <field name="move_id"/>
14                 <field name="partner_id"/>
15                 <field name="address_id"/>
16                 <field name="location_id"/>
17                 <field name="location_dest_id"/>
18                 <field name="guarantee_limit"/>
19                 <field name="state"/>
20             </tree>
21         </field>
22     </record>
23
24     <record id="view_repair_order_form" model="ir.ui.view">
25         <field name="name">mrp.repair.form</field>
26         <field name="model">mrp.repair</field>
27         <field name="type">form</field>
28         <field name="arch" type="xml">
29             <form string="Repairs order">
30                 <group col="6" colspan="4">
31                     <field name="name"/>
32                     <field name="product_id" select="1"  on_change="onchange_product_id(product_id)"/>
33                     <field name="deliver_bool"/>
34                     <newline/>
35                     <field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)"/>
36                     <field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
37                     <field name="repaired"/>
38                     <newline/>
39                     <field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)"/>
40                     <field name="address_id"  attrs="{'readonly':[('deliver_bool','=', False)]}"/>
41                     <field name="invoiced"/>
42                 </group>
43                 <notebook colspan="4">
44                     <page string="Operations">
45                         <field name="guarantee_limit" />
46                         <newline/>
47                         <field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
48                             <form string="Operations">
49                                 <notebook>
50                                     <page string="Repair Line">
51                                         <field name="name" colspan="4"/>
52                                         <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" colspan="4"/>
53                                         <field name="product_uom_qty" string="Qty" />
54                                         <field name="product_uom" string="UoM"/>
55                                         <field name="price_unit"/>
56                                         <field name="price_subtotal"/>
57                                         <field name="location_id"/>
58                                         <field name="location_dest_id"/>
59                                         <newline/>
60                                         <field name="type"  on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
61                                         <group colspan="2">
62                                             <field name="to_invoice"/>
63                                             <field name="invoiced"/>
64                                         </group>
65                                         <newline/>
66                                         <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
67                                         <separator colspan="4" string="States"/>
68                                         <field name="state"/>
69                                     </page>
70                                     <page string="History" groups="base.group_extended">
71                                         <field colspan="4" name="move_id" />
72                                         <field colspan="4" name="invoice_line_id"/>
73                                     </page>
74
75                                  </notebook>
76                             </form>
77                             <tree string="Operations" editable="bottom">
78                                 <field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
79                                 <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
80                                 <field name='name'/>
81                                 <field name="location_id"/>
82                                 <field name="location_dest_id"/>
83                                 <field name="product_uom_qty" string="Qty"/>
84                                 <field name="product_uom" string="UoM"/>
85                                 <field name="price_unit"/>
86                                 <field name="tax_id"/>
87                                 <field name="to_invoice"/>
88                                 <field name="price_subtotal"/>
89                             </tree>
90                         </field>
91                         <newline/>
92                         <group col="7" colspan="4">
93                             <field name="amount_untaxed" sum="Untaxed amount"/>
94                             <field name="amount_tax"/>
95                             <field name="amount_total" sum="Total amount"/>
96                             <button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
97                         </group>
98                         <separator string="" colspan="4"/>
99                         <group col="13" colspan="4">
100                             <field name="state"/>
101                             <button name="repair_confirm" states="draft" string="Confirm Repair" icon="terp-camera_test"/>
102                             <button name="repair_ready" states="confirmed" string="Start Repair" icon="terp-gtk-jump-to-ltr"/>
103                             <button name="action_repair_start" states="ready" string="Start Repair" icon="terp-gtk-jump-to-ltr"/>
104                             <button name="action_repair_end" states="under_repair" string="End Repair" icon="terp-dialog-close"/>
105                             <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" icon="terp-dolar"/>
106                             <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected" icon="terp-emblem-important"/>
107                             <button name="action_invoice_create" states="2binvoiced" string="Make Invoice" icon="terp-dolar"/>
108                             <button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action" icon="gtk-stop"/>
109                             <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
110                             <button name="cancel" states="draft" string="Cancel Repair" icon="gtk-stop"/>
111                             <button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action" icon="gtk-stop"/>
112                         </group>
113                     </page>
114                     <page string="Invoicing">
115                         <field name="invoice_method" colspan="4"/>
116                         <field
117                             name="pricelist_id" context="product_id=product_id"
118                             attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
119                         <field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
120                         <!-- <field name="invoice_id"/> -->
121                         <field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
122                             <form string="Fees">
123                                 <notebook>
124                                     <page string="Fees Line">
125                                         <field name='name'/>
126                                         <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"/>
127                                         <field name="product_uom_qty" string="Qty"/>
128                                         <field name="product_uom" string="UoM" />
129                                         <field name="price_unit"/>
130                                         <field name="price_subtotal"/>
131                                         <newline/>
132                                         <group colspan="2">
133                                             <field name="to_invoice"/>
134                                             <field name="invoiced"/>
135                                         </group>
136                                         <newline/>
137                                         <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
138                                      </page>
139                                      <page string="History" groups="base.group_extended">
140                                         <field colspan="4" name="invoice_line_id" />
141                                     </page>
142                                   </notebook>
143                             </form>
144                             <tree string="Fees" editable="bottom">
145                                 <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)"/>
146                                 <field name='name'/>
147                                 <field name="product_uom_qty" string="Qty"/>
148                                 <field name="product_uom" string="UoM"/>
149                                 <field name="price_unit"/>
150                                 <field name="to_invoice"/>
151                                 <field name="price_subtotal"/>
152                             </tree>
153                         </field>
154                     </page>
155                     <page string="Extra Info" groups="base.group_extended">
156                         <field name="invoice_id"/>
157                         <field name="picking_id"/>
158                         <field name="location_id"/>
159                         <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
160                     </page>
161                     <page string="Notes">
162                         <separator colspan="4" string="Internal Notes"/>
163                         <field colspan="4" name="internal_notes" nolabel="1"/>
164                         <separator colspan="4" string="Quotation Notes"/>
165                         <field colspan="4" name="quotation_notes" nolabel="1"/>
166                     </page>
167                 </notebook>
168             </form>
169         </field>
170     </record>
171
172
173
174     <record id="view_repair_order_form_filter" model="ir.ui.view">
175           <field name="name">mrp.repair.select</field>
176           <field name="model">mrp.repair</field>
177           <field name="type">search</field>
178           <field name="arch" type="xml">
179               <search string="Search Reair Orders">
180                   <group col='4' colspan='4'>
181                        <filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]"/>   
182                        <filter icon="terp-check" string="Confirmed" domain="[('state','=','confirmed')]" name="current" />
183                        <filter icon="terp-emblem-important" string="Ready To Repair" domain="[('state','=','ready')]"/>
184                        <separator orientation="vertical"/>
185                        <filter icon="terp-dolar" string="invoiced" domain="[('invoiced','=',True)]"/>
186                        <separator orientation="vertical"/>
187                        <field name="name"/>
188                        <field name="product_id"/>
189                        <field name="partner_id"/>
190                        <field name="state" />
191                   </group>
192                   <newline/>
193                   <group expand="0" string="Group By..." colspan="10" col="8">
194                       <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
195                       <separator orientation="vertical"/>
196                       <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
197                       <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
198                       <separator orientation="vertical"/>
199                       <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'guarantee_limit'}" help="Guarantee limit"/>
200                   </group>
201              </search>
202           </field>
203     </record>
204
205         
206
207          <record id="action_repair_order_tree" model="ir.actions.act_window">
208             <field name="name">Repair Orders</field>
209             <field name="type">ir.actions.act_window</field>
210             <field name="res_model">mrp.repair</field>
211             <field name="view_type">form</field>
212             <field name="view_mode">tree,form</field>
213             <field name="search_view_id" ref="view_repair_order_form_filter"/>
214         </record>    
215
216         <menuitem action="action_repair_order_tree" id="menu_repair_order" parent="mrp.menu_mrp_manufacturing" groups="mrp.group_mrp_user" name="Repair Orders" sequence="50"/>
217
218     </data>
219 </openerp>