Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
066d463e by Cédric Krier at 2023-01-27T14:02:57+01:00
Remove readonly states for account type in budget line

There is no lines field on budget line.
- - - - -
789cfefe by Cédric Krier at 2023-01-28T15:05:02+01:00
Make moves_drop invisible when moves_drop is empty
- - - - -
614e22be by Cédric Krier at 2023-01-27T14:04:37+01:00
Test all depends of fields

Since 4ceb8ad07bd5 the depends attribute contains only some of the depending
fields. Tests should include the computed depends.
- - - - -


4 changed files:

- modules/account_budget/account.py
- modules/sale_supply_drop_shipment/stock.py
- trytond/trytond/model/fields/field.py
- trytond/trytond/tests/test_tryton.py


Changes:

=====================================
modules/account_budget/account.py
=====================================
@@ -447,7 +447,6 @@
         states={
             'required': ~Eval('name') & ~Eval('account'),
             'invisible': Eval('name') | Eval('account'),
-            'readonly': Bool(Eval('lines', [-1])),
             },
         help="The account type the budget applies to.")
     account = fields.Many2One(


=====================================
modules/sale_supply_drop_shipment/stock.py
=====================================
@@ -662,7 +662,7 @@
     moves_drop = fields.One2Many(
         'stock.move', 'origin_drop', "Drop Moves", readonly=True,
         states={
-            'invisible': ~Eval('drop_moves'),
+            'invisible': ~Eval('moves_drop'),
             })
     customer_drop = fields.Function(fields.Many2One(
             'party.party', "Drop Customer",


=====================================
trytond/trytond/model/fields/field.py
=====================================
@@ -142,7 +142,9 @@
 
 def get_eval_fields(value):
     "Return fields evaluated"
-    return set(_iter_eval_fields(value))
+    fields = set(_iter_eval_fields(value))
+    fields.discard('context')  # TODO: remove when context is renamed
+    return fields
 
 
 def instanciate_values(Target, value, **extra):


=====================================
trytond/trytond/tests/test_tryton.py
=====================================
@@ -452,7 +452,11 @@
                     for attribute in [
                             'depends', 'on_change', 'on_change_with',
                             'selection_change_with', 'autocomplete']:
-                        depends = getattr(field, attribute, [])
+                        depends = getattr(field, attribute, set())
+                        if attribute == 'depends':
+                            depends |= field.display_depends
+                            depends |= field.edition_depends
+                            depends |= field.validation_depends
                         qualname = '"%s"."%s"."%s"' % (mname, fname, attribute)
                         for depend in depends:
                             test_depend_exists(model, depend, qualname)



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/aa8eb78f1b75a076e9014172476dc7eda53d6ff4...614e22be91c81b3758999b42bcf57bc330c6340f

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/aa8eb78f1b75a076e9014172476dc7eda53d6ff4...614e22be91c81b3758999b42bcf57bc330c6340f
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to