Accounts do not correspond to the xml definition, while not surcharged, and tryton refuses to save modifications (not valid according to it's domain)

Hello,

following Belgian PCMN: how to assign invoiced amounts to a 2xx account? - #6 by ced I created children accounts under « 288 - Cautionnements versés en numéraires », and gave them all (including 288 I think) type «Actifs immobilisés - IV - C - 2», on which I activated the depot checkbox. All was well and life went on.

I don’t know if it’s related to the issue, but at some point I upgraded to 6.4 (and am currently stuck there because of Can not update chart template from older versions (#12280) · Issues · Tryton / Tryton · GitLab).

I recently received a new invoice for which there is an amount that should go to one of those accounts, but they don’t appear in the list of possible accounts when I encode the invoice line.

When I go to the definition for those accounts, they are indeed now of type «Actifs immobilisés - IV». Which is (correctly) not depot ready. But which is not what I made them.

Another symptom that might be related: when I go to the chart of accounts, foldable tree view, and I unfold the 28 account, tryton suddenly proposes that I save the form (the save button is active). But I have not modified anything.

I can reset the form (which takes time) and go deeper, but as long as 28 is unfolded, the save button stays active.

I saved the db to be able to rollback and pressed the save button, but then I received an error message stating that the field value «children» for «account» is not valid according to its domain.

So I’m stuck, I don’t know what I can or cannot do to solve the issue without damaging my accounting…

Help ? :slight_smile:

more information: what I see in account_be_fr.xml does not correspond to what I see in tryton…

        <record id="28_fr" model="account.account.template">
            <field name="name">Immobilisations financières</field>
            
            <field name="code">28</field>
            <field name="parent" ref="2_fr"/>
        </record>

so account 28 should not have a type, but it has one: Plan de types de compte (Belgique)\Actif\Actifs immobilisés\IV. Immobilisations financières. When I open that account’s form, tryton wants to save even though I have changed nothing, and that’s where the error message «the field value «children» for «account» is not valid according to its domain» happens.

        <record id="288_fr" model="account.account.template">
            <field name="name">Cautionnements versés en numéraires</field>
            
            <field name="code">288</field>
            <field name="type" ref="actif_IV_C_2_fr"/>
            <field name="parent" ref="28_fr"/>
        </record>

so 288 should have type actif_IV_C_2, but it has actif_IV (Plan de types de compte (Belgique)\Actif\Actifs immobilisés\IV. Immobilisations financières). There tryton does not propose to save anything.

The «Surcharger le modèle» checkbox is not checked anywhere, except in the actif_IV_C_2 account type for which I checked «depot».

Why is what I see in tryton not what is in the xml file ???

That’s the bug you refer. So you must modify the account to remove the type by checking the override template.
Later when you update to a version with the fix, you can remove the override.

Did you run an update of the chart?

overriding the template and blanking the type for 28 and 288 did it.

It still errors out when I try to update the chart, I guess there are other accounts where the type is wrong. That will be fixed when I can upgrade to 7.0, I hope that it doesn’t prove problematic in the meantime.

Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.