[16.0][ADD] hr_personal_equipment_request_sign_oca: Show S/N in PPE Request Report#137
[16.0][ADD] hr_personal_equipment_request_sign_oca: Show S/N in PPE Request Report#137
Conversation
HekkiMelody
left a comment
There was a problem hiding this comment.
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.
suggestion: instead of doing this configuration for the entire installation, we could do this per company. What do you think?
| # 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.
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"
)c869182 to
fc41970
Compare
| readonly=False, | ||
| ) | ||
|
|
||
| show_sn_report = fields.Boolean( |
There was a problem hiding this comment.
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.
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
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.