[IMP] hr_recruitment, project: better access rules for categories
[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="arch" type="xml">
9             <tree string="Repairs order" colors="gray:state in ('done','cancel');black:state not in ('done','cancel');blue:state=='draft'">
10                 <field name="name" />
11                 <field name="product_id" />
12                 <field name="move_id"/>
13                 <field name="partner_id"/>
14                 <field name="address_id"/>
15                 <field name="location_id" groups="stock.group_locations"/>
16                 <field name="location_dest_id" groups="stock.group_locations"/>
17                 <field name="company_id" groups="base.group_multi_company" invisible="1"/>
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="arch" type="xml">
28             <form string="Repair Order" version="7.0">
29                <header>
30                    <button name="repair_confirm" states="draft" string="Confirm Repair" class="oe_highlight"/>
31                    <button name="repair_ready" states="confirmed,ready" string="Start Repair" class="oe_highlight"/>
32                    <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
33                    <button name="action_repair_end" states="under_repair" string="End Repair" class="oe_highlight"/>
34                    <button name="action_invoice_create" states="2binvoiced" string="Make Invoice" class="oe_highlight"/>
35                    <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
36                    <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
37                    <button name="action_cancel" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="object" attrs="{'invisible':[('invoice_method','!=','none')]}"/>
38                    <button name="action_cancel" states="invoice_except" string="Cancel Repair" type="object" attrs="{'invisible':[('invoice_method','!=','none')]}"/>
39                    <button name="cancel" states="draft" string="Cancel Repair"/>
40                    <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done"/>
41                </header>
42                <sheet string="Repairs order">
43                     <label for="product_id" class="oe_edit_only"/>
44                     <h1>
45                     </h1>
46                     <label for="name" class="oe_edit_only"/>
47                     <h1>
48                         Repair Order <field name="name" class="oe_inline"/>
49                     </h1>
50                     <group>
51                         <group>
52                             <field name="product_id" on_change="onchange_product_id(product_id)" domain="[('type','!=','service')]"/>
53                             <field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)" attrs="{'required':[('invoice_method','!=','none')]}"/>
54                             <field name="address_id"  attrs="{'readonly':[('deliver_bool','=', False)]}" groups="sale.group_delivery_invoice_address"/>
55                             <field name="move_id" on_change="onchange_move_id(product_id, move_id)" context="{'default_product_id':product_id}"/>
56                             <field name="location_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
57                             <field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)" groups="stock.group_production_lot" string="Serial Number"/>
58                         </group>
59                         <group>
60                             <field name="guarantee_limit"/>
61                             <field name="deliver_bool"/>
62                             <field name="repaired" groups="base.group_no_one"/>
63                             <field name="invoiced" groups="base.group_no_one"/>
64                         </group>
65                     </group>
66                 <notebook>
67                     <page string="Operations">
68                         <field name="operations">
69                             <form string="Operations" version="7.0">
70                                 <notebook>
71                                     <page string="Repair Line">
72                                         <group col="4">
73                                             <field name="name"/>
74                                             <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
75                                             <label for="product_uom_qty"/>
76                                             <div>
77                                                 <field name="product_uom_qty" class="oe_inline"/>
78                                                 <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
79                                             </div>
80                                             <field name="price_unit"/>
81                                             <field name="price_subtotal"/>
82                                             <field name="type"  on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
83                                             <field name="to_invoice"/>
84                                             <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
85                                             <field name="invoiced"/>
86                                             <field name='prodlot_id' groups="stock.group_production_lot" string="Serial Number"/>
87                                             <field name="location_id" groups="stock.group_locations"/>
88                                             <field name="location_dest_id" groups="stock.group_locations"/>
89                                         </group>
90                                     </page>
91                                     <page string="History">
92                                         <group>
93                                             <field name="move_id" />
94                                             <field name="invoice_line_id"/>
95                                         </group>
96                                     </page>
97                                  </notebook>
98                             </form>
99                             <tree string="Operations" editable="bottom">
100                                 <field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
101                                 <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
102                                 <field name='name'/>
103                                 <field name="prodlot_id" groups="stock.group_production_lot" string="Serial Number"/>
104                                 <field name="location_id" groups="stock.group_locations"/>
105                                 <field name="location_dest_id" groups="stock.group_locations"/>
106                                 <field name="product_uom_qty" string="Quantity"/>
107                                 <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
108                                 <field name="price_unit"/>
109                                 <field name="tax_id" widget="many2many_tags"/>
110                                 <field name="to_invoice"/>
111                                 <field name="price_subtotal"/>
112                             </tree>
113                         </field>
114                         <group class="oe_subtotal_footer oe_right">
115                             <field name="amount_untaxed" sum="Untaxed amount"/>
116                             <field name="amount_tax"/>
117                             <field name="amount_total" sum="Total amount" class="oe_subtotal_footer_separator"/>
118                         </group>
119                         <button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
120                         <div class="oe_clear"/>
121                     </page>
122                     <page string="Invoicing">
123                         <group col="4">
124                             <field name="invoice_method"/>
125                             <field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')],'required':[('invoice_method','!=','none')]}" groups="sale.group_delivery_invoice_address"/>
126                             <field
127                                 name="pricelist_id" groups="product.group_sale_pricelist" context="{'product_id':product_id}"
128                                 attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
129                         </group>
130                         <!-- <field name="invoice_id"/> -->
131                         <field name="fees_lines">
132                             <form string="Fees" version="7.0">
133                                 <label for="name" class="oe_edit_only"/>
134                                 <h2>
135                                     <field name="name"/>
136                                 </h2>
137                                 <group string="Product Information">
138                                     <group>
139                                         <field name="to_invoice"/>
140                                         <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)"/>
141                                         <label for="product_uom_qty"/>
142                                         <div>
143                                             <field name="product_uom_qty" string="Quantity" class="oe_inline"/>
144                                             <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
145                                         </div>
146                                     </group>
147                                     <group>
148                                         <field name="price_unit"/>
149                                         <field widget="many2many_tags" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
150                                         <field name="price_subtotal"/>
151                                     </group>
152                                 </group>
153                                 <group string="History">
154                                     <group>
155                                         <field name="invoiced"/>
156                                     </group>
157                                     <group>
158                                         <field name="invoice_line_id" />
159                                     </group>
160                                 </group>
161                             </form>
162                             <tree string="Fees" editable="bottom">
163                                 <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)"/>
164                                 <field name='name'/>
165                                 <field name="product_uom_qty" string="Quantity"/>
166                                 <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
167                                 <field name="price_unit"/>
168                                 <field name="to_invoice"/>
169                                 <field name="price_subtotal"/>
170                             </tree>
171                         </field>
172                     </page>
173                     <page string="Extra Info">
174                         <group>
175                             <group>
176                                 <field name="picking_id"/>
177                                 <field name="invoice_id"/>
178                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
179                             </group>
180                             <group>
181                                 <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
182                             </group>
183                         </group>
184                     </page>
185                     <page string="Notes">
186                         <field name="internal_notes" placeholder="Add internal notes..."/>
187                         <field name="quotation_notes" placeholder="Add quotation notes..."/>
188                     </page>
189                 </notebook>
190                 </sheet>
191                 <div class="oe_chatter">
192                     <field name="message_ids" widget="mail_thread"/>
193                     <field name="message_follower_ids" widget="mail_followers"/>
194                 </div>
195             </form>
196         </field>
197     </record>
198
199
200
201     <record id="view_repair_order_form_filter" model="ir.ui.view">
202           <field name="name">mrp.repair.select</field>
203           <field name="model">mrp.repair</field>
204           <field name="arch" type="xml">
205               <search string="Search Reair Orders">
206                   <field name="name" string="Reair Orders"/>
207                   <field name="state"/>
208                   <filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]"/>
209                   <filter icon="terp-check" string="Confirmed" domain="[('state','=','confirmed')]" name="current" />
210                   <filter icon="terp-emblem-important" string="Ready To Repair" domain="[('state','=','ready')]"/>
211                   <separator/>
212                   <filter icon="terp-dolar" string="Invoiced" domain="[('invoiced','=',True)]"/>
213                   <field name="product_id"/>
214                   <field name="partner_id"/>
215                   <group expand="0" string="Group By...">
216                       <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
217                       <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
218                       <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
219                       <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'guarantee_limit'}" help="Guarantee limit"/>
220                       <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
221                   </group>
222               </search>
223           </field>
224     </record>
225
226
227
228          <record id="action_repair_order_tree" model="ir.actions.act_window">
229             <field name="name">Repair Orders</field>
230             <field name="type">ir.actions.act_window</field>
231             <field name="res_model">mrp.repair</field>
232             <field name="view_type">form</field>
233             <field name="view_mode">tree,form</field>
234             <field name="search_view_id" ref="view_repair_order_form_filter"/>
235             <field name="help" type="html">
236               <p class="oe_view_nocontent_create">
237                 Click to create a reparation order. 
238               </p><p>
239                 In a repair order, you can detail the components you remove,
240                 add or replace and record the time you spent on the different
241                 operations.
242               </p><p>
243                 The repair order uses the warranty date on the Serial Number in
244                 order to know if whether the repair should be invoiced to the
245                 customer or not.
246               </p>
247             </field>
248         </record>
249
250         <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"/>
251
252     </data>
253 </openerp>