Skip to content

[MIG] hr_personal_equipment_stock: Migration to 18.0#1462

Open
Alexgars73 wants to merge 19 commits intoOCA:18.0from
Studio73:18.0-mig-hr_personal_equipment_stock
Open

[MIG] hr_personal_equipment_stock: Migration to 18.0#1462
Alexgars73 wants to merge 19 commits intoOCA:18.0from
Studio73:18.0-mig-hr_personal_equipment_stock

Conversation

@Alexgars73
Copy link
Contributor

@Alexgars73 Alexgars73 commented Apr 22, 2025

Depends #1416

@Alexgars73 Alexgars73 force-pushed the 18.0-mig-hr_personal_equipment_stock branch 6 times, most recently from a078371 to 06ff9a8 Compare April 22, 2025 09:03
@Alexgars73 Alexgars73 force-pushed the 18.0-mig-hr_personal_equipment_stock branch 2 times, most recently from 0a0f745 to 007e93c Compare August 6, 2025 11:38
albariera and others added 18 commits November 5, 2025 08:39
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/
@Alexgars73 Alexgars73 force-pushed the 18.0-mig-hr_personal_equipment_stock branch from 007e93c to ed02a94 Compare November 5, 2025 07:39
@Alexgars73 Alexgars73 force-pushed the 18.0-mig-hr_personal_equipment_stock branch 2 times, most recently from c26ce86 to f2e841b Compare November 6, 2025 15:04
Copy link

@Reyes4711-S73 Reyes4711-S73 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@eugenios73 eugenios73 left a comment

Choose a reason for hiding this comment

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

LGFM

@Alexgars73 Alexgars73 force-pushed the 18.0-mig-hr_personal_equipment_stock branch 2 times, most recently from 7530456 to 179c302 Compare November 18, 2025 12:31
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@rvalyi
Copy link
Member

rvalyi commented Nov 30, 2025

/ocabot merge nump

@OCA-git-bot
Copy link
Contributor

Hi @rvalyi. Your command failed:

Invalid options for command merge: nump.

Ocabot commands

  • ocabot merge major|minor|patch|nobump
  • ocabot rebase
  • ocabot migration {MODULE_NAME}

More information

@quirino95
Copy link

Hi @rvalyi, please could you retry merge? Thank you!

@HekkiMelody
Copy link

@rvalyi @OCA/human-resources-maintainers could you please retry the merge? Thanks!

@Reyes4711-S73
Copy link

@OCA/human-resources-maintainers Please, can you review/merge this PR?

Copy link
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

_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(
Copy link
Contributor

Choose a reason for hiding this comment

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

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")
Copy link
Contributor

Choose a reason for hiding this comment

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

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".

@Alexgars73 Alexgars73 force-pushed the 18.0-mig-hr_personal_equipment_stock branch from 179c302 to a2d278f Compare March 2, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.