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

        issue11134
        review380081002
diffstat:

 account.py |  17 +++++------------
 product.py |   2 +-
 2 files changed, 6 insertions(+), 13 deletions(-)

diffs (79 lines):

diff -r 1884ae2677eb -r 630ff4ddfab6 account.py
--- a/account.py        Wed Apr 06 23:37:42 2022 +0200
+++ b/account.py        Fri Apr 08 19:07:12 2022 +0200
@@ -51,8 +51,7 @@
             ('company', 'in', [Eval('company', -1), None]),
             ('sequence_type', '=',
                 Id('account_stock_landed_cost', 'sequence_type_landed_cost')),
-            ],
-        depends=['company'])
+            ])
 
     @classmethod
     def __register__(cls, module_name):
@@ -91,8 +90,7 @@
     company = fields.Many2One('company.company', 'Company', required=True,
         states={
             'readonly': Eval('state') != 'draft',
-            },
-        depends=['state'])
+            })
     shipments = fields.Many2Many('account.landed_cost-stock.shipment.in',
         'landed_cost', 'shipment', 'Shipments',
         states={
@@ -101,8 +99,7 @@
         domain=[
             ('company', '=', Eval('company')),
             ('state', 'in', ['received', 'done']),
-            ],
-        depends=['company', 'state'])
+            ])
     invoice_lines = fields.One2Many('account.invoice.line', 'landed_cost',
         'Invoice Lines',
         states={
@@ -117,15 +114,13 @@
             ('invoice.type', '=', 'in'),
             ('product.landed_cost', '=', True),
             ('type', '=', 'line'),
-            ],
-        depends=['state', 'company'])
+            ])
     allocation_method = fields.Selection([
             ('value', 'By Value'),
             ], 'Allocation Method', required=True,
         states={
             'readonly': Eval('state') != 'draft',
-            },
-        depends=['state'])
+            })
 
     categories = fields.Many2Many(
         'account.landed_cost-product.category', 'landed_cost', 'category',
@@ -133,7 +128,6 @@
         states={
             'readonly': Eval('state') != 'draft',
             },
-        depends=['state'],
         help="Apply only to products of these categories.")
     products = fields.Many2Many(
         'account.landed_cost-product.product', 'landed_cost', 'product',
@@ -141,7 +135,6 @@
         states={
             'readonly': Eval('state') != 'draft',
             },
-        depends=['state'],
         help="Apply only to these products.")
 
     posted_date = fields.Date('Posted Date', readonly=True)
diff -r 1884ae2677eb -r 630ff4ddfab6 product.py
--- a/product.py        Wed Apr 06 23:37:42 2022 +0200
+++ b/product.py        Fri Apr 08 19:07:12 2022 +0200
@@ -11,7 +11,7 @@
         "Landed Cost",
         states={
             'invisible': Eval('type') != 'service',
-            }, depends=['type'])
+            })
 
 
 class Product(metaclass=PoolMeta):

Reply via email to