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

[18.0][MIG] account_invoice_start_end_dates: Migration to 18.0 #309

Open
wants to merge 49 commits into
base: 18.0
Choose a base branch
from

Conversation

xaviedoanhduy
Copy link

supersedes: #307

alexis-via and others added 30 commits November 13, 2024 14:32
Extract a new module account_invoice_start_end_dates from account_cutoff_prepaid
…art_end_dates: fixing tests fixing product not found convert mline dates to string fixing flake8 account_invoice_start_end_dates: fixing tests fixing product not found convert mline dates to string fixing flake8 putting removed licences back fix tests fix flake8 fix pylint issues

[12.0-mig-account] fix unit tests

fixup! [12.0-mig-account] fix unit tests

fixup! fixup! [12.0-mig-account] fix unit tests
Default value for cutoff date is end date of previous fiscal year
Currently translated at 88.2% (15 of 17 strings)

Translation: account-closing-14.0/account-closing-14.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-14-0/account-closing-14-0-account_invoice_start_end_dates/fr_FR/
Currently translated at 100.0% (14 of 14 strings)

Translation: account-closing-14.0/account-closing-14.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-14-0/account-closing-14-0-account_invoice_start_end_dates/pt/
Currently translated at 100.0% (14 of 14 strings)

Translation: account-closing-14.0/account-closing-14.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-14-0/account-closing-14-0-account_invoice_start_end_dates/it/
Currently translated at 100.0% (14 of 14 strings)

Translation: account-closing-15.0/account-closing-15.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-15-0/account-closing-15-0-account_invoice_start_end_dates/fr/
Currently translated at 100.0% (14 of 14 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/de/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/it/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/hr/
Currently translated at 15.3% (2 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/fa/
sanrav and others added 18 commits November 13, 2024 16:27
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/fr/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/fr_FR/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/it/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/it/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/fr/
Remove deprecated POT files
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/es/
Currently translated at 92.3% (12 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/hr/
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-16.0/account-closing-16.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_invoice_start_end_dates/fr/
Co-authored-by: Alexis de Lattre <[email protected]>
Currently translated at 100.0% (13 of 13 strings)

Translation: account-closing-17.0/account-closing-17.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_invoice_start_end_dates/it/
@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-mig-account_invoice_start_end_dates branch from fc3030f to 6f26308 Compare November 18, 2024 04:53
0,
0,
{
"product_id": self.env.ref("product.product_product_5").id,

Choose a reason for hiding this comment

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

looking at this test case i guess we test positive case here - all previous lines have dates set and we don't expect any error to be raised for product_product_5 because probably this product has no flag set - i'd maybe add some comments in this case + test negative case (where error should be raised)?

Copy link
Author

@xaviedoanhduy xaviedoanhduy Nov 19, 2024

Choose a reason for hiding this comment

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

if moveline.start_date and not moveline.end_date:
    ...
if moveline.end_date and not moveline.start_date:
    ...
if (
    moveline.end_date
    and moveline.start_date
    and moveline.start_date > moveline.end_date
):

hi @ajaniszewska-dev, I had the same question as you, I'm not sure what the author of this module intended, because the above conditions require at least 1 value to be assigned to start_date and end_date, so if no value is inputed, no error will be raised. I tried adding a filter in the lookup function like:

def _check_start_end_dates(self):
    for moveline in self.filtered("must_have_date"):
         ...

then the error will be raised, and I wonder if that change affects the original purpose of this module?

Choose a reason for hiding this comment

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

@alexis-via probably your input here would be valuable.

Copy link

@ajaniszewska-dev ajaniszewska-dev left a comment

Choose a reason for hiding this comment

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

LG, i'd slightly improve test

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.