changeset 8d07467c9b63 in modules/stock_supply:default
details: 
https://hg.tryton.org/modules/stock_supply?cmd=changeset&node=8d07467c9b63
description:
        Send only the required fields when fetching a readonly view definition

        issue11134
        review380081002
diffstat:

 location.py    |   2 --
 order_point.py |  23 ++++++++---------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diffs (99 lines):

diff -r 0fb7b188fb26 -r 8d07467c9b63 location.py
--- a/location.py       Thu Apr 07 00:06:34 2022 +0200
+++ b/location.py       Fri Apr 08 19:07:14 2022 +0200
@@ -18,7 +18,6 @@
         domain=[
             ('type', 'in', ['storage', 'view']),
             ],
-        depends=['type'],
         help='Leave empty for no default provisioning.')
     overflowing_location = fields.Many2One('stock.location',
         'Overflowing Location',
@@ -28,7 +27,6 @@
         domain=[
             ('type', 'in', ['storage', 'view']),
             ],
-        depends=['type'],
         help='Leave empty for no default overflowing.')
 
 
diff -r 0fb7b188fb26 -r 8d07467c9b63 order_point.py
--- a/order_point.py    Thu Apr 07 00:06:34 2022 +0200
+++ b/order_point.py    Fri Apr 08 19:07:14 2022 +0200
@@ -30,23 +30,21 @@
         context={
             'company': Eval('company', -1),
             },
-        depends=['type', 'company'])
+        depends={'company'})
     warehouse_location = fields.Many2One('stock.location',
         'Warehouse Location', select=True,
         domain=[('type', '=', 'warehouse')],
         states={
             'invisible': Not(Equal(Eval('type'), 'purchase')),
             'required': Equal(Eval('type'), 'purchase'),
-            },
-        depends=['type'])
+            })
     storage_location = fields.Many2One('stock.location', 'Storage Location',
         select=True,
         domain=[('type', '=', 'storage')],
         states={
             'invisible': Not(Equal(Eval('type'), 'internal')),
             'required': Equal(Eval('type'), 'internal'),
-        },
-        depends=['type'])
+        })
     location = fields.Function(fields.Many2One('stock.location', 'Location'),
             'get_location', searcher='search_location')
     provisioning_location = fields.Many2One(
@@ -56,8 +54,7 @@
             'invisible': Not(Equal(Eval('type'), 'internal')),
             'required': ((Eval('type') == 'internal')
                 & (Eval('min_quantity', None) != None)),  # noqa: E711
-        },
-        depends=['type', 'min_quantity'])
+        })
     overflowing_location = fields.Many2One(
         'stock.location', 'Overflowing Location',
         domain=[('type', 'in', ['storage', 'view'])],
@@ -65,8 +62,7 @@
             'invisible': Eval('type') != 'internal',
             'required': ((Eval('type') == 'internal')
                 & (Eval('max_quantity', None) != None)),  # noqa: E711
-            },
-        depends=['type', 'max_quantity'])
+            })
     type = fields.Selection(
         [('internal', 'Internal'),
          ('purchase', 'Purchase')],
@@ -80,8 +76,7 @@
         domain=['OR',
             ('min_quantity', '=', None),
             ('min_quantity', '<=', Eval('target_quantity', 0)),
-            ],
-        depends=['target_quantity', 'type'])
+            ])
     target_quantity = fields.Float(
         "Target Quantity", digits='unit', required=True,
         domain=[
@@ -93,8 +88,7 @@
                 ('max_quantity', '=', None),
                 ('target_quantity', '<=', Eval('max_quantity', 0)),
                 ],
-            ],
-        depends=['min_quantity', 'max_quantity'])
+            ])
     max_quantity = fields.Float(
         "Maximal Quantity", digits='unit',
         states={
@@ -103,8 +97,7 @@
         domain=['OR',
             ('max_quantity', '=', None),
             ('max_quantity', '>=', Eval('target_quantity', 0)),
-            ],
-        depends=['type', 'target_quantity'])
+            ])
     company = fields.Many2One('company.company', 'Company', required=True,
             domain=[
                 ('id', If(In('company', Eval('context', {})), '=', '!='),

Reply via email to