Product-Backlog-475: Move the field in stock

bzr revid: sbh@tinyerp.com-20100609063821-c4d0pisnp00ek71s
This commit is contained in:
sbh (Open ERP)
2010-06-09 12:08:21 +05:30
parent 64d9c8b104
commit a339ef21cf
6 changed files with 20 additions and 18 deletions
-10
View 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):
+1 -6
View 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>
-1
View File
@@ -148,7 +148,6 @@
<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>
+10
View 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()
+2
View 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"/>
+7 -1
View File
@@ -288,7 +288,13 @@
<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>