From 9edcfb7b54ddbe23a2a21e2da25d7ac8e27ee4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 1 Sep 2008 11:02:29 +0200 Subject: [PATCH] Add context on product for stock computation in selection view Add TODO to compute planned date of move --- purchase.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/purchase.py b/purchase.py index 389ef4bb7b..fcca0400ce 100644 --- a/purchase.py +++ b/purchase.py @@ -572,7 +572,9 @@ class PurchaseLine(OSV): states={ 'invisible': "type != 'line'", }, on_change=['product', 'unit', 'quantity', 'description', - 'parent.party', 'parent.currency']) + 'parent.party', 'parent.currency'], + context="{'locations': [parent.warehouse], " \ + "'stock_date_end': parent.purchase_date}") unit_price = fields.Numeric('Unit Price', digits=(16, 4), states={ 'invisible': "type != 'line'", @@ -854,6 +856,7 @@ class PurchaseLine(OSV): vals['company'] = line.purchase.company.id vals['unit_price'] = line.unit_price vals['currency'] = line.purchase.currency.id + #TODO compute the planned_date move_id = move_obj.create(cursor, user, vals, context=context)