Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMP l10n_it_account removing check_balance_sign_coherence. #4431

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

eLBati
Copy link
Member

@eLBati eLBati commented Oct 30, 2024

This check can block chart of accounts configuration and is not mandatory. account_balance_sign is only used by l10n_it_financial_statements_report and, in case of incoherent signs, user can visualize the amounts in financial_statements_report and fix the sign, in case

@SirAionTech SirAionTech added the needs fixing Has conflicts or is failing mandatory CI checks label Oct 31, 2024
@eLBati eLBati marked this pull request as draft October 31, 2024 08:52
@eLBati eLBati force-pushed the 16.0-check_balance_sign_coherence branch 4 times, most recently from 0e0c3c4 to a559471 Compare October 31, 2024 09:39
@eLBati eLBati marked this pull request as ready for review October 31, 2024 09:40
@eLBati eLBati force-pushed the 16.0-check_balance_sign_coherence branch from a559471 to 2a146b2 Compare November 4, 2024 11:44
@eLBati
Copy link
Member Author

eLBati commented Nov 4, 2024

pre-commit verde

@SirAionTech SirAionTech removed the needs fixing Has conflicts or is failing mandatory CI checks label Nov 7, 2024
Copy link
Contributor

@SirAionTech SirAionTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth noting that with this PR, it is possible to have accounts with opposite sign in the same group:
image
without this PR, the same setup gives:
image
I think this is at least unexpected, but I'll rely on functional reviews for its correctness.

Could you please write in the commit the reason of this change instead of just describing it? Right now it is

[REF] l10n_it_account making making account_balance_sign computed and removing check_balance_sign_coherence

This is also suggested in https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#71commit-message:

commit messages should be self explanatory (long enough) including the name of the module that has been changed and the reason behind that change.

return True
benchmark = to_check[0].account_balance_sign
return all(a.account_balance_sign == benchmark for a in to_check)
def _compute_account_balance_sign(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a @api.depends("account_type"): I think it might help caching the correct value for an account instead of recomputing it every time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"account_type": "asset_current",
}
)
with self.assertRaises(ValidationError):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the test or add a new one to verify the new behavior instead of removing it

@eLBati eLBati force-pushed the 16.0-check_balance_sign_coherence branch from 2a146b2 to ad2f698 Compare November 13, 2024 08:20
…ng check_balance_sign_coherence.

account_balance_sign is now computed, based on account type.
Therefore many checks are now redundant.

There is not need to save account's sign directly on account , as sign substantially depends on account type.
Saving it on account and check coherence afterwards often produces errors hard to understand by users, as they are not needed.
@eLBati eLBati force-pushed the 16.0-check_balance_sign_coherence branch from ad2f698 to 92e11cc Compare November 13, 2024 08:22
@eLBati
Copy link
Member Author

eLBati commented Nov 13, 2024

I think this is at least unexpected

Mi pare il comportamento atteso invece, come mai non dovrebbe?

Could you please write in the commit the reason of this change instead of just describing it?

Esteso

@SirAionTech
Copy link
Contributor

I think this is at least unexpected

Mi pare il comportamento atteso invece, come mai non dovrebbe?

Nel gruppo di conti c'è un campo segno, nei singoli conti all'interno del gruppo c'è un campo segno; visto che sono oggetti imparentati mi aspetto che ci sia una specie di ereditarietà: se un gruppo ha un segno allora anche tutti i conti nel gruppo hanno lo stesso segno.

Se è il comportamento atteso da questa PR lo puoi chiarire? Sfido qualsiasi funzionale a capire che

removing check_balance_sign_coherence

o

This check can block chart of accounts configuration and is not mandatory. account_balance_sign is only used by l10n_it_financial_statements_report and, in case of incoherent signs, user can visualize the amounts in financial_statements_report and fix the sign, in case

Vuol dire che i conti all'interno di un gruppo possono avere segno diverso dal gruppo


P.S. ma quindi inglese o italiano?

@SirAionTech SirAionTech added the needs fixing Has conflicts or is failing mandatory CI checks label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
16.0 missing issue needs fixing Has conflicts or is failing mandatory CI checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants