changeset 0daec31b788d in modules/purchase:default
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=0daec31b788d
description:
        Use search context for product field on line

        The context is only useful when searching product from line on the 
client.
        So it is better to minimize the context to improve the caching.

        issue9519
        review310181002
diffstat:

 purchase.py |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 750e6f66ab13 -r 0daec31b788d purchase.py
--- a/purchase.py       Wed Jul 29 22:51:13 2020 +0200
+++ b/purchase.py       Sun Aug 16 16:52:00 2020 +0200
@@ -1038,6 +1038,9 @@
             'required': Bool(Eval('product_supplier')),
             },
         context={
+            'company': Eval('company', None),
+            },
+        search_context={
             'locations': If(Bool(Eval('_parent_purchase', {}).get(
                         'warehouse')),
                 [Eval('_parent_purchase', {}).get('warehouse', None)],
@@ -1045,8 +1048,6 @@
             'stock_date_end': Eval('_parent_purchase', {}).get(
                 'purchase_date'),
             'stock_skip_warehouse': True,
-            # From _get_context_purchase_price
-            'company': Eval('company', None),
             'currency': Eval('_parent_purchase', {}).get('currency'),
             'supplier': Eval('_parent_purchase', {}).get('party'),
             'purchase_date': Eval('_parent_purchase', {}).get('purchase_date'),

Reply via email to