[MIG] hr_personal_equipment_stock: Migration to 18.0#1462
[MIG] hr_personal_equipment_stock: Migration to 18.0#1462Alexgars73 wants to merge 19 commits intoOCA:18.0from
Conversation
a078371 to
06ff9a8
Compare
0a0f745 to
007e93c
Compare
Update hr_personal_equipment_stock.pot README.rst
Currently translated at 66.6% (12 of 18 strings) Translation: hr-13.0/hr-13.0-hr_personal_equipment_stock Translate-URL: https://translation.odoo-community.org/projects/hr-13-0/hr-13-0-hr_personal_equipment_stock/es/
Currently translated at 100.0% (21 of 21 strings) Translation: hr-14.0/hr-14.0-hr_personal_equipment_stock Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_personal_equipment_stock/it/
Currently translated at 100.0% (21 of 21 strings) Translation: hr-14.0/hr-14.0-hr_personal_equipment_stock Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_personal_equipment_stock/it/
Currently translated at 100.0% (21 of 21 strings) Translation: hr-14.0/hr-14.0-hr_personal_equipment_stock Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_personal_equipment_stock/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-16.0/hr-16.0-hr_personal_equipment_stock Translate-URL: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_personal_equipment_stock/
007e93c to
ed02a94
Compare
c26ce86 to
f2e841b
Compare
7530456 to
179c302
Compare
|
This PR has the |
|
/ocabot merge nump |
|
Hi @rvalyi. Your command failed:
Ocabot commands
More information
|
|
Hi @rvalyi, please could you retry merge? Thank you! |
|
@rvalyi @OCA/human-resources-maintainers could you please retry the merge? Thanks! |
|
@OCA/human-resources-maintainers Please, can you review/merge this PR? |
alexey-pelykh
left a comment
There was a problem hiding this comment.
Thanks for the migration, overall a solid port. A few things I noticed:
stock_picking.py -- _action_done treats self as singleton
_action_done is called on a recordset but the code accesses self.equipment_request_id directly without iterating. This will break (or silently misbehave) when multiple pickings are validated together. Should be wrapped in for picking in self:.
stock_picking.py -- UoM conversion is a no-op
Lines computing qty_initial and qty_done both convert from line.product_uom_id to line.product_uom_id (same UoM). This was probably intended to normalize from the move's UoM to the line's UoM, but as written it does nothing. Consider whether this conversion is actually needed or if a direct comparison of line.quantity <= line.qty_delivered would suffice.
hr_personal_equipment.py -- dead product type check
In _skip_procurement, the check for "product" in product types is a leftover from pre-17.0. Since Odoo 17+ the storable type was merged into "consu" (with is_storable flag). Not a bug, but cleaning it up would be consistent with an 18.0 migration. Could be simplified to self.product_id.type != "consu" or, for 18.0 correctness, check self.product_id.type == "service".
|
|
||
| def _action_done(self): | ||
| res = super()._action_done() | ||
| if self.equipment_request_id: |
There was a problem hiding this comment.
_action_done can be called on a multi-record recordset. Accessing self.equipment_request_id directly without iterating will raise if len(self) > 1, or silently process only the first record. Wrap the body in for picking in self: and replace self references with picking.
| lambda x, move=move: x.product_id == move.product_id | ||
| ) | ||
| for line in request_lines: | ||
| qty_initial = line.product_uom_id._compute_quantity( |
There was a problem hiding this comment.
Both qty_initial and qty_done convert from line.product_uom_id to line.product_uom_id -- this is converting a UoM to itself, so it's always a no-op. Was this meant to convert from the move's UoM?
| line.qty_delivered = qty | ||
|
|
||
| def _skip_procurement(self): | ||
| return self.product_id.type not in ("consu", "product") |
There was a problem hiding this comment.
Since Odoo 17+, the "product" type no longer exists (storable products are "consu" with is_storable=True). This check still works but the "product" branch is dead code. For an 18.0 module, consider simplifying to self.product_id.type == "service".
179c302 to
a2d278f
Compare
Depends #1416