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

[account_mtd_vat] Get rid of parallel ifs and God View #9

Open
Nick-OpusVL opened this issue Jun 19, 2019 · 0 comments
Open

[account_mtd_vat] Get rid of parallel ifs and God View #9

Nick-OpusVL opened this issue Jun 19, 2019 · 0 comments

Comments

@Nick-OpusVL
Copy link
Contributor

God View, and parallel ifs.

God View means one big view covering the union of all the different fields and layouts needed for the different steps of the submission process, with arcane 'attrs' rules switching fields on and off (see also "parallel ifs" below - this is a specific case of that). There is also a God Object issue but I'm not sure if that will be as easy to fix - we should look and see if it is though, but aggressively applying the Strategy pattern might resolve this.

"Parallel ifs" means we're switching on the same field in multiple methods, and/or have multiple dispatch tables on the same thing.

Replace the parallel ifs with Strategy pattern. Also use that to get rid of all the horrible switching on view name.

Replace the God View with a separate XML view per step (possibly with common stuff inherited from a base one) and switch between them in fields_view_get from the Strategies introduced when removing the parallel ifs.

@Nick-OpusVL Nick-OpusVL changed the title [account_mtd*] Antipatterns abound [account_mtd*] Get rid of parallel ifs and God View Jun 19, 2019
@Nick-OpusVL Nick-OpusVL changed the title [account_mtd*] Get rid of parallel ifs and God View [account_mtd_vat] Get rid of parallel ifs and God View Jun 19, 2019
@Nick-OpusVL Nick-OpusVL transferred this issue from OpusVL/odoo-account-extras Jul 16, 2019
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

No branches or pull requests

1 participant