This commit is contained in:
Mathias Behrle committed 2008-12-19 12:13:04 +01:00
commit ce8a3cbb9d
1 file changed
+6 -1
+6 -1
View File
@@ -780,7 +780,8 @@ class PurchaseLine(OSV):
}, on_change=['product', 'unit', 'quantity', 'description',
'_parent_purchase.party', '_parent_purchase.currency'],
context="{'locations': [_parent_purchase.warehouse], " \
"'stock_date_end': _parent_purchase.purchase_date}")
"'stock_date_end': _parent_purchase.purchase_date, " \
"'purchasable': True}")
unit_price = fields.Numeric('Unit Price', digits=(16, 4),
states={
'invisible': "type != 'line'",
@@ -1166,6 +1167,10 @@ class Template(OSV):
on_change_with=['default_uom', 'purchase_uom'])
def default_purchasable(self, cursor, user, context=None):
if context is None:
context = {}
if context.get('purchasable'):
return True
return False
def on_change_with_purchase_uom(self, cursor, user, ids, vals,