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


Commits:
dcf09b08 by Cédric Krier at 2023-02-06T19:01:17+01:00
Remove type from parent when children have different types

Closes #12070
- - - - -
c3fb2101 by Cédric Krier at 2023-02-06T19:02:27+01:00
Require account type when parent has one

The domain added by c39ad0bef61e is not enough to ensure type coherence
because if the type is None, the domain is still valid.
- - - - -


2 changed files:

- modules/account/account.py
- modules/account_fr/account_fr.xml


Changes:

=====================================
modules/account/account.py
=====================================
@@ -563,6 +563,10 @@
                         ('id', '=', Eval('_parent_parent.%s' % type_)),
                         ()),
                     ]
+                field.states['required'] = (
+                    Eval('parent')
+                    & Eval('_parent_parent.%s' % type_)
+                    & Eval('_parent_parent.parent'))
 
                 cls.childs.domain.append(
                     If(Eval(type_) & Eval('parent'),


=====================================
modules/account_fr/account_fr.xml
=====================================
@@ -4045,8 +4045,7 @@
         <record model="account.account.template" id="2976">
             <field name="name">Autres créances immobilisées</field>
             <field name="code">2976</field>
-            <field name="type" ref="immobilisations_financieres_autres"/>
-            <field name="closed" eval="True"/>
+            <field name="type" eval="None"/>
             <field name="parent" ref="297"/>
         </record>
         <record model="account.account.template" id="29761">
@@ -6017,8 +6016,7 @@
         <record model="account.account.template" id="59">
             <field name="name">Dépréciation des comptes financiers</field>
             <field name="code">59</field>
-            <field name="type" ref="actions_propres"/>
-            <field name="closed" eval="True"/>
+            <field name="type" eval="None"/>
             <field name="parent" ref="5"/>
         </record>
         <record model="account.account.template" id="590">
@@ -6319,8 +6317,7 @@
         <record model="account.account.template" id="61">
             <field name="name">Services extérieurs</field>
             <field name="code">61</field>
-            <field name="type" ref="autres_achats"/>
-            <field name="closed" eval="True"/>
+            <field name="type" eval="None"/>
             <field name="parent" ref="61_62"/>
         </record>
         <record model="account.account.template" id="611">



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/3b15c1378292b82d37725117017eac723677fe66...c3fb2101cb48eed8323a1e46cf187d211c4552bd

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


Reply via email to