Limit cost method to fixed for service

issue2356
review34701002
This commit is contained in:
Xavier Codinas
2017-09-22 12:18:52 +02:00
parent adb79c27a8
commit 8a201cb9b8
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -1,3 +1,4 @@
* Limit cost method to fixed for service
* Move cost_price from Template to Product
Version 4.4.0 - 2017-05-01
+6 -2
View File
@@ -7,7 +7,7 @@ from decimal import Decimal
from sql import Null, Column
from trytond.model import ModelView, ModelSQL, Model, fields
from trytond.pyson import Eval
from trytond.pyson import Eval, If
from trytond.transaction import Transaction
from trytond.pool import Pool
from trytond import backend
@@ -60,7 +60,11 @@ class Template(ModelSQL, ModelView, CompanyMultiValueMixin):
"Cost Price", digits=price_digits), 'get_cost_price')
cost_price_method = fields.MultiValue(fields.Selection(
COST_PRICE_METHODS, "Cost Price Method", required=True,
states=STATES, depends=DEPENDS))
domain=[If((Eval('type') == 'service'),
('cost_price_method', '=', 'fixed'),
(),
)
], states=STATES, depends=DEPENDS + ['type']))
cost_price_methods = fields.One2Many(
'product.cost_price_method', 'template', "Cost Price Methods")
default_uom = fields.Many2One('product.uom', 'Default UOM', required=True,