-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[18.0][MIG] web_widget_remaining_days_exact_date: Migration to 18.0 #3375
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
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] web_widget_remaining_days_exact_date: Migration to 18.0 #3375
Conversation
…date when remaining days shown This module is adding an option to the remaining_days widget to be able to show the exact date.
cb57ded to
b17d68c
Compare
b17d68c to
4c54e3f
Compare
celm1990
left a comment
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.
Code review: I think it is necessary to split the commits. Please keep a single commit with only the changes related to the migration. If you want to improve this module, I think it is better to create a new PR with the new features, or at least put them in a separate commit and not in the migration commit.
What do you think, @CarlosRoca13 ?
| @@ -0,0 +1,26 @@ | |||
| # Copyright 2025 Tecnativa - Carlos Roca Trescloud - César León | |||
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.
| # Copyright 2025 Tecnativa - Carlos Roca Trescloud - César León | |
| # Copyright 2025 Tecnativa - Carlos Roca | |
| # Copyright 2025 Trescloud - César León |
| raise models.ValidationError( | ||
| _( | ||
| "There is already a rule for the model '%s'." | ||
| " You cannot create two rules for the same model." | ||
| ) | ||
| % record.res_model_id.name | ||
| ) |
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.
| raise models.ValidationError( | |
| _( | |
| "There is already a rule for the model '%s'." | |
| " You cannot create two rules for the same model." | |
| ) | |
| % record.res_model_id.name | |
| ) | |
| raise models.ValidationError( | |
| self.env._( | |
| "There is already a rule for the model '%s'." | |
| " You cannot create two rules for the same model.", | |
| record.res_model_id.name | |
| ) | |
| ) |
| "line_ids": [ | ||
| ( | ||
| 0, | ||
| 0, | ||
| { | ||
| "name": name, | ||
| "technical_name": technical_name, | ||
| "active": active, | ||
| }, | ||
| ) | ||
| for name, technical_name, active in view_types | ||
| ], |
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.
| "line_ids": [ | |
| ( | |
| 0, | |
| 0, | |
| { | |
| "name": name, | |
| "technical_name": technical_name, | |
| "active": active, | |
| }, | |
| ) | |
| for name, technical_name, active in view_types | |
| ], | |
| "line_ids": [ | |
| Command.create( | |
| { | |
| "name": name, | |
| "technical_name": technical_name, | |
| "active": active, | |
| }, | |
| ) | |
| for name, technical_name, active in view_types | |
| ], |
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.
Please follow the OCA guidelines. The order of fields, CRUD methods, etc. is described here:
https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#37models
|
|
||
|
|
||
| @tagged("post_install", "-at_install") | ||
| class TestWidgetRemainingDaysExactDate(common.TransactionCase): |
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.
Please inherit from BaseCommon
| class TestWidgetRemainingDaysExactDate(common.TransactionCase): | |
| class TestWidgetRemainingDaysExactDate(BaseCommon): |
| @classmethod | ||
| def setUpClass(cls): | ||
| return super().setUpClass() |
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 this function does nothing, please remove it. Otherwise, implement the logic here to prepare the data for the test.
| @classmethod | |
| def setUpClass(cls): | |
| return super().setUpClass() |
| create="true" | ||
| edit="true" | ||
| delete="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.
These options are the default values, so it is not necessary to set them.
| create="true" | |
| edit="true" | |
| delete="true" |
| @@ -0,0 +1,49 @@ | |||
| /** @odoo-module **/ | |||
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.
| /** @odoo-module **/ |
| active = fields.Boolean( | ||
| string="Active record", | ||
| ) |
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 don’t see the point of having an active field in a TransientModel. Why do you need this field? I think it can be removed.
| active = fields.Boolean( | |
| string="Active record", | |
| ) |
No description provided.