[FIX] stock_account: fixed wrong implementation of default value for property fields

bzr revid: qdp-launchpad@openerp.com-20131205131117-kuaubvz9esd025l7
This commit is contained in:
Quentin (OpenERP) 2013-12-05 14:11:17 +01:00
parent 4edc351bb6
commit 6afb907103
4 changed files with 13 additions and 16 deletions

View File

@ -56,7 +56,6 @@ Dashboard / Reports for Warehouse Management will include:
'product_data.xml',
'product_view.xml',
'stock_account_view.xml',
'valuationandcostmethod.yml',
],
'test': [

View File

@ -250,10 +250,6 @@ class product_product(osv.osv):
, required=True),
}
_defaults = {
'valuation': 'manual_periodic',
}
class product_template(osv.osv):
_name = 'product.template'
@ -278,10 +274,6 @@ class product_template(osv.osv):
"there is a specific valuation account set on the destination location. When not set on the product, the one from the product category is used."),
}
_defaults = {
'cost_method': 'standard',
}
class product_category(osv.osv):
_inherit = 'product.category'

View File

@ -3,7 +3,7 @@
<data noupdate="1">
<record id="stock_journal_sequence" model="ir.sequence">
<field name="name">Stock Journal Sequence</field>
<field name="name">stock journal sequence</field>
<field eval="3" name="padding"/>
<field name="prefix">STJ/%(year)s/</field>
</record>
@ -14,6 +14,18 @@
<field name="sequence_id" ref="stock_journal_sequence"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record forcecreate="True" id="default_cost_method" model="ir.property">
<field name="name">Cost Method Property</field>
<field name="fields_id" search="[('model', '=', 'product.template'), ('name', '=', 'cost_method')]"/>
<field name="value">standard</field>
<field name="type">selection</field>
</record>
<record forcecreate="True" id="default_valuation" model="ir.property">
<field name="name">Valuation Property</field>
<field name="fields_id" search="[('model', '=', 'product.product'), ('name', '=', 'valuation')]"/>
<field name="value">manual_periodic</field>
<field name="type">selection</field>
</record>
</data>
</openerp>

View File

@ -1,6 +0,0 @@
-
Write on all products valuation and cost method (temporary patch for default value problems for properties in demo data)
-
!python {model: product.product}: |
prod_ids = self.search(cr, uid, [])
self.write(cr, uid, prod_ids, {'cost_method':'real', 'valuation':'manual_periodic'})