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][IMP] l10n_be_cooperator: tax shelter report #112

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

victor-champonnois
Copy link
Member

Makes tax shelter attestation consistent with administration templates

internal task : https://gestion.coopiteasy.be/web#id=11176&action=475&active_id=524&model=project.task&view_type=form&menu_id=536

@huguesdk

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch 2 times, most recently from e806f5c to 823b5ad Compare February 9, 2024 16:36
@victor-champonnois victor-champonnois changed the title [16.0][IMP] l10n_be_cooperator: tax shelter report [WIP][16.0][IMP] l10n_be_cooperator: tax shelter report Feb 9, 2024
@victor-champonnois victor-champonnois marked this pull request as draft February 9, 2024 17:12
@victor-champonnois
Copy link
Member Author

@huguesdk not ready yet : I need to fix the tests

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch from 823b5ad to 86c73d7 Compare February 13, 2024 09:04
@victor-champonnois
Copy link
Member Author

victor-champonnois commented Feb 13, 2024

@huguesdk now ready for review.
Note : I was first tempted to remove the table with a recap of the shares in the certificates, since it is not legally required, and would greatly simplify the module.
But I wasn't sure if we wanted to do that, since this functionality may still be interesting. So I reverted the commit.
I leave you to decide :)
If we do it, I would have to remove some tests.

@victor-champonnois victor-champonnois marked this pull request as ready for review February 13, 2024 09:14
@victor-champonnois victor-champonnois changed the title [WIP][16.0][IMP] l10n_be_cooperator: tax shelter report [16.0][IMP] l10n_be_cooperator: tax shelter report Feb 19, 2024
Copy link
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

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

thanks @victor-champonnois for these useful improvements!

@@ -17,22 +17,23 @@ class TaxShelterDeclaration(models.Model):
_description = "Tax Shelter Declaration"

name = fields.Char(string="Declaration year", required=True)
fiscal_year = fields.Char(string="Fiscal year", required=True)
Copy link
Member

Choose a reason for hiding this comment

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

i agree with the changes that remove the string when it corresponds to the field name, but keep in mind that this will capitalize each word. this is what we want (standard odoo practice), but the translations need to be updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, the translations should be done after the merge with weblate I think.

Copy link
Member

Choose a reason for hiding this comment

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

as discussed, it is better that minor changes (capitalization, language mistakes) are dealt with by the developer directly, to avoid useless work for translators.

