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

[16.0][l10n_br_fiscal][IMP] l10n_br_fiscal: standardize data+demo load #3567

Draft
wants to merge 3 commits into
base: 16.0
Choose a base branch
from

Conversation

rvalyi
Copy link
Member

@rvalyi rvalyi commented Dec 30, 2024

Standardize the loading of all l10n_br_fiscal data + demo files.

In l10n_br_fiscal we have some very specific challenges:

  • loading all the production fiscal data for the tax engine takes 3 minutes and a lot of CPU, this is a no go for demo and tests. This is why we had these subset demo files for NCM, NBM, NBS, CEST...
  • for mission critical cases, some fiscal data might better be altered by some fiscal power user and keep noupdate=True. If noupdate were False, reloading the l10n_br_fiscal module would also take a lot of time. By default modules data files load with noupdate=False.

This explains the peculiar loading hook we used in l10n_br_fiscal/hooks.py until now.

But after working on the isolation of the tests from the generic demo data, I also got convinced we could finally standardize the loading of the data + demo files.

In fact all it takes is a custom monkey patch of the odoo.tools.convert.convert_csv_file method to force noupdate=True for some files and to be able to filter and load only some demo records in demo/test mode for some large csv files.

Benefits:

@OCA-git-bot
Copy link
Contributor

Hi @renatonlima,
some modules you are maintaining are being modified, check this out!

@rvalyi rvalyi force-pushed the 16.0-better-loading branch from 815032a to 1b18a91 Compare January 7, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants