Behavior of analytical lines when duplicating an account move

When an account move is duplicated, the related analytical lines are also duplicated. The new account move is created in draft state and the analytical lines are created in valid state.

If the amount of the account move is changed, Tryton prevents the posting because the relationship with the analytical line is incorrect.

However, if only the date is changed, the accounting entry can be posted creating a discrepancy between the date of the account move and the date of the analytical line.

Is this behavior correct?

I think that this behavior can lead to errors and that we should add some control over the modification of dates.

Could you explain which error is raised? I do not see any error in the source code that matches your statements. Maybe I’m missing something.

Indeed there is no check that the date of the analytic move is the same as the date of the account move when creating analytic lines. So for now we support that the dates are different. If this is something that is not allowed probably we should remove the date field from the analytic lines and always use the move date for reporting.

I think what are you explaining is not related to duplicating moves but just when manually creating analytic lines.