Product-Backlog-475: Move the field in stock
authorsbh (Open ERP) <sbh@tinyerp.com>
Wed, 9 Jun 2010 06:38:21 +0000 (12:08 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Wed, 9 Jun 2010 06:38:21 +0000 (12:08 +0530)
bzr revid: sbh@tinyerp.com-20100609063821-c4d0pisnp00ek71s

addons/product/product.py
addons/product/product_data.xml
addons/product/product_view.xml
addons/stock/product.py
addons/stock/product_view.xml
addons/stock/stock_demo.xml

index 52d6439..f577437 100644 (file)
@@ -209,13 +209,6 @@ class product_category(osv.osv):
         'child_id': fields.one2many('product.category', 'parent_id', string='Child Categories'),
         'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
         'type': fields.selection([('view','View'), ('normal','Normal')], 'Category Type'),
-        'property_stock_variation': fields.property(
-          'account.account',
-          type='many2one', 
-          relation='account.account', 
-          string="Stock variation Account", 
-          method=True,
-          view_load=True,  help="This account will be used in product when valuation type is real-time valuation ",),
     }
     
 
@@ -465,9 +458,6 @@ class product_product(osv.osv):
         'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')),
         'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')),
         'pricelist_id': fields.dummy(string='Pricelist',relation='product.pricelist', type='many2one'),
-        'valuation':fields.selection([('manual_periodic','Manual Periodic Valuation'),
-                                        ('real_time','Real Time valuation'),
-                                        ('','')],'Valuation',help="Decide if the system must automatically  creates account moves based on stock moves"),
     }
 
     def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
index c163515..4763c19 100644 (file)
@@ -145,11 +145,6 @@ parameter) will see those record just disappear.
             <field name="name">Stock Weight</field>
             <field name="digits">2</field>
         </record>
-        <record forcecreate="True" id="property_stock_variation" model="ir.property">
-            <field name="name">property_stock_variation</field>
-            <field name="fields_id" search="[('model','=','product.category'),('name','=','property_stock_variation')]"/>
-                       <field eval="'account.account,'+str(ref('account.a_recv'))" model="account.account" name="value"/>
-                       <field name="company_id" ref="base.main_company"/>            
-        </record>
+       
     </data>
 </openerp>
index 44250e5..8fbe2ed 100644 (file)
                             <field name="price_extra" groups="base.group_extended"/>
                             <newline/>
                             <field groups="base.group_extended" name="cost_method"/>
-                             <field name="valuation"/>
                             <newline/>
                             <field colspan="4" name="seller_ids" nolabel="1"/>
                         </page>
index 5336143..5c9a87a 100644 (file)
@@ -312,6 +312,9 @@ class product_product(osv.osv):
         'track_incoming': fields.boolean('Track Incoming Lots', help="Forces to use a tracking lot during receptions"),
         'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to use a tracking lot during deliveries"),
         'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one', domain=[('usage','=','internal')]),
+        'valuation':fields.selection([('manual_periodic','Manual Periodic Valuation'),
+                                        ('real_time','Real Time valuation'),
+                                        ('','')],'Valuation',help="Decide if the system must automatically  creates account moves based on stock moves"),
     }
     def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
         res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
@@ -417,6 +420,13 @@ class product_category(osv.osv):
             type='many2one', relation='account.account',
             string='Stock Output Account', method=True, view_load=True,
             help='This account will be used to value the output stock'),
+    'property_stock_variation': fields.property(
+          'account.account',
+          type='many2one', 
+          relation='account.account', 
+          string="Stock variation Account", 
+          method=True,
+          view_load=True,  help="This account will be used in product when valuation type is real-time valuation ",),            
     }
 
 product_category()
index 02c6096..0800731 100644 (file)
@@ -27,6 +27,7 @@
                         <field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                         <field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                         <field name="property_stock_journal"/>
+                        <field name="property_stock_variation"/>
                     </group>
                 </form>
             </field>
@@ -61,6 +62,7 @@
             <field name="inherit_id" ref="product.product_normal_form_view"/>
             <field name="arch" type="xml">
                 <field name="standard_price" position="replace">
+                 <field name="valuation"/>
                     <label string="Cost Price" align="1.0"/>
                     <group col="2" colspan="1">
                         <field name="standard_price" readonly="True" nolabel="1"/>
index 65553e9..bfa1845 100644 (file)
             <field name="company_id" ref="res_company_tinyshop0"/>
             <field name="lot_input_id" ref="stock_location_shop1"/>
         </record>
-
+               
+               <record forcecreate="True" id="property_stock_variation" model="ir.property">
+            <field name="name">property_stock_variation</field>
+            <field name="fields_id" search="[('model','=','product.category'),('name','=','property_stock_variation')]"/>
+                       <field eval="'account.account,'+str(ref('account.a_recv'))" model="account.account" name="value"/>
+                       <field name="company_id" ref="base.main_company"/>            
+        </record>
 
     </data>
 </openerp>