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