[IMP,MOD] mrp_modules : Usability Improvements in MRP modules
[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">
11                     <field name="name" select="1" />
12                      <field name="product_id" select="1" />
13                      <field name="prodlot_id"/>
14                      <field name="partner_id"/>
15                      <field name="address_id"/>
16                      <field name="location_id"/>
17                      <field name="move_id"/>
18                      <field name="location_dest_id"/>
19                      <field name="guarantee_limit"/>
20                      <field name="state"/>
21                 </tree>
22             </field>
23         </record>
24
25     <record id="view_repair_order_form" model="ir.ui.view">
26         <field name="name">mrp.repair.form</field>
27         <field name="model">mrp.repair</field>
28         <field name="type">form</field>
29         <field name="arch" type="xml">
30             <form string="Repairs order">
31                 <group col="6" colspan="4">
32                     <field name="name"/>
33                     <field name="product_id" select="1"  on_change="onchange_product_id(product_id)"/>
34                     <field name="deliver_bool"/>
35                     <newline/>
36                     <field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)"/>
37                     <field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
38                     <field name="repaired"/>
39                     <newline/>
40                     <field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)"/>
41                     <field name="address_id"  attrs="{'readonly':[('deliver_bool','=', False)]}"/>
42                     <field name="invoiced"/>
43                 </group>
44                 <notebook colspan="4">
45                     <page string="Operations">
46                         <field name="guarantee_limit" />
47                         <newline/>
48                         <field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
49                             <form string="Operations">
50                                 <notebook>
51                                     <page string="Repair Line">
52                                         <field name="name" colspan="4"/>
53                                         <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" colspan="4"/>
54                                         <field name="product_uom_qty" string="Qty" />
55                                         <field name="product_uom" string="UoM"/>
56                                         <field name="price_unit"/>
57                                         <field name="price_subtotal"/>
58                                         <field name="location_id"/>
59                                         <field name="location_dest_id"/>
60                                         <newline/>
61                                         <field name="type"  on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
62                                         <group colspan="2">
63                                             <field name="to_invoice"/>
64                                             <field name="invoiced"/>
65                                         </group>
66                                         <newline/>
67                                         <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
68                                         <separator colspan="4" string="States"/>
69                                         <field name="state"/>
70                                     </page>
71                                     <page string="History" groups="base.group_extended">
72                                         <field colspan="4" name="move_id" />
73                                         <field colspan="4" name="invoice_line_id"/>
74                                     </page>
75
76                                  </notebook>
77                             </form>
78                             <tree string="Operations" editable="bottom">
79                                 <field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
80                                 <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
81                                 <field name='name'/>
82                                 <field name="location_id"/>
83                                 <field name="location_dest_id"/>
84                                 <field name="product_uom_qty" string="Qty"/>
85                                 <field name="product_uom" string="UoM"/>
86                                 <field name="price_unit"/>
87                                 <field name="tax_id"/>
88                                 <field name="to_invoice"/>
89                                 <field name="price_subtotal"/>
90                             </tree>
91                         </field>
92                         <newline/>
93                         <group col="7" colspan="4">
94                             <field name="amount_untaxed" sum="Untaxed amount"/>
95                             <field name="amount_tax"/>
96                             <field name="amount_total" sum="Total amount"/>
97                             <button name="button_dummy" states="draft" string="Compute" type="object"/>
98                         </group>
99                         <newline/>
100                         <group col="13" colspan="4">
101                             <field name="state"/>
102                             <button name="repair_confirm" states="draft" string="Confirm Repair" icon="gtk-apply"/>
103                             <button name="repair_ready" states="confirmed" string="Start Repair" icon="gtk-execute"/>
104                             <button name="action_repair_start" states="ready" string="Start Repair" icon="gtk-execute"/>
105                             <button name="action_repair_end" states="under_repair" string="End Repair" icon="gtk-ok"/>
106                             <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" icon="gtk-convert"/>
107                             <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected" icon="gtk-apply"/>
108                             <button name="action_invoice_create" states="2binvoiced" string="Make Invoice" icon="gtk-ok"/>
109                             <button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action" icon="gtk-cancel"/>
110                             <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
111                             <button name="cancel" states="draft" string="Cancel Repair" icon="gtk-cancel"/>
112                             <button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action" icon="gtk-cancel"/>
113                         </group>
114                     </page>
115                     <page string="Invoicing">
116                         <field name="invoice_method" colspan="4"/>
117                         <field
118                             name="pricelist_id" context="product_id=product_id"
119                             attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
120                         <field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
121                         <!-- <field name="invoice_id"/> -->
122                         <field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
123                             <form string="Fees">
124                                 <notebook>
125                                     <page string="Fees Line">
126                                         <field name='name'/>
127                                         <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"/>
128                                         <field name="product_uom_qty" string="Qty"/>
129                                         <field name="product_uom" string="UoM" />
130                                         <field name="price_unit"/>
131                                         <field name="price_subtotal"/>
132                                         <newline/>
133                                         <group colspan="2">
134                                             <field name="to_invoice"/>
135                                             <field name="invoiced"/>
136                                         </group>
137                                         <newline/>
138                                         <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
139                                      </page>
140                                      <page string="History" groups="base.group_extended">
141                                         <field colspan="4" name="invoice_line_id" />
142                                     </page>
143                                   </notebook>
144                             </form>
145                             <tree string="Fees" editable="bottom">
146                                 <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)"/>
147                                 <field name='name'/>
148                                 <field name="product_uom_qty" string="Qty"/>
149                                 <field name="product_uom" string="UoM"/>
150                                 <field name="price_unit"/>
151                                 <field name="to_invoice"/>
152                                 <field name="price_subtotal"/>
153                             </tree>
154                         </field>
155                     </page>
156                     <page string="Quality">
157                         <separator colspan="4" string="Internal Notes"/>
158                         <field colspan="4" name="internal_notes" nolabel="1"/>
159                         <separator colspan="4" string="Quotation Notes"/>
160                         <field colspan="4" name="quotation_notes" nolabel="1"/>
161                     </page>
162                     <page string="Extra Info" groups="base.group_extended">
163                         <field name="invoice_id"/>
164                         <field name="picking_id"/>
165                         <field name="location_id"/>
166                         <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
167                     </page>
168                 </notebook>
169             </form>
170         </field>
171     </record>
172
173
174
175     <record id="view_repair_order_form_filter" model="ir.ui.view">
176           <field name="name">mrp.repair.select</field>
177           <field name="model">mrp.repair</field>
178           <field name="type">search</field>
179           <field name="arch" type="xml">
180               <search string="Search Reair Orders">
181                 <group col='4' colspan='4'>
182                         <field name="name" />
183                     <field name="product_id" />
184                 </group>
185                 <newline/>
186                   <group expand="1" string="Group By" colspan="10" col="8">
187                       <filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product_id'}"/>
188                       <filter string="State" icon="terp-mrp" domain="[]" context="{'group_by':'state'}"/>
189                       <filter string="Partner" icon="terp-mrp" domain="[]" context="{'group_by':'partner_id'}"/>
190                   </group>
191              </search>
192           </field>
193         </record>
194
195         <record id="action_repair_order_form" model="ir.actions.act_window">
196             <field name="name">New Repair</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">form,tree</field>
201         </record>
202
203          <record id="action_repair_order_tree" model="ir.actions.act_window">
204             <field name="name">Repair Orders</field>
205             <field name="type">ir.actions.act_window</field>
206             <field name="res_model">mrp.repair</field>
207             <field name="view_type">form</field>
208             <field name="view_mode">tree,form</field>
209             <field name="search_view_id" ref="view_repair_order_form_filter"/>
210         </record>
211
212          <record id="action_repair_quotation_tree" model="ir.actions.act_window">
213             <field name="name">Repairs in quotation</field>
214             <field name="type">ir.actions.act_window</field>
215             <field name="res_model">mrp.repair</field>
216             <field name="view_type">form</field>
217             <field name="view_mode">tree,form</field>
218             <field name="domain">[('state','=','draft')]</field>
219             <field name="filter" eval="True"/>
220         </record>
221
222         <record id="action_repair_progress_tree" model="ir.actions.act_window">
223             <field name="name">Repairs in progress</field>
224             <field name="type">ir.actions.act_window</field>
225             <field name="res_model">mrp.repair</field>
226             <field name="view_type">form</field>
227             <field name="view_mode">tree,form</field>
228             <field name="domain">[('state','=','under_repair')]</field>
229             <field name="filter" eval="True"/>
230         </record>
231
232         <record id="action_repair_ready_tree" model="ir.actions.act_window">
233             <field name="name">Repairs Ready to Start</field>
234             <field name="type">ir.actions.act_window</field>
235             <field name="res_model">mrp.repair</field>
236             <field name="view_type">form</field>
237             <field name="view_mode">tree,form</field>
238             <field name="domain">[('state','!=','draft'),('state','!=','under_repair'),('state','!=','2binvoiced'),('state','!=','invoice_except'),('state','!=','done'),('state','!=','cancel'),]</field>
239             <field name="filter" eval="True"/>
240         </record>
241
242         <record id="action_repair_2binvoiced_tree" model="ir.actions.act_window">
243             <field name="name">Repairs to be invoiced</field>
244             <field name="type">ir.actions.act_window</field>
245             <field name="res_model">mrp.repair</field>
246             <field name="view_type">form</field>
247             <field name="view_mode">tree,form</field>
248             <field name="domain">[('state','=','2binvoiced')]</field>
249             <field name="filter" eval="True"/>
250         </record>
251
252         <menuitem action="action_repair_order_tree" id="menu_repair_order" parent="mrp.menu_mrp_manufacturing" name="Repairs" sequence="50"/>
253
254     </data>
255 </openerp>