-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
[16.0][IMP] l10n_be_cooperator: tax shelter report #112
Conversation
e806f5c
to
823b5ad
Compare
@huguesdk not ready yet : I need to fix the tests |
823b5ad
to
86c73d7
Compare
@huguesdk now ready for review. |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
<span t-if="report_type=='scale_up'">14527</span> | ||
, CIR 92 sur les revenus |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...^^)
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, nice catch !
80abe58
to
df4a97e
Compare
@huguesdk thank you for the extensive review!
|
418ffac
to
4a3097d
Compare
There was a problem hiding this 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!
if not openupgrade.column_exists( | ||
env.cr, "tax_shelter_declaration", "tax_shelter_type" | ||
): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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", | ||
required=True, | ||
compute="_compute_tax_shelter_percentage", | ||
readonly=True, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
if not openupgrade.column_exists( | ||
env.cr, "tax_shelter_declaration", "tax_shelter_type" | ||
): |
There was a problem hiding this comment.
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")
3c76cc1
to
1fad881
Compare
@huguesdk done (although I don't see the query in the log, which is a bit sad) |
@huguesdk can we merge this PR ? It would be nice to to have it ready for the next tax shelter period |
c427fc5
to
9b07ce9
Compare
@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 edit: if ready, in addition to squashing commits, adding news fragments would be nice. |
9b07ce9
to
218e987
Compare
@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. |
218e987
to
80abfb2
Compare
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>
80abfb2
to
cfcf8da
Compare
There was a problem hiding this 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!
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 45edc78. Thanks a lot for contributing to OCA. ❤️ |
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