string="Tax Shelter percentage",
date_from = fields.Date(required=True)
date_to = fields.Date(required=True)
tax_shelter_report_type = fields.Selection(
Copy link
Member

Choose a reason for hiding this comment

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

a migration script is needed to set the value of this field.

Comment on lines 138 to 139
<span t-if="report_type=='scale_up'">14527</span>
, CIR 92 sur les revenus
Copy link
Member

Choose a reason for hiding this comment

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

the comma should be just after </span>, otherwise a (hideous) space appears before the comma.

Copy link
Member Author

@victor-champonnois victor-champonnois Feb 22, 2024

Choose a reason for hiding this comment

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

fixed (indeed, what's more hideous than a misplaced space...^^)

Comment on lines 159 to 162
les conditions prévues aux § 1er et 2 de l'article 14527, CIR 92, sont respectées
</span>
<span t-if="report_type=='scale_up'">
les conditions prévues au § 3, alinéa 1er, de l’article 14526, CIR 92, sont respectées
Copy link
Member

Choose a reason for hiding this comment

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

aren’t the article numbers swapped here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, nice catch !

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch 2 times, most recently from 80abe58 to df4a97e Compare February 22, 2024 10:58
@victor-champonnois
Copy link
Member Author

@huguesdk thank you for the extensive review!

  • I added your requests
  • I removed the commits that removed the table, since the table is necessary and useful
  • I added a commit to remove the "capital before" and "capital after". These columns are not legally necessary, and some companies might not like it.
  • made the table format less weird (according to my own personal taste)

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch 2 times, most recently from 418ffac to 4a3097d Compare February 23, 2024 10:45
Copy link
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

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

thanks, we’re almost there!

Comment on lines 6 to 8
if not openupgrade.column_exists(
env.cr, "tax_shelter_declaration", "tax_shelter_type"
):
Copy link
Member

Choose a reason for hiding this comment

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

this test is not needed, and in fact, the dependency on openupgradelib is not necessary. a normal odoo migration script should do.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed the test. I think I still need openupgrade for openupgrade.logged_query, it doesn't seem to work otherwise

Copy link
Member

Choose a reason for hiding this comment

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

if you declare the migrate function (without the openupgrade decorator) as:

def migrate(cr, version):

you can do:

cr.execute("some query")

@@ -17,22 +17,23 @@ class TaxShelterDeclaration(models.Model):
_description = "Tax Shelter Declaration"

name = fields.Char(string="Declaration year", required=True)
fiscal_year = fields.Char(string="Fiscal year", required=True)
Copy link
Member

Choose a reason for hiding this comment

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

as discussed, it is better that minor changes (capitalization, language mistakes) are dealt with by the developer directly, to avoid useless work for translators.

Comment on lines 33 to 39
string="Tax Shelter percentage",
required=True,
compute="_compute_tax_shelter_percentage",
readonly=True,
Copy link
Member

Choose a reason for hiding this comment

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

great! i first thought that it would be better to have it as a simple string and stored, but i changed my mind and it is good like that:

  • no need to store it, at it is derived from the type, and there is a pre-migration script to set the values
  • having the labels directly in the field allows to handle the localization (spacing, using the percentage sign or not,…) once in the translation files instead of handling each case separately in the email templates and the reports.

readonly=True should be removed, as it is the default for computed fields.

Copy link
Member

Choose a reason for hiding this comment

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

i eventually changed it to float, to avoid repetition of the different cases while ensuring correct localization in case there are decimals.

Copy link
Member Author

Choose a reason for hiding this comment

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

If it is not stored, I get the warning tax.shelter.declaration: inconsistent 'compute_sudo' for computed fields: tax_shelter_percentage, tax_shelter_capital_limit , So I've put the store back

@victor-champonnois
Copy link
Member Author

@huguesdk

  • updated the po and pot files
  • updated the migration script (but kept the openupgrade dependency)
  • added store on tax shelter percentages because of a warning

Comment on lines 6 to 8
if not openupgrade.column_exists(
env.cr, "tax_shelter_declaration", "tax_shelter_type"
):
Copy link
Member

Choose a reason for hiding this comment

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

if you declare the migrate function (without the openupgrade decorator) as:

def migrate(cr, version):

you can do:

cr.execute("some query")

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch from 3c76cc1 to 1fad881 Compare February 26, 2024 14:45
@victor-champonnois
Copy link
Member Author

@huguesdk done (although I don't see the query in the log, which is a bit sad)

@victor-champonnois
Copy link
Member Author

@huguesdk can we merge this PR ? It would be nice to to have it ready for the next tax shelter period

@huguesdk huguesdk force-pushed the 16.0-improve-tax-shelter-report branch 2 times, most recently from c427fc5 to 9b07ce9 Compare March 6, 2024 16:30
@huguesdk
Copy link
Member

huguesdk commented Mar 6, 2024

@victor-champonnois i checked the text of the certificates and noticed that the list of requirements did not change according to the report type and the tax shelter type. i fixed this and did also some improvements in the report (change some wording, use t tags instead of span tags for conditions, improve indentation). i also added and improved some translations. please test on your side and tell me if you think it is ready.

edit: if ready, in addition to squashing commits, adding news fragments would be nice.

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch from 9b07ce9 to 218e987 Compare March 7, 2024 15:18
@victor-champonnois
Copy link
Member Author

@huguesdk thanks for the change, I've tested and it looks OK. I've squashed all the commits, keeping the detail of what has been done in the commit message.

@victor-champonnois victor-champonnois force-pushed the 16.0-improve-tax-shelter-report branch from 218e987 to 80abfb2 Compare March 7, 2024 15:31
@victor-champonnois
Copy link
Member Author

and I added a small newsfragment. Ready to merge !

Improve reports based on the templates provided by the administration:
https://finances.belgium.be/fr/entreprises/tax-shelter-petites-entreprises/debutantes-start-up
https://finances.belgium.be/fr/entreprises/tax-shelter-petites-entreprises/en-croissance-scale-up

* simplify the layout and the text and make it consistent with the type
  of company (start-up/scale-up).
* remove month_from and month_to; these fields are no longer used in the
  report, so they are not necessary anymore.
* add roadmap for scaleup tax shelter report.
* prettify the tax shelter report table.
* add tax_shelter_type field (and script to prefill it).
* set default capital limit based on tax shelter type.
* update and improve translations.

Co-authored-by: hugues de keyzer <odoo@hugues.info>
@huguesdk huguesdk force-pushed the 16.0-improve-tax-shelter-report branch from 80abfb2 to cfcf8da Compare March 8, 2024 09:22
Copy link
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

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

🎉 many thanks, @victor-champonnois!

@huguesdk
Copy link
Member

huguesdk commented Mar 8, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-112-by-huguesdk-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 5991eb2 into OCA:16.0 Mar 8, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 45edc78. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants