Skip to content

[IMP][16.0] mis_builder: add possibility to dynamically hide a period depending on instance date#629

Closed
AnizR wants to merge 1 commit into
OCA:16.0from
acsone:imp-filter-period-base-date
Closed

[IMP][16.0] mis_builder: add possibility to dynamically hide a period depending on instance date#629
AnizR wants to merge 1 commit into
OCA:16.0from
acsone:imp-filter-period-base-date

Conversation

@AnizR

@AnizR AnizR commented Aug 28, 2024

Copy link
Copy Markdown
Contributor

Description

Related to issue: #617

This PR adds a boolean 'hide_period_based_on_instance_date' on periods of an instance.
When activated, the period will be shown only if the date of the instance is greater or equal to the end date of the period.

image

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@AnizR AnizR force-pushed the imp-filter-period-base-date branch 2 times, most recently from 84156ee to aa976ee Compare August 28, 2024 09:27

@SAnnabelle SAnnabelle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functionally it's correct.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖


hide_period_based_on_instance_date = fields.Boolean(
help="Dynamically hide this period depending on the base date of the instance",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

By just reading the field name and help text I don't understand what this does. Can you propose something more explanatory ?

Is it not better to talk about pivot date rather than base date? Not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It tried to improve it, what do you think?

Comment thread mis_builder/models/mis_report_instance.py Outdated
Comment thread mis_builder/models/mis_report_instance.py Outdated
options="{'model': 'source_aml_model_name'}"
attrs="{'invisible': [('source_aml_model_name', '=', False)]}"
/>
<field name="hide_period_based_on_instance_date" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this field should be hidden for some period types. For instance it does not make sense for comparison columns?

@AnizR AnizR Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've hide the field for comarison columns, is there any other case where I should hide this feature?

EDIT: I will do some changes #629 (comment)

@sbidoul sbidoul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few comments to handle.

@AnizR AnizR force-pushed the imp-filter-period-base-date branch 5 times, most recently from bcbded6 to 384bace Compare October 15, 2024 15:42
@AnizR

AnizR commented Oct 16, 2024

Copy link
Copy Markdown
Contributor Author

I have to make some changes:

  • If the field to dynamically hide period is not set to true, the col is always displayed
  • If the mode is fix, the period is displayed if the pivot date is before the end
  • A period with a source 'Acutals' or 'Actuals (alternative)' will always be displayed if the mode is not 'fix'
  • A period that sums columnns will be displayed if its 'source columns' should be displayed
  • A period that compares columns will be displayed if its 'source columns' should be displayed

@AnizR AnizR marked this pull request as draft October 16, 2024 09:24
@AnizR AnizR force-pushed the imp-filter-period-base-date branch 3 times, most recently from 06b99ff to 6ec757f Compare October 16, 2024 10:17
@AnizR AnizR marked this pull request as ready for review October 16, 2024 10:24
@AnizR AnizR force-pushed the imp-filter-period-base-date branch from 6ec757f to 151cd99 Compare October 22, 2024 07:17
Comment thread mis_builder/models/mis_report_instance.py Outdated
@AnizR AnizR force-pushed the imp-filter-period-base-date branch from 151cd99 to fff0139 Compare October 22, 2024 12:23
@AnizR AnizR force-pushed the imp-filter-period-base-date branch 2 times, most recently from a654214 to 4855ba5 Compare October 24, 2024 14:56
… depending on instance date

[IMP] mis_builder: make description of hide_period_based_on_instance_date mor 'explanatory'
[IMP] mis_builder: cleanup code
@AnizR AnizR force-pushed the imp-filter-period-base-date branch from 4855ba5 to b143553 Compare October 28, 2024 07:39
@sbidoul sbidoul added the 16.0 label Dec 11, 2024
@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 20, 2025
@github-actions github-actions Bot closed this May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

16.0 stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants