[FIX]Hide the margin in SO if you see SO as a customer through portal, if 'Display...
[odoo/odoo.git] / addons / stock / product_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <record id="product_search_form_view_stock" model="ir.ui.view">
6             <field name="name">product.search.stock.form</field>
7             <field name="model">product.product</field>
8             <field name="inherit_id" ref="product.product_search_form_view"/>
9             <field name="arch" type="xml">
10                 <field name="pricelist_id" position="before">
11                     <field name="location_id" context="{'location': self}"/>
12                     <field name="warehouse_id" context="{'warehouse': self}"/>
13                 </field>
14             </field>
15         </record>
16
17         <record id="view_category_property_form" model="ir.ui.view">
18             <field name="name">product.category.stock.property.form.inherit</field>
19             <field name="model">product.category</field>
20             <field name="inherit_id" ref="account.view_category_property_form"/>
21             <field name="arch" type="xml">
22                 <data>
23                     <group name="account_property" position="after">
24                         <group name="account_stock_property" string="Account Stock Properties" colspan="2">
25                             <field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
26                             <field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
27                             <field name="property_stock_valuation_account_id" domain="[('type','&lt;&gt;','view'), ('type','&lt;&gt;','consolidation')]"/>
28                             <field name="property_stock_journal"/>
29                         </group>
30                     </group>
31                 </data>
32             </field>
33         </record>
34
35         <record id="view_template_property_form" model="ir.ui.view">
36             <field name="name">product.template.stock.property.form.inherit</field>
37             <field name="model">product.template</field>
38             <field name="inherit_id" ref="product.product_template_form_view"/>
39             <field name="arch" type="xml">
40                 <group name="delay" position="inside">
41                         <field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}"/>
42                 </group>
43                 <group name="delay" position="after">
44                         <group name="store" string="Storage Location">
45                         <field name="loc_rack"/>
46                         <field name="loc_row"/>
47                         <field name="loc_case"/>
48                         </group>
49                 </group>
50                 <page position="after" string="Information">
51                     <page string="Properties">
52                         <group string="Counter-Part Locations Properties" groups="stock.group_locations">
53                             <field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
54                             <field name="property_stock_production" domain="[('usage','=','production')]"/>
55                             <field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
56                         </group>
57                         <group string="Accounting Entries">
58                             <field name="property_stock_account_input" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
59                             <field name="property_stock_account_output" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
60                         </group>
61                     </page>
62                 </page>
63             </field>
64         </record>
65
66         <record id="view_normal_procurement_locations_form" model="ir.ui.view">
67             <field name="name">product.normal.procurement.locations.inherit</field>
68             <field name="model">product.product</field>
69             <field name="inherit_id" ref="product.product_normal_form_view"/>
70             <field name="arch" type="xml">
71                 <group name="procurement_uom" position="before">
72                     <group name="delay" string="Delays">
73                         <label for="produce_delay" attrs="{'invisible':[('type','=','service')]}"/>
74                         <div attrs="{'invisible':[('type','=','service')]}">
75                             <field name="produce_delay" class="oe_inline"/> days
76                         </div>
77                         <field name="active"/>
78                     </group>
79                 </group>
80                 <xpath expr="//group[@string='Sale Conditions']" position="inside">
81                     <label for="sale_delay"/>
82                         <div>
83                             <field name="sale_delay" class="oe_inline"/> days
84                         </div>
85                 </xpath>
86                 <group name="status" position="before" version="7.0">
87                     <group string="Stock and Expected Variations" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
88                         <label for="qty_available"/>
89                             <div>
90                                 <field name="qty_available" class="oe_inline"/>
91                                 <button name="%(action_view_change_product_quantity)d" string="update"
92                                 type="action"
93                                 class="oe_link"/>
94                             </div>
95                             <field name="incoming_qty" class="oe_inline"/>
96                             <field name="outgoing_qty" class="oe_inline"/>
97                             <field name="virtual_available" class="oe_inline"/>
98                     </group>
99                     <group name="lot" groups="stock.group_tracking_lot,stock.group_production_lot" string="Lots">
100                         <field name="track_production" groups="stock.group_production_lot"/>
101                         <field name="track_incoming" groups="stock.group_tracking_lot"/>
102                         <field name="track_outgoing" groups="stock.group_tracking_lot"/>
103                     </group>
104                 </group>
105                 <group name="status" position="after" version="7.0">
106                      <group name="store" string="Storage Location">
107                          <field name="company_id" groups="base.group_multi_company" widget="selection"/>
108                          <field name="loc_rack" attrs="{'invisible':[('type','=','service')]}"/>
109                          <field name="loc_row" attrs="{'invisible':[('type','=','service')]}"/>
110                          <field name="loc_case" attrs="{'invisible':[('type','=','service')]}"/>
111                      </group>
112                 </group>
113                 <group name="Weights" position="after">
114                      <group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties">
115                          <field name="property_stock_procurement" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','procurement')]"/>
116                          <field name="property_stock_production" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','production')]"/>
117                          <field name="property_stock_inventory"  attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','inventory')]"/>
118                      </group>
119                 </group>
120             </field>
121         </record>
122
123         <record id="view_product_standard_price_form" model="ir.ui.view">
124             <field name="name">product.product.standard.price.form.inherit</field>
125             <field name="model">product.product</field>
126             <field name="inherit_id" ref="product.product_normal_form_view"/>
127             <field name="arch" type="xml">
128                 <field name="standard_price" position="replace" version="7.0">
129                     <label string="Cost Price" for="standard_price" align="1.0" groups="base.group_user"/>
130                     <div groups="base.group_user">
131                         <field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}" nolabel="1"/>
132                         <button name="%(action_view_change_standard_price)d" string="- update"
133                             type="action" attrs="{'invisible':[('cost_method','&lt;&gt;','average')]}"
134                             class="oe_link" groups="product.group_costing_method"/>
135                     </div>
136                 </field>
137             </field>
138         </record>
139
140         <record id="view_normal_property_acc_form" model="ir.ui.view">
141             <field name="name">product.normal.stock.acc.property.form.inherit</field>
142             <field name="model">product.product</field>
143             <field name="inherit_id" ref="product.product_normal_form_view"/>
144             <field name="priority">26</field>
145             <field name="arch" type="xml">
146                 <xpath expr="//group[@name='properties']" position="before">
147                     <group groups="stock.group_inventory_valuation">
148                         <separator string="Inventory Valuation" colspan="4"/>
149                         <group colspan="2" col="2">
150                             <field name="valuation" attrs="{'readonly':[('type', '=', 'service')]}"/>
151                         </group>
152                         <group colspan="2" col="2">
153                             <field name="property_stock_account_input" attrs="{'invisible':[('valuation', '!=', 'real_time')]}"
154                                 domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
155                             <field name="property_stock_account_output" attrs="{'invisible':[('valuation', '!=', 'real_time')]}"
156                                 domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
157                         </group>
158                     </group>
159                     <newline/>
160                 </xpath>
161             </field>
162         </record>
163
164
165         <record id="action_receive_move" model="ir.actions.act_window">
166             <field name="name">Receptions</field>
167             <field name="res_model">stock.move</field>
168             <field name="type">ir.actions.act_window</field>
169             <field name="view_type">form</field>
170             <field name="view_mode">tree,form</field>
171             <field name="domain">[('picking_id.type','=','in')]</field>
172             <field name="view_id" ref="view_move_tree_reception_picking"/>
173             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
174             <field name="help" type="html">
175               <p class="oe_view_nocontent_create">
176                 Click to register a reception for this product. 
177               </p><p>
178                 Here you will find the history of all receptions related to
179                 this product, as well as all future receptions you are waiting
180                 from your suppliers.
181               </p>
182             </field>
183         </record>
184
185         <record id="action_deliver_move" model="ir.actions.act_window">
186             <field name="name">Deliveries</field>
187             <field name="res_model">stock.move</field>
188             <field name="type">ir.actions.act_window</field>
189             <field name="view_type">form</field>
190             <field name="view_mode">tree,form</field>
191             <field name="domain">[('picking_id.type','=','out')]</field>
192             <field name="view_id" ref="view_move_tree_reception_picking"/>
193             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
194             <field name="help" type="html">
195               <p class="oe_view_nocontent_create">
196                 Click to add a delivery order for this product.
197               </p><p>
198                 Here you will find the history of all past deliveries related to
199                 this product, as well as all the products you must deliver to
200                 customers.
201               </p>
202             </field>
203         </record>
204
205         <record model="ir.ui.view" id="product_kanban_stock_view">
206             <field name="name">Product Kanban Stock</field>
207             <field name="model">product.product</field>
208             <field name="inherit_id" ref="product.product_kanban_view"/>
209             <field name="arch" type="xml">
210                 <field name="list_price" position="after">
211                     <field name="reception_count"/>
212                     <field name="delivery_count"/>
213                 </field>
214                 <xpath expr="//div[@name='tags']" position="inside">
215                     <a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value>0">
216                         <t t-esc="record.reception_count.value"/> Receptions
217                     </a>
218                     <a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value>0">
219                         <t t-esc="record.delivery_count.value"/> Deliveries
220                     </a>
221                 </xpath>
222                 <ul position="inside">
223                     <li t-if="record.type.raw_value != 'service'">On hand: <field name="qty_available"/> <field name="uom_id"/></li>
224                     <li t-if="record.type.raw_value != 'service'">Forecasted: <field name="virtual_available"/> <field name="uom_id"/></li>
225                 </ul>
226             </field>
227         </record>
228
229     </data>
230 </openerp>