-
-
Notifications
You must be signed in to change notification settings - Fork 59
[16.0][ADD] hr_personal_equipment_request_sign_oca: Show S/N in PPE Request Report #137
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: 16.0
Are you sure you want to change the base?
[16.0][ADD] hr_personal_equipment_request_sign_oca: Show S/N in PPE Request Report #137
Conversation
aleuffre
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, just a minor comment, otherwise LGTM
| @api.model | ||
| def _default_show_sn_report(self): | ||
| return bool( | ||
| self.env["ir.config_parameter"] | ||
| .sudo() | ||
| .get_param("hr_personal_equipment_request_sign_oca.show_sn_report", False) | ||
| ) |
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.
suggestion: instead of doing this configuration for the entire installation, we could do this per company. What do you 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.
I agree, updated settings.
| # flake8: noqa: B950 | ||
| cls.template = cls.env.ref( | ||
| "hr_personal_equipment_request_sign_oca.sign_oca_template_personal_equipment_request_demo" | ||
| ) |
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.
suggestion (non-blocking): you can avoid disabling flake with the comment by splitting the string on two lines
cls.template = cls.env.ref(
"hr_personal_equipment_request_sign_oca."
"sign_oca_template_personal_equipment_request_demo"
)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.
Very useful, thank you!
c869182 to
fc41970
Compare
| readonly=False, | ||
| ) | ||
|
|
||
| show_sn_report = fields.Boolean( |
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.
chore: sorry to nitpick, but settings and company have A LOT of fields from every possible module, so it's good practice to "namespace" the fields by using appropriately specific names. The likelihood of another entirely unrelated module adding a field with this name in the setting is relatively high.
Maybe ppe_report_show_sn?
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.
Don't worry, you're absolutely right. Yes, ppe_report_show_sn is good for me too, so I've updated code.
fc41970 to
846b073
Compare
aleuffre
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, LGTM
Depends on #127
Added possibility to show Serial Numbers in PPEs request report file. A related setting is present (default is
False).This also means that Sign request cannot be created on Personal Equipment Request Acceptance, but now it's done only when related pickings are completed.
Furthermore, now in report only "Valid" lines are visible, since showing cancelled lines doesn't make sense.