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

[17.0][MIG] account_invoice_start_end_dates: Migration to 17.0 #4

Open
wants to merge 62 commits into
base: 17.0
Choose a base branch
from

Conversation

lethuthao2403
Copy link
Owner

No description provided.

alexis-via and others added 30 commits November 28, 2023 15:36
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
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-12.0/account-closing-12.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_invoice_start_end_dates/
Default value for cutoff date is end date of previous fiscal year
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-13.0/account-closing-13.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-13-0/account-closing-13-0-account_invoice_start_end_dates/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-13.0/account-closing-13.0-account_invoice_start_end_dates
Translate-URL: https://translation.odoo-community.org/projects/account-closing-13-0/account-closing-13-0-account_invoice_start_end_dates/
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/
Alexis de Lattre and others added 12 commits November 28, 2023 15:41
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
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
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/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
Co-authored-by: Alexis de Lattre <alexis@via.ecp.fr>
@lethuthao2403 lethuthao2403 force-pushed the 17.0-mig-account_invoice_start_end_dates branch 5 times, most recently from 782cc5a to 52eedd7 Compare November 29, 2023 06:34
Copy link

@nguyenminhchien nguyenminhchien left a comment

Choose a reason for hiding this comment

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

Pre-commit message is incorrect

Choose a reason for hiding this comment

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

==> Tree view start_end_dates.view_move_line_tree at the line <field name="must_have_dates" invisible="1" />
replace invisible by column_invisible

@@ -20,9 +20,8 @@ def _post(self, soft=True):
raise UserError(
_(
"Missing Start Date and End Date for invoice "
"line with Product '%s' which has the "
"line with Product '{line.product_id.display_name}' which has the "

Choose a reason for hiding this comment

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

string parsing is incorrect:
image

Copy link

@nguyenminhchien nguyenminhchien Nov 30, 2023

Choose a reason for hiding this comment

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

replace "line with Product '{line.product_id.display_name}' which has the "
by f"line with Product '{line.product_id.display_name}' which has the "

Choose a reason for hiding this comment

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

are you sure about that? why not keeping the same translation string and use form _("", line.product_id.display_name)?

Choose a reason for hiding this comment

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

you're right, i made a mistake. @lethuthao2403 waits for me to have a look, will inform you then.

@@ -19,11 +19,11 @@ def _check_start_end_dates(self):
for moveline in self:
if moveline.start_date and not moveline.end_date:
raise ValidationError(
_("Missing End Date for line '%s'.") % (moveline.display_name)
_("Missing End Date for line '{moveline.display_name}'.")

Choose a reason for hiding this comment

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

string parsing is incorrect

)
if moveline.end_date and not moveline.start_date:
raise ValidationError(
_("Missing Start Date for line '%s'.") % (moveline.display_name)
_("Missing Start Date for line '{moveline.display_name}'.")

Choose a reason for hiding this comment

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

string parsing is incorrect

@lethuthao2403 lethuthao2403 force-pushed the 17.0-mig-account_invoice_start_end_dates branch from 52eedd7 to 61885c8 Compare November 30, 2023 05:04
@lethuthao2403
Copy link
Owner Author

@nguyenminhchien the PR has been updated. Thank you!

Copy link

@nguyenminhchien nguyenminhchien left a comment

Choose a reason for hiding this comment

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

I made a mistake about fstring, i add some suggestion, please update

)
if moveline.end_date and not moveline.start_date:
raise ValidationError(
_(f"Missing Start Date for line '{moveline.display_name}'.")

Choose a reason for hiding this comment

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

Suggested change
_(f"Missing Start Date for line '{moveline.display_name}'.")
_("Missing Start Date for line '%s'.", moveline.display_name)

for moveline in self:
if moveline.start_date and not moveline.end_date:
raise ValidationError(
_(f"Missing End Date for line '{moveline.display_name}'.")

Choose a reason for hiding this comment

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

Suggested change
_(f"Missing End Date for line '{moveline.display_name}'.")
_("Missing End Date for line '%s'.", moveline.display_name)

"Missing Start Date and End Date for invoice "
f"line with Product '{line.product_id.display_name}' which has the "
"property 'Must Have Start/End Dates'."
)

Choose a reason for hiding this comment

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

@lethuthao2403 please help to refactor:

                    raise UserError(
                        _(
                            "Missing Start Date and End Date for invoice "
                            "line with Product '%s' which has the "
                            "property 'Must Have Start/End Dates'.",
                            line.product_id.display_name,
                        )
                    )

@lethuthao2403 lethuthao2403 force-pushed the 17.0-mig-account_invoice_start_end_dates branch from 61885c8 to 76f32b4 Compare November 30, 2023 11:00
@lethuthao2403
Copy link
Owner Author

@nguyenminhchien the PR has been updated! Thank you.

@lethuthao2403 lethuthao2403 force-pushed the 17.0-mig-account_invoice_start_end_dates branch 2 times, most recently from ead9c00 to f499d0e Compare December 5, 2023 08:12
@lethuthao2403 lethuthao2403 force-pushed the 17.0-mig-account_invoice_start_end_dates branch from f499d0e to e075a60 Compare December 5, 2023 08:21
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.