Set cost_price_method as Property as it depends of the company like the

cost_price
This commit is contained in:
Cédric Krier
2008-10-31 14:12:58 +01:00
parent d71e739c17
commit 73097ce105
2 changed files with 11 additions and 3 deletions
+4 -3
View File
@@ -1,4 +1,5 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from trytond.osv import fields, OSV
STATES = {
@@ -28,10 +29,10 @@ class Template(OSV):
states=STATES, digits=(16, 4))
cost_price_uom = fields.Function('get_price_uom', string='Cost Price',
type="numeric", digits=(16, 4), states=STATES)
cost_price_method = fields.Selection([
cost_price_method = fields.Property(type='selection', selection=[
("fixed", "Fixed"),
("average", "Average")
], "Cost Method", required=True, states=STATES)
], string="Cost Method", required=True, states=STATES)
default_uom = fields.Many2One('product.uom', 'Default UOM', required=True,
states=STATES)
active = fields.Boolean('Active')
+7
View File
@@ -146,5 +146,12 @@
<field name="perm_delete" eval="True"/>
</record>
<record model="ir.property" id="property_product_cost_price_method">
<field name="name">cost_price_method</field>
<field name="field"
search="[('model.model', '=', 'product.template'), ('name', '=', 'cost_price_method')]"/>
<field name="value">,fixed</field>
</record>
</data>
</tryton